multimodalart HF staff commited on
Commit
4df41e1
β€’
1 Parent(s): e8557b8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -176,12 +176,12 @@ def add_custom_lora(custom_lora):
176
  existing_item_index = len(loras)
177
  loras.append(new_item)
178
 
179
- return gr.update(visible=True, value=card), gr.update(visible=True), gr.Gallery(selected_index=None), f"Custom: {path}", existing_item_index
180
  except Exception as e:
181
  gr.Warning(f"Invalid LoRA: either you entered an invalid link, or a non-FLUX LoRA")
182
- return gr.update(visible=True, value=f"Invalid LoRA: either you entered an invalid link, a non-FLUX LoRA"), gr.update(visible=True), gr.update(), "", None
183
  else:
184
- return gr.update(visible=False), gr.update(visible=False), gr.update(), "", None
185
 
186
  def remove_custom_lora():
187
  return gr.update(visible=False), gr.update(visible=False), gr.update(), "", None, ""
@@ -252,7 +252,7 @@ with gr.Blocks(theme=gr.themes.Soft(), css=css) as app:
252
  custom_lora.input(
253
  add_custom_lora,
254
  inputs=[custom_lora],
255
- outputs=[custom_lora_info, custom_lora_button, gallery, selected_info, selected_index]
256
  )
257
  custom_lora_button.click(
258
  remove_custom_lora,
 
176
  existing_item_index = len(loras)
177
  loras.append(new_item)
178
 
179
+ return gr.update(visible=True, value=card), gr.update(visible=True), gr.Gallery(selected_index=None), f"Custom: {path}", existing_item_index, trigger_word
180
  except Exception as e:
181
  gr.Warning(f"Invalid LoRA: either you entered an invalid link, or a non-FLUX LoRA")
182
+ return gr.update(visible=True, value=f"Invalid LoRA: either you entered an invalid link, a non-FLUX LoRA"), gr.update(visible=True), gr.update(), "", None, ""
183
  else:
184
+ return gr.update(visible=False), gr.update(visible=False), gr.update(), "", None, ""
185
 
186
  def remove_custom_lora():
187
  return gr.update(visible=False), gr.update(visible=False), gr.update(), "", None, ""
 
252
  custom_lora.input(
253
  add_custom_lora,
254
  inputs=[custom_lora],
255
+ outputs=[custom_lora_info, custom_lora_button, gallery, selected_info, selected_index, prompt]
256
  )
257
  custom_lora_button.click(
258
  remove_custom_lora,