johann-foerster commited on
Commit
50754bf
·
1 Parent(s): b47a274

no queueing for non ai tasks

Browse files
Files changed (1) hide show
  1. webui.py +6 -5
webui.py CHANGED
@@ -47,6 +47,7 @@ def toggle_greet_visibility(is_visible):
47
 
48
  def debounce():
49
  time.sleep(0.5)
 
50
 
51
  def pil_image_with_overlay(pil_image, toggle_greet, greet):
52
  image = ImageDraw.Draw(pil_image, "RGBA")
@@ -125,12 +126,12 @@ with shared.gradio_root:
125
  show_share_button=False, show_download_button=False )
126
  generated_image_overlayed = gr.Image(label="Weihnachtskarte", type='pil', width=1280, value=pil_image_with_overlay(Image.open("resources/init.png"), toggle_greet.value, greet.value))
127
 
128
- toggle_greet.change(fn=toggle_greet_visibility, inputs=[toggle_greet], outputs=[greet, greet_examples_column])\
129
- .then(fn=make_overlay, inputs=[generated_image_raw, toggle_greet, greet], outputs=[generated_image_raw, generated_image_overlayed])
130
- greet.change(fn=debounce)\
131
- .then(fn=make_overlay, inputs=[generated_image_raw, toggle_greet, greet], outputs=[generated_image_raw, generated_image_overlayed])
132
  run_button.click(fn=generate, inputs=[prompt, style_selection], outputs=[run_button, progress_html, generated_image_raw, generated_image_overlayed])\
133
- .then(fn=make_overlay, inputs=[generated_image_raw, toggle_greet, greet], outputs=[generated_image_raw, generated_image_overlayed])
134
 
135
  shared.gradio_root.queue(concurrency_count=1, api_open=False)
136
  shared.gradio_root.launch(server_name="0.0.0.0", show_api=False)
 
47
 
48
  def debounce():
49
  time.sleep(0.5)
50
+ return gr.update()
51
 
52
  def pil_image_with_overlay(pil_image, toggle_greet, greet):
53
  image = ImageDraw.Draw(pil_image, "RGBA")
 
126
  show_share_button=False, show_download_button=False )
127
  generated_image_overlayed = gr.Image(label="Weihnachtskarte", type='pil', width=1280, value=pil_image_with_overlay(Image.open("resources/init.png"), toggle_greet.value, greet.value))
128
 
129
+ toggle_greet.change(fn=toggle_greet_visibility, inputs=[toggle_greet], outputs=[greet, greet_examples_column], queue=False)\
130
+ .then(fn=make_overlay, inputs=[generated_image_raw, toggle_greet, greet], outputs=[generated_image_raw, generated_image_overlayed], queue=False)
131
+ greet.change(fn=debounce, outputs=[generated_image_overlayed], queue=False)\
132
+ .then(fn=make_overlay, inputs=[generated_image_raw, toggle_greet, greet], outputs=[generated_image_raw, generated_image_overlayed], queue=False)
133
  run_button.click(fn=generate, inputs=[prompt, style_selection], outputs=[run_button, progress_html, generated_image_raw, generated_image_overlayed])\
134
+ .then(fn=make_overlay, inputs=[generated_image_raw, toggle_greet, greet], outputs=[generated_image_raw, generated_image_overlayed], queue=False)
135
 
136
  shared.gradio_root.queue(concurrency_count=1, api_open=False)
137
  shared.gradio_root.launch(server_name="0.0.0.0", show_api=False)