Spaces:
Running
on
Zero
Running
on
Zero
test
Browse files
app.py
CHANGED
@@ -13,7 +13,6 @@ CONTROLNET_FILENAME = "ControlAny-SDXL/anime_canny/controlnet.safetensors"
|
|
13 |
CACHE_DIR = None
|
14 |
|
15 |
|
16 |
-
@spaces.GPU
|
17 |
def ui():
|
18 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
19 |
model_file = hf_hub_download(
|
@@ -31,7 +30,8 @@ def ui():
|
|
31 |
filename=CONTROLNET_FILENAME,
|
32 |
cache_dir=CACHE_DIR,
|
33 |
)
|
34 |
-
|
|
|
35 |
pretrained_model_name_or_path=model_file,
|
36 |
unet_model_name_or_path=unet_file,
|
37 |
controlnet_model_name_or_path=controlnet_file,
|
@@ -109,6 +109,7 @@ def ui():
|
|
109 |
show_share_button=True,
|
110 |
)
|
111 |
|
|
|
112 |
def generate(
|
113 |
prompt,
|
114 |
control_image,
|
|
|
13 |
CACHE_DIR = None
|
14 |
|
15 |
|
|
|
16 |
def ui():
|
17 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
18 |
model_file = hf_hub_download(
|
|
|
30 |
filename=CONTROLNET_FILENAME,
|
31 |
cache_dir=CACHE_DIR,
|
32 |
)
|
33 |
+
|
34 |
+
pipeline = spaces.GPU(tools.get_pipeline)(
|
35 |
pretrained_model_name_or_path=model_file,
|
36 |
unet_model_name_or_path=unet_file,
|
37 |
controlnet_model_name_or_path=controlnet_file,
|
|
|
109 |
show_share_button=True,
|
110 |
)
|
111 |
|
112 |
+
@spaces.GPU
|
113 |
def generate(
|
114 |
prompt,
|
115 |
control_image,
|