Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -139,16 +139,14 @@ def run_lora(prompt, image_input, image_strength, cfg_scale, steps, selected_ind
|
|
| 139 |
|
| 140 |
# Load LoRA weights
|
| 141 |
with calculateDuration(f"Loading LoRA weights for {selected_lora['title']}"):
|
| 142 |
-
if
|
| 143 |
-
|
| 144 |
-
|
| 145 |
-
|
| 146 |
-
|
| 147 |
-
|
| 148 |
-
|
| 149 |
-
|
| 150 |
-
else:
|
| 151 |
-
pipe.load_lora_weights(lora_path)
|
| 152 |
|
| 153 |
# Set random seed for reproducibility
|
| 154 |
with calculateDuration("Randomizing seed"):
|
|
|
|
| 139 |
|
| 140 |
# Load LoRA weights
|
| 141 |
with calculateDuration(f"Loading LoRA weights for {selected_lora['title']}"):
|
| 142 |
+
pipe_to_use = pipe_i2i if image_input is not None else pipe
|
| 143 |
+
weight_name = selected_lora.get("weights", None)
|
| 144 |
+
|
| 145 |
+
pipe_to_use.load_lora_weights(
|
| 146 |
+
lora_path,
|
| 147 |
+
weight_name=weight_name,
|
| 148 |
+
low_cpu_mem_usage=False
|
| 149 |
+
)
|
|
|
|
|
|
|
| 150 |
|
| 151 |
# Set random seed for reproducibility
|
| 152 |
with calculateDuration("Randomizing seed"):
|