Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -159,7 +159,10 @@ def run_lora(prompt, image_url, lora_strings_json, image_strength, cfg_scale, s
|
|
159 |
|
160 |
# Load LoRA weights
|
161 |
gr.Info("Start to load LoRA ...")
|
162 |
-
|
|
|
|
|
|
|
163 |
lora_configs = None
|
164 |
adapter_names = []
|
165 |
|
@@ -196,6 +199,7 @@ def run_lora(prompt, image_url, lora_strings_json, image_strength, cfg_scale, s
|
|
196 |
else:
|
197 |
txt2img_pipe.set_adapters(adapter_names, adapter_weights=adapter_weights)
|
198 |
|
|
|
199 |
|
200 |
# Generate image
|
201 |
error_message = ""
|
|
|
159 |
|
160 |
# Load LoRA weights
|
161 |
gr.Info("Start to load LoRA ...")
|
162 |
+
with calculateDuration("Unloading LoRA"):
|
163 |
+
img2img_pipe.unload_lora_weights()
|
164 |
+
txt2img_pipe.unload_lora_weights()
|
165 |
+
|
166 |
lora_configs = None
|
167 |
adapter_names = []
|
168 |
|
|
|
199 |
else:
|
200 |
txt2img_pipe.set_adapters(adapter_names, adapter_weights=adapter_weights)
|
201 |
|
202 |
+
print(txt2img_pipe.get_active_adapters())
|
203 |
|
204 |
# Generate image
|
205 |
error_message = ""
|