Spaces:
Paused
Paused
Commit
•
af82ae3
1
Parent(s):
ebf3e6f
Update app.py
Browse files
app.py
CHANGED
@@ -143,7 +143,7 @@ def check_selected(selected_state):
|
|
143 |
if not selected_state:
|
144 |
raise gr.Error("You must select a LoRA")
|
145 |
|
146 |
-
def run_lora(prompt, negative, lora_scale, selected_state, sdxl_loras, sdxl_loras_new, progress=gr.Progress(track_tqdm=True)):
|
147 |
global last_lora, last_merged, last_fused, pipe
|
148 |
print("Index when running ", selected_state.index)
|
149 |
if(selected_state.index < 0):
|
@@ -185,7 +185,8 @@ def run_lora(prompt, negative, lora_scale, selected_state, sdxl_loras, sdxl_lora
|
|
185 |
prompt=prompt,
|
186 |
negative_prompt=negative,
|
187 |
num_inference_steps=4,
|
188 |
-
guidance_scale=0.5
|
|
|
189 |
|
190 |
).images[0]
|
191 |
|
@@ -211,7 +212,7 @@ with gr.Blocks(css="custom.css") as demo:
|
|
211 |
gr_sdxl_loras = gr.State(value=sdxl_loras_raw)
|
212 |
gr_sdxl_loras_new = gr.State(value=sdxl_loras_raw_new)
|
213 |
title = gr.HTML(
|
214 |
-
"""<h1><img src="https://i.imgur.com/vT48NAO.png" alt="LoRA"><small><small><i>Experimental</i></small></small
|
215 |
<br>
|
216 |
Combine loading an <a href="#">LCM-LoRA</a> with your favorite SDXL LoRa and run LoRAs in only 4 steps. Check out <a href="#">our blog</a>on how this works. <b>Not all LoRAs may combine well with the LCM-LoRA</b>
|
217 |
""",
|
@@ -249,8 +250,9 @@ with gr.Blocks(css="custom.css") as demo:
|
|
249 |
interactive=False, label="Generated Image", elem_id="result-image"
|
250 |
)
|
251 |
with gr.Accordion("Advanced options", open=False):
|
252 |
-
negative = gr.Textbox(label="Negative Prompt")
|
253 |
weight = gr.Slider(0, 10, value=0.8, step=0.1, label="LoRA weight")
|
|
|
254 |
with gr.Column(elem_id="extra_info"):
|
255 |
with gr.Accordion(
|
256 |
"Use it with: 🧨 diffusers, ComfyUI, Invoke AI, SD.Next, AUTO1111",
|
@@ -315,7 +317,7 @@ with gr.Blocks(css="custom.css") as demo:
|
|
315 |
show_progress=False
|
316 |
).success(
|
317 |
fn=run_lora,
|
318 |
-
inputs=[prompt, negative, weight, selected_state, gr_sdxl_loras, gr_sdxl_loras_new],
|
319 |
outputs=[result, share_group],
|
320 |
)
|
321 |
button.click(
|
@@ -325,7 +327,7 @@ with gr.Blocks(css="custom.css") as demo:
|
|
325 |
show_progress=False
|
326 |
).success(
|
327 |
fn=run_lora,
|
328 |
-
inputs=[prompt, negative, weight, selected_state, gr_sdxl_loras, gr_sdxl_loras_new],
|
329 |
outputs=[result, share_group],
|
330 |
)
|
331 |
share_button.click(None, [], [], js=share_js)
|
|
|
143 |
if not selected_state:
|
144 |
raise gr.Error("You must select a LoRA")
|
145 |
|
146 |
+
def run_lora(prompt, negative, lora_scale, steps, selected_state, sdxl_loras, sdxl_loras_new, progress=gr.Progress(track_tqdm=True)):
|
147 |
global last_lora, last_merged, last_fused, pipe
|
148 |
print("Index when running ", selected_state.index)
|
149 |
if(selected_state.index < 0):
|
|
|
185 |
prompt=prompt,
|
186 |
negative_prompt=negative,
|
187 |
num_inference_steps=4,
|
188 |
+
guidance_scale=0.5,
|
189 |
+
num_inference_steps=steps
|
190 |
|
191 |
).images[0]
|
192 |
|
|
|
212 |
gr_sdxl_loras = gr.State(value=sdxl_loras_raw)
|
213 |
gr_sdxl_loras_new = gr.State(value=sdxl_loras_raw_new)
|
214 |
title = gr.HTML(
|
215 |
+
"""<h1><img src="https://i.imgur.com/vT48NAO.png" alt="LoRA"><small><small><i>Experimental</i></small></small> LCM LoRA the Explorer</h1>
|
216 |
<br>
|
217 |
Combine loading an <a href="#">LCM-LoRA</a> with your favorite SDXL LoRa and run LoRAs in only 4 steps. Check out <a href="#">our blog</a>on how this works. <b>Not all LoRAs may combine well with the LCM-LoRA</b>
|
218 |
""",
|
|
|
250 |
interactive=False, label="Generated Image", elem_id="result-image"
|
251 |
)
|
252 |
with gr.Accordion("Advanced options", open=False):
|
253 |
+
negative = gr.Textbox(label="Negative Prompt", visible=False)
|
254 |
weight = gr.Slider(0, 10, value=0.8, step=0.1, label="LoRA weight")
|
255 |
+
steps = gr.Slider(0,8, value=4, step=1, label="Steps")
|
256 |
with gr.Column(elem_id="extra_info"):
|
257 |
with gr.Accordion(
|
258 |
"Use it with: 🧨 diffusers, ComfyUI, Invoke AI, SD.Next, AUTO1111",
|
|
|
317 |
show_progress=False
|
318 |
).success(
|
319 |
fn=run_lora,
|
320 |
+
inputs=[prompt, negative, weight, steps, selected_state, gr_sdxl_loras, gr_sdxl_loras_new],
|
321 |
outputs=[result, share_group],
|
322 |
)
|
323 |
button.click(
|
|
|
327 |
show_progress=False
|
328 |
).success(
|
329 |
fn=run_lora,
|
330 |
+
inputs=[prompt, negative, weight, steps, selected_state, gr_sdxl_loras, gr_sdxl_loras_new],
|
331 |
outputs=[result, share_group],
|
332 |
)
|
333 |
share_button.click(None, [], [], js=share_js)
|