From a0107a668f7d29bab714acb76854d7e440acee10 Mon Sep 17 00:00:00 2001 From: Rahim Nathwani Date: Thu, 25 Aug 2022 23:39:16 -0700 Subject: [PATCH] Allow gradio users to submit multiple requests Adding demo.queue(concurrency_count=1) tells gradio to queue up requests when one is already running. This means you can queue multiple requests before going to bed, without worrying that your GPU will run out of memory. --- optimizedSD/txt2img_gradio.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/optimizedSD/txt2img_gradio.py b/optimizedSD/txt2img_gradio.py index da820c28f..a8ddde5b9 100644 --- a/optimizedSD/txt2img_gradio.py +++ b/optimizedSD/txt2img_gradio.py @@ -189,4 +189,5 @@ def generate(prompt,ddim_steps,n_iter, batch_size, Height, Width, scale, ddim_et gr.Slider(64,4096,value = 512,step=64), gr.Slider(64,4096,value = 512,step=64), gr.Slider(0,50,value=7.5,step=0.1),gr.Slider(0,1,step=0.01),"text","checkbox", "checkbox",gr.Text(value = "outputs/txt2img-samples")], outputs=["image", "text"], ) -demo.launch() \ No newline at end of file +demo.queue(concurrency_count=1) +demo.launch()