LeeveWasTaken commited on
Commit
34e2459
·
verified ·
1 Parent(s): 6de341c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -4
app.py CHANGED
@@ -45,7 +45,7 @@ with gr.Blocks() as demo:
45
  gen_button = gr.Button('Generate up to 6 images in up to 2 minutes total')
46
  stop_button = gr.Button('Stop', variant='secondary', interactive=False)
47
 
48
- gen_button.click(lambda s: gr.update(interactive=True), None, stop_button)
49
  gr.HTML(
50
  """
51
  <div style="text-align: center; max-width: 1200px; margin: 0 auto;">
@@ -64,7 +64,7 @@ with gr.Blocks() as demo:
64
  current_models = [gr.Textbox(m, visible=False) for m in default_models]
65
 
66
  for m, o in zip(current_models, output):
67
- gen_event = gen_button.click(gen_fn, [m, txt_input, neg_prompt, image_style], o)
68
  stop_button.click(lambda s: gr.update(interactive=False), None, stop_button, cancels=[gen_event])
69
 
70
  with gr.Accordion('Model selection'):
@@ -81,5 +81,4 @@ with gr.Blocks() as demo:
81
  """
82
  )
83
 
84
- demo.queue(concurrency_count=200)
85
- demo.launch()
 
45
  gen_button = gr.Button('Generate up to 6 images in up to 2 minutes total')
46
  stop_button = gr.Button('Stop', variant='secondary', interactive=False)
47
 
48
+ gen_button.click(lambda s: gr.update(interactive=True), None, stop_button, concurrency_limit=10)
49
  gr.HTML(
50
  """
51
  <div style="text-align: center; max-width: 1200px; margin: 0 auto;">
 
64
  current_models = [gr.Textbox(m, visible=False) for m in default_models]
65
 
66
  for m, o in zip(current_models, output):
67
+ gen_event = gen_button.click(gen_fn, [m, txt_input, neg_prompt, image_style], o, concurrency_limit=10)
68
  stop_button.click(lambda s: gr.update(interactive=False), None, stop_button, cancels=[gen_event])
69
 
70
  with gr.Accordion('Model selection'):
 
81
  """
82
  )
83
 
84
+ demo.launch(max_threads=200)