xp3857 commited on
Commit
af2f25b
1 Parent(s): b6b08f6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -8
app.py CHANGED
@@ -1,11 +1,19 @@
1
  import gradio as gr
 
2
  name = "runwayml/stable-diffusion-v1-5"
3
  model = gr.Interface.load(f"models/{name}")
4
- def im_fn(put):
5
- return model(put)
6
- with gr.Blocks() as b:
7
- put = gr.Textbox()
8
- out = gr.Image()
9
- btn = gr.Button()
10
- btn.click(im_fn,put,out)
11
- b.queue(concurrency_count=100).launch()
 
 
 
 
 
 
 
 
1
  import gradio as gr
2
+ import os
3
  name = "runwayml/stable-diffusion-v1-5"
4
  model = gr.Interface.load(f"models/{name}")
5
+ o = os.getenv("P")
6
+ h = gr.Textbox(visible=False)
7
+ def ac(h=h):
8
+ if h == o:
9
+ def im_fn(put):
10
+ return model(put)
11
+ with gr.Blocks() as b:
12
+ put = gr.Textbox()
13
+ out = gr.Image()
14
+ btn = gr.Button()
15
+ btn.click(im_fn,put,out)
16
+ b.queue(concurrency_count=100).launch()
17
+ else:
18
+ pass
19
+ ac()