Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -166,9 +166,7 @@ def run_lora(prompt, image_url, lora_strings_json, image_strength, cfg_scale, s
|
|
| 166 |
gr.Info("Start to load LoRA ...")
|
| 167 |
with calculateDuration("Unloading LoRA"):
|
| 168 |
img2img_pipe.unload_lora_weights()
|
| 169 |
-
# img2img_pipe.unload_lora()
|
| 170 |
txt2img_pipe.unload_lora_weights()
|
| 171 |
-
txt2img_pipe.unload_lora()
|
| 172 |
|
| 173 |
print(txt2img_pipe.get_active_adapters())
|
| 174 |
list_adapters_component_wise = txt2img_pipe.get_list_adapters()
|
|
@@ -237,7 +235,9 @@ def run_lora(prompt, image_url, lora_strings_json, image_strength, cfg_scale, s
|
|
| 237 |
result = {"status": "success", "message": "Image generated but not uploaded"}
|
| 238 |
else:
|
| 239 |
result = {"status": "failed", "message": error_message}
|
| 240 |
-
|
|
|
|
|
|
|
| 241 |
gr.Info("CompletedοΌ")
|
| 242 |
progress(100, "Completed!")
|
| 243 |
torch.cuda.empty_cache()
|
|
|
|
| 166 |
gr.Info("Start to load LoRA ...")
|
| 167 |
with calculateDuration("Unloading LoRA"):
|
| 168 |
img2img_pipe.unload_lora_weights()
|
|
|
|
| 169 |
txt2img_pipe.unload_lora_weights()
|
|
|
|
| 170 |
|
| 171 |
print(txt2img_pipe.get_active_adapters())
|
| 172 |
list_adapters_component_wise = txt2img_pipe.get_list_adapters()
|
|
|
|
| 235 |
result = {"status": "success", "message": "Image generated but not uploaded"}
|
| 236 |
else:
|
| 237 |
result = {"status": "failed", "message": error_message}
|
| 238 |
+
|
| 239 |
+
txt2img_pipe.delete_adapters(lora_names)
|
| 240 |
+
|
| 241 |
gr.Info("CompletedοΌ")
|
| 242 |
progress(100, "Completed!")
|
| 243 |
torch.cuda.empty_cache()
|