Spaces:
Runtime error
Runtime error
Commit
•
07a1077
1
Parent(s):
cef2631
Update app.py
Browse files
app.py
CHANGED
@@ -290,7 +290,6 @@ def generate_image(prompt_mash, steps, seed, cfg_scale, width, height, progress)
|
|
290 |
):
|
291 |
yield img
|
292 |
|
293 |
-
@spaces.GPU(duration=75)
|
294 |
def generate_image_to_image(prompt_mash, image_input_path, image_strength, steps, cfg_scale, width, height, seed):
|
295 |
pipe_i2i.to("cuda")
|
296 |
generator = torch.Generator(device="cuda").manual_seed(seed)
|
@@ -309,6 +308,7 @@ def generate_image_to_image(prompt_mash, image_input_path, image_strength, steps
|
|
309 |
).images[0]
|
310 |
return final_image
|
311 |
|
|
|
312 |
def run_lora(prompt, image_input, image_strength, cfg_scale, steps, selected_indices, lora_scale_1, lora_scale_2, randomize_seed, seed, width, height, loras_state, progress=gr.Progress(track_tqdm=True)):
|
313 |
if not selected_indices:
|
314 |
raise gr.Error("You must select at least one LoRA before proceeding.")
|
@@ -349,7 +349,7 @@ def run_lora(prompt, image_input, image_strength, cfg_scale, steps, selected_ind
|
|
349 |
pipe_to_use.load_lora_weights(
|
350 |
lora_path,
|
351 |
weight_name=weight_name if weight_name else None,
|
352 |
-
low_cpu_mem_usage=
|
353 |
adapter_name=lora_name
|
354 |
)
|
355 |
print("Loaded LoRAs:", lora_names)
|
|
|
290 |
):
|
291 |
yield img
|
292 |
|
|
|
293 |
def generate_image_to_image(prompt_mash, image_input_path, image_strength, steps, cfg_scale, width, height, seed):
|
294 |
pipe_i2i.to("cuda")
|
295 |
generator = torch.Generator(device="cuda").manual_seed(seed)
|
|
|
308 |
).images[0]
|
309 |
return final_image
|
310 |
|
311 |
+
@spaces.GPU(duration=75)
|
312 |
def run_lora(prompt, image_input, image_strength, cfg_scale, steps, selected_indices, lora_scale_1, lora_scale_2, randomize_seed, seed, width, height, loras_state, progress=gr.Progress(track_tqdm=True)):
|
313 |
if not selected_indices:
|
314 |
raise gr.Error("You must select at least one LoRA before proceeding.")
|
|
|
349 |
pipe_to_use.load_lora_weights(
|
350 |
lora_path,
|
351 |
weight_name=weight_name if weight_name else None,
|
352 |
+
low_cpu_mem_usage=True,
|
353 |
adapter_name=lora_name
|
354 |
)
|
355 |
print("Loaded LoRAs:", lora_names)
|