latostadaok commited on
Commit
821285e
·
1 Parent(s): 9ed3245

Add default selection for LoRA gallery and initialize parameters on load

Browse files
Files changed (1) hide show
  1. app.py +17 -0
app.py CHANGED
@@ -504,5 +504,22 @@ 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()
 
504
  outputs=[result, seed]
505
  )
506
 
507
+ default_index = next(
508
+ i for i, l in enumerate(loras)
509
+ if l["repo"] == "lichorosario/qwen-image-dottrmstr"
510
+ )
511
+
512
+ app.load(
513
+ fn=lambda: (
514
+ gr.update(value="Speed (8 steps)"), # speed_mode
515
+ gr.update(value="3:1"), # aspect_ratio
516
+ gr.update(value=default_index), # selected_index (State)
517
+ gr.update(selected_index=default_index), # gallery selección inicial
518
+ gr.update(value=2.5) # cfg_scale inicial
519
+ ),
520
+ inputs=[],
521
+ outputs=[speed_mode, aspect_ratio, selected_index, gallery, cfg_scale]
522
+ )
523
+
524
  app.queue()
525
  app.launch()