latostadaok commited on
Commit
124bd59
·
2 Parent(s): ef257cb 1dbff42

Merge branch 'main' of https://huggingface.co/spaces/lichorosario/Qwen-Image-pruning-LoRA-Explorer

Browse files
Files changed (2) hide show
  1. .gitignore +8 -0
  2. app.py +25 -3
.gitignore ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ # Virtual Environments
2
+ venv/
3
+ env/
4
+ .venv/
5
+
6
+ # Python cache
7
+ __pycache__/
8
+ *.pyc
app.py CHANGED
@@ -446,8 +446,8 @@ with gr.Blocks(theme=gr.themes.Soft(), css=css, delete_cache=(60, 60)) as app:
446
  with gr.Row():
447
  aspect_ratio = gr.Radio(
448
  label="Aspect Ratio",
449
- choices=["1:1", "16:9", "9:16", "4:3", "3:4", "3:2", "2:3"],
450
- value="1:1"
451
  )
452
 
453
  with gr.Row():
@@ -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=2, step=0.01, value=1.0)
475
 
476
  # Event handlers
477
  gallery.select(
@@ -504,5 +504,27 @@ with gr.Blocks(theme=gr.themes.Soft(), css=css, delete_cache=(60, 60)) as app:
504
  outputs=[result, seed]
505
  )
506
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
507
  app.queue()
508
  app.launch()
 
446
  with gr.Row():
447
  aspect_ratio = gr.Radio(
448
  label="Aspect Ratio",
449
+ choices=["1:1", "16:9", "9:16", "4:3", "3:4", "3:2", "2:3", "3:1", "2:1"],
450
+ value="16:9"
451
  )
452
 
453
  with gr.Row():
 
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=4, step=0.01, value=1.0)
475
 
476
  # Event handlers
477
  gallery.select(
 
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()