Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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.
|
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)
|
|