xp3857 commited on
Commit
a2ffcba
1 Parent(s): 8663be6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -17
app.py CHANGED
@@ -3,23 +3,19 @@ import requests
3
  import os
4
 
5
  name = "runwayml/stable-diffusion-v1-5"
6
- model = gr.Interface.load(f"models/{name}",negative_prompt="blurry")
7
  o = os.getenv("P")
8
  h = "Q"
9
- def ac(h=h):
10
- print(h)
11
- print(o)
12
- if h == o:
13
- def im_fn(put):
14
-
15
- return model(put)
16
- with gr.Blocks() as b:
17
- put = gr.Textbox()
18
- out = gr.Image()
19
- btn = gr.Button()
20
- btn.click(im_fn,put,out)
21
- b.queue(concurrency_count=100).launch()
22
- elif h != o:
23
- print("no")
24
- pass
25
  ac()
 
3
  import os
4
 
5
  name = "runwayml/stable-diffusion-v1-5"
6
+ model = gr.Interface.load(f"models/{name}")
7
  o = os.getenv("P")
8
  h = "Q"
9
+ def ac():
10
+ def im_fn(put):
11
+ if h == o:
12
+ return model(put, negative_prompt="blury")
13
+ elif h != o:
14
+ return(None)
15
+ with gr.Blocks() as b:
16
+ put = gr.Textbox()
17
+ out = gr.Image()
18
+ btn = gr.Button()
19
+ btn.click(im_fn,put,out)
20
+ b.queue(concurrency_count=100).launch()
 
 
 
 
21
  ac()