multimodalart HF staff commited on
Commit
9c37890
1 Parent(s): 32222a1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -2
app.py CHANGED
@@ -65,7 +65,19 @@ def update_selection(evt: gr.SelectData, selected_indices, width, height):
65
  if len(selected_indices) < 2:
66
  selected_indices.append(selected_index)
67
  else:
68
- raise gr.Error("You can select up to 2 LoRAs only.")
 
 
 
 
 
 
 
 
 
 
 
 
69
 
70
  # Initialize outputs
71
  selected_info_1 = ""
@@ -442,7 +454,7 @@ with gr.Blocks(theme=gr.themes.Soft(), css=css, delete_cache=(60, 3600)) as app:
442
  lora_image_2 = gr.Image(label="LoRA 2 Image", interactive=False, min_width=50, width=50, show_label=False, show_share_button=False, show_download_button=False, show_fullscreen_button=False, height=50)
443
  with gr.Column(scale=3, min_width=100):
444
  selected_info_2 = gr.Markdown("Select a LoRA 2")
445
- with gr.Column(scale=2, min_width=50):
446
  lora_scale_2 = gr.Slider(label="LoRA 2 Scale", minimum=0, maximum=3, step=0.01, value=0.95)
447
  with gr.Row():
448
  remove_button_2 = gr.Button("Remove", size="sm")
 
65
  if len(selected_indices) < 2:
66
  selected_indices.append(selected_index)
67
  else:
68
+ gr.Warning("You can select up to 2 LoRAs only.")
69
+ return(
70
+ gr.update(),
71
+ gr.update(),
72
+ gr.update(),
73
+ gr.update(),
74
+ gr.update(),
75
+ gr.update(),
76
+ gr.update(),
77
+ gr.update(),
78
+ gr.update(),
79
+ gr.update(),
80
+ )
81
 
82
  # Initialize outputs
83
  selected_info_1 = ""
 
454
  lora_image_2 = gr.Image(label="LoRA 2 Image", interactive=False, min_width=50, width=50, show_label=False, show_share_button=False, show_download_button=False, show_fullscreen_button=False, height=50)
455
  with gr.Column(scale=3, min_width=100):
456
  selected_info_2 = gr.Markdown("Select a LoRA 2")
457
+ with gr.Column(scale=5, min_width=50):
458
  lora_scale_2 = gr.Slider(label="LoRA 2 Scale", minimum=0, maximum=3, step=0.01, value=0.95)
459
  with gr.Row():
460
  remove_button_2 = gr.Button("Remove", size="sm")