multimodalart HF staff commited on
Commit
9107950
·
1 Parent(s): 47b5daf

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -173,6 +173,9 @@ def save_preferences(lora_1_id, lora_1_scale, lora_2_id, lora_2_scale, prompt, g
173
 
174
  return gr.update(visible=False), gr.update(visible=True), gr.update(interactive=False)
175
 
 
 
 
176
  with gr.Blocks(css=css) as demo:
177
  shuffled_items = gr.State()
178
  title = gr.HTML(
@@ -229,10 +232,10 @@ with gr.Blocks(css=css) as demo:
229
  demo.load(shuffle_images, inputs=[], outputs=[lora_1_link, lora_1, lora_1_prompt, lora_1_id, lora_2_link, lora_2, lora_2_prompt, lora_2_id, prompt, shuffled_items, lora_1_scale, lora_2_scale], queue=False, show_progress="hidden")
230
  shuffle_button.click(shuffle_images, outputs=[lora_1_link, lora_1, lora_1_prompt, lora_1_id, lora_2_link, lora_2, lora_2_prompt, lora_2_id, prompt, shuffled_items, lora_1_scale, lora_2_scale], queue=False, show_progress="hidden")
231
 
232
- run_btn.click(merge_and_run,
233
  inputs=[prompt, negative_prompt, shuffled_items, lora_1_scale, lora_2_scale, seed],
234
  outputs=[output_image, post_gen_info, last_used_seed, thumbs_up, thumbs_up_clicked, thumbs_down, thumbs_down_clicked])
235
- prompt.submit(merge_and_run,
236
  inputs=[prompt, negative_prompt, shuffled_items, lora_1_scale, lora_2_scale, seed],
237
  outputs=[output_image, post_gen_info, last_used_seed, thumbs_up, thumbs_up_clicked, thumbs_down, thumbs_down_clicked])
238
 
 
173
 
174
  return gr.update(visible=False), gr.update(visible=True), gr.update(interactive=False)
175
 
176
+ def hide_post_gen_info():
177
+ return gr.update(visible=False)
178
+
179
  with gr.Blocks(css=css) as demo:
180
  shuffled_items = gr.State()
181
  title = gr.HTML(
 
232
  demo.load(shuffle_images, inputs=[], outputs=[lora_1_link, lora_1, lora_1_prompt, lora_1_id, lora_2_link, lora_2, lora_2_prompt, lora_2_id, prompt, shuffled_items, lora_1_scale, lora_2_scale], queue=False, show_progress="hidden")
233
  shuffle_button.click(shuffle_images, outputs=[lora_1_link, lora_1, lora_1_prompt, lora_1_id, lora_2_link, lora_2, lora_2_prompt, lora_2_id, prompt, shuffled_items, lora_1_scale, lora_2_scale], queue=False, show_progress="hidden")
234
 
235
+ run_btn.click(hide_post_gen_info, outputs=[post_gen_info], queue=False).then(merge_and_run,
236
  inputs=[prompt, negative_prompt, shuffled_items, lora_1_scale, lora_2_scale, seed],
237
  outputs=[output_image, post_gen_info, last_used_seed, thumbs_up, thumbs_up_clicked, thumbs_down, thumbs_down_clicked])
238
+ prompt.submit(hide_post_gen_info, outputs=[post_gen_info], queue=False).then(merge_and_run,
239
  inputs=[prompt, negative_prompt, shuffled_items, lora_1_scale, lora_2_scale, seed],
240
  outputs=[output_image, post_gen_info, last_used_seed, thumbs_up, thumbs_up_clicked, thumbs_down, thumbs_down_clicked])
241