Update app.py
Browse files
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 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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()
|