Spaces:
Running
on
Zero
Running
on
Zero
updated
Browse files
app.py
CHANGED
@@ -5,7 +5,6 @@ import spaces
|
|
5 |
from huggingface_hub import hf_hub_download
|
6 |
from utils import utils, tools, preprocess
|
7 |
|
8 |
-
BASE_MODEL_PATH = "stablediffusionapi/neta-art-xl-v2"
|
9 |
VAE_PATH = "madebyollin/sdxl-vae-fp16-fix"
|
10 |
REPO_ID = "Pbihao/ControlNeXt"
|
11 |
UNET_FILENAME = "ControlAny-SDXL/anime_canny/unet.safetensors"
|
@@ -18,6 +17,11 @@ DEFAULT_NEGATIVE_PROMPT = "worst quality, abstract, clumsy pose, deformed hand,
|
|
18 |
|
19 |
def ui():
|
20 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
|
|
|
|
|
|
|
|
|
|
21 |
unet_file = hf_hub_download(
|
22 |
repo_id=REPO_ID,
|
23 |
filename=UNET_FILENAME,
|
@@ -30,15 +34,14 @@ def ui():
|
|
30 |
)
|
31 |
|
32 |
pipeline = tools.get_pipeline(
|
33 |
-
pretrained_model_name_or_path=
|
34 |
unet_model_name_or_path=unet_file,
|
35 |
controlnet_model_name_or_path=controlnet_file,
|
36 |
vae_model_name_or_path=VAE_PATH,
|
37 |
-
|
38 |
load_weight_increasement=True,
|
39 |
device=device,
|
40 |
hf_cache_dir=CACHE_DIR,
|
41 |
-
use_safetensors=
|
42 |
)
|
43 |
|
44 |
preprocessors = ['canny']
|
|
|
5 |
from huggingface_hub import hf_hub_download
|
6 |
from utils import utils, tools, preprocess
|
7 |
|
|
|
8 |
VAE_PATH = "madebyollin/sdxl-vae-fp16-fix"
|
9 |
REPO_ID = "Pbihao/ControlNeXt"
|
10 |
UNET_FILENAME = "ControlAny-SDXL/anime_canny/unet.safetensors"
|
|
|
17 |
|
18 |
def ui():
|
19 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
20 |
+
model_file = hf_hub_download(
|
21 |
+
repo_id='neta-art/neta-xl-2.0',
|
22 |
+
filename='neta-xl-v2.fp16.safetensors',
|
23 |
+
cache_dir=CACHE_DIR,
|
24 |
+
)
|
25 |
unet_file = hf_hub_download(
|
26 |
repo_id=REPO_ID,
|
27 |
filename=UNET_FILENAME,
|
|
|
34 |
)
|
35 |
|
36 |
pipeline = tools.get_pipeline(
|
37 |
+
pretrained_model_name_or_path=model_file,
|
38 |
unet_model_name_or_path=unet_file,
|
39 |
controlnet_model_name_or_path=controlnet_file,
|
40 |
vae_model_name_or_path=VAE_PATH,
|
|
|
41 |
load_weight_increasement=True,
|
42 |
device=device,
|
43 |
hf_cache_dir=CACHE_DIR,
|
44 |
+
use_safetensors=True,
|
45 |
)
|
46 |
|
47 |
preprocessors = ['canny']
|