Spaces:
Running
on
Zero
Running
on
Zero
Commit
·
9ed3245
1
Parent(s):
124bd59
Refactor LoRA loading structure for improved organization and clarity
Browse files
app.py
CHANGED
|
@@ -471,7 +471,7 @@ with gr.Blocks(theme=gr.themes.Soft(), css=css, delete_cache=(60, 60)) as app:
|
|
| 471 |
with gr.Row():
|
| 472 |
randomize_seed = gr.Checkbox(True, label="Randomize seed")
|
| 473 |
seed = gr.Slider(label="Seed", minimum=0, maximum=MAX_SEED, step=1, value=0, randomize=True)
|
| 474 |
-
lora_scale = gr.Slider(label="LoRA Scale", minimum=0, maximum=
|
| 475 |
|
| 476 |
# Event handlers
|
| 477 |
gallery.select(
|
|
@@ -504,27 +504,5 @@ with gr.Blocks(theme=gr.themes.Soft(), css=css, delete_cache=(60, 60)) as app:
|
|
| 504 |
outputs=[result, seed]
|
| 505 |
)
|
| 506 |
|
| 507 |
-
|
| 508 |
-
# Set default selection to "Day of the Tentacle Style"
|
| 509 |
-
default_index = next(
|
| 510 |
-
i for i, l in enumerate(loras)
|
| 511 |
-
if l["repo"] == "lichorosario/qwen-image-dottrmstr"
|
| 512 |
-
)
|
| 513 |
-
|
| 514 |
-
app.load(
|
| 515 |
-
fn=lambda: (
|
| 516 |
-
gr.update(value="Speed (8 steps)"), # speed_mode
|
| 517 |
-
gr.update(value="3:1"), # aspect_ratio
|
| 518 |
-
gr.update(value=default_index), # selected_index (State)
|
| 519 |
-
gr.update(selected_index=default_index), # galería marca tarjeta
|
| 520 |
-
gr.update(value=2.5) # escala del lora
|
| 521 |
-
),
|
| 522 |
-
inputs=[],
|
| 523 |
-
outputs=[speed_mode, aspect_ratio, selected_index, gallery, lora_scale]
|
| 524 |
-
)
|
| 525 |
-
|
| 526 |
-
###############
|
| 527 |
-
|
| 528 |
-
|
| 529 |
app.queue()
|
| 530 |
app.launch()
|
|
|
|
| 471 |
with gr.Row():
|
| 472 |
randomize_seed = gr.Checkbox(True, label="Randomize seed")
|
| 473 |
seed = gr.Slider(label="Seed", minimum=0, maximum=MAX_SEED, step=1, value=0, randomize=True)
|
| 474 |
+
lora_scale = gr.Slider(label="LoRA Scale", minimum=0, maximum=3, step=0.01, value=1.0)
|
| 475 |
|
| 476 |
# Event handlers
|
| 477 |
gallery.select(
|
|
|
|
| 504 |
outputs=[result, seed]
|
| 505 |
)
|
| 506 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 507 |
app.queue()
|
| 508 |
app.launch()
|