import gradio as gr name = "runwayml/stable-diffusion-v1-5" model = gr.Interface.load(f"models/{name}") def im_fn(put): return model(put) with gr.Blocks() as b: put = gr.Textbox() out = gr.Image() btn = gr.Button() btn.click(im_fn,put,out) b.queue(concurrency_count=100).launch()