Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -58,6 +58,8 @@ try:
|
|
58 |
except Exception as e:
|
59 |
print(f"⚠️ Second LoRA '{LORA_2_NAME}' could not be loaded: {e}")
|
60 |
|
|
|
|
|
61 |
|
62 |
print("Initialization complete. Gradio is starting...")
|
63 |
|
@@ -69,7 +71,7 @@ def generate(prompt, negative_prompt, width=1024, height=1024, num_inference_ste
|
|
69 |
print("Activating both LoRAs for inference...")
|
70 |
# You can adjust the weights here to change the intensity of each LoRA.
|
71 |
# For example, [1.0, 0.8] would make the second LoRA less strong.
|
72 |
-
pipe.set_adapters([LORA_1_NAME, LORA_2_NAME], adapter_weights=[1.0, 1.0])
|
73 |
|
74 |
apply_cache_on_pipe(
|
75 |
pipe,
|
@@ -91,8 +93,9 @@ def generate(prompt, negative_prompt, width=1024, height=1024, num_inference_ste
|
|
91 |
finally:
|
92 |
# It's good practice to disable the adapters after the run,
|
93 |
# although set_adapters() at the start also handles this.
|
94 |
-
print("Disabling LoRAs after run.")
|
95 |
-
pipe.disable_lora()
|
|
|
96 |
|
97 |
|
98 |
iface = gr.Interface(
|
|
|
58 |
except Exception as e:
|
59 |
print(f"⚠️ Second LoRA '{LORA_2_NAME}' could not be loaded: {e}")
|
60 |
|
61 |
+
pipe.set_adapters([LORA_1_NAME, LORA_2_NAME], adapter_weights=[1.0, 1.0])
|
62 |
+
|
63 |
|
64 |
print("Initialization complete. Gradio is starting...")
|
65 |
|
|
|
71 |
print("Activating both LoRAs for inference...")
|
72 |
# You can adjust the weights here to change the intensity of each LoRA.
|
73 |
# For example, [1.0, 0.8] would make the second LoRA less strong.
|
74 |
+
# pipe.set_adapters([LORA_1_NAME, LORA_2_NAME], adapter_weights=[1.0, 1.0])
|
75 |
|
76 |
apply_cache_on_pipe(
|
77 |
pipe,
|
|
|
93 |
finally:
|
94 |
# It's good practice to disable the adapters after the run,
|
95 |
# although set_adapters() at the start also handles this.
|
96 |
+
# print("Disabling LoRAs after run.")
|
97 |
+
# pipe.disable_lora()
|
98 |
+
pass
|
99 |
|
100 |
|
101 |
iface = gr.Interface(
|