multimodalart HF staff commited on
Commit
24d15b9
1 Parent(s): dd28d50

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -45,6 +45,7 @@ last_merged = False
45
  def update_selection(selected_state: gr.SelectData):
46
  lora_repo = sdxl_loras[selected_state.index][2]
47
  instance_prompt = sdxl_loras[selected_state.index][3]
 
48
  weight_name = sdxl_loras[selected_state.index][4]
49
  updated_text = f"### Selected: [{lora_repo}](https://huggingface.co/{lora_repo}) ✨"
50
  use_with_diffusers = f'''
@@ -81,6 +82,7 @@ def update_selection(selected_state: gr.SelectData):
81
  return (
82
  updated_text,
83
  instance_prompt,
 
84
  selected_state,
85
  use_with_diffusers,
86
  use_with_uis,
@@ -218,7 +220,7 @@ with gr.Blocks(css="custom.css") as demo:
218
 
219
  gallery.select(
220
  update_selection,
221
- outputs=[prompt_title, prompt, selected_state, use_diffusers, use_uis],
222
  queue=False,
223
  show_progress=False,
224
  )
 
45
  def update_selection(selected_state: gr.SelectData):
46
  lora_repo = sdxl_loras[selected_state.index][2]
47
  instance_prompt = sdxl_loras[selected_state.index][3]
48
+ new_placeholder = "Type a prompt! This style works for all prompts without a trigger word" if instance_prompt == "Type a prompt to use your selected LoRA" else
49
  weight_name = sdxl_loras[selected_state.index][4]
50
  updated_text = f"### Selected: [{lora_repo}](https://huggingface.co/{lora_repo}) ✨"
51
  use_with_diffusers = f'''
 
82
  return (
83
  updated_text,
84
  instance_prompt,
85
+ gr.update(placeholder=new_placeholder),
86
  selected_state,
87
  use_with_diffusers,
88
  use_with_uis,
 
220
 
221
  gallery.select(
222
  update_selection,
223
+ outputs=[prompt_title, prompt, prompt, selected_state, use_diffusers, use_uis],
224
  queue=False,
225
  show_progress=False,
226
  )