File size: 478 Bytes
b6b08f6
af2f25b
b6b08f6
 
af2f25b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import gradio as gr
import os
name = "runwayml/stable-diffusion-v1-5"
model = gr.Interface.load(f"models/{name}")
o = os.getenv("P")
h = gr.Textbox(visible=False)
def ac(h=h):
    if h == o:
        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()
    else:
        pass
ac()