Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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}"
|
| 7 |
o = os.getenv("P")
|
| 8 |
h = "Q"
|
| 9 |
-
def ac(
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 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()
|