Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,16 +1,44 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
import requests
|
| 3 |
import os
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
|
| 5 |
name2 = "runwayml/stable-diffusion-v1-5"
|
| 6 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
o = os.getenv("P")
|
| 8 |
|
| 9 |
def ac():
|
| 10 |
def im_fn(put,fac="",h=None):
|
| 11 |
if h == o:
|
|
|
|
|
|
|
| 12 |
put = f"{put}{fac}"
|
| 13 |
fac = f"{fac} "
|
|
|
|
| 14 |
return model(put),fac
|
| 15 |
elif h != o:
|
| 16 |
return(None,None)
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
import requests
|
| 3 |
import os
|
| 4 |
+
import random
|
| 5 |
+
|
| 6 |
+
|
| 7 |
+
|
| 8 |
|
| 9 |
name2 = "runwayml/stable-diffusion-v1-5"
|
| 10 |
+
models=[
|
| 11 |
+
gr.Interface.load(f"models/{name2}"),
|
| 12 |
+
gr.Interface.load(f"models/{name2}"),
|
| 13 |
+
gr.Interface.load(f"models/{name2}"),
|
| 14 |
+
gr.Interface.load(f"models/{name2}"),
|
| 15 |
+
gr.Interface.load(f"models/{name2}"),
|
| 16 |
+
gr.Interface.load(f"models/{name2}"),
|
| 17 |
+
gr.Interface.load(f"models/{name2}"),
|
| 18 |
+
gr.Interface.load(f"models/{name2}"),
|
| 19 |
+
gr.Interface.load(f"models/{name2}"),
|
| 20 |
+
gr.Interface.load(f"models/{name2}"),
|
| 21 |
+
gr.Interface.load(f"models/{name2}"),
|
| 22 |
+
gr.Interface.load(f"models/{name2}"),
|
| 23 |
+
gr.Interface.load(f"models/{name2}"),
|
| 24 |
+
gr.Interface.load(f"models/{name2}"),
|
| 25 |
+
gr.Interface.load(f"models/{name2}"),
|
| 26 |
+
gr.Interface.load(f"models/{name2}"),
|
| 27 |
+
gr.Interface.load(f"models/{name2}"),
|
| 28 |
+
gr.Interface.load(f"models/{name2}"),
|
| 29 |
+
gr.Interface.load(f"models/{name2}"),
|
| 30 |
+
gr.Interface.load(f"models/{name2}"),
|
| 31 |
+
]
|
| 32 |
o = os.getenv("P")
|
| 33 |
|
| 34 |
def ac():
|
| 35 |
def im_fn(put,fac="",h=None):
|
| 36 |
if h == o:
|
| 37 |
+
rn = random.randint(0, 19)
|
| 38 |
+
model=models[rn]
|
| 39 |
put = f"{put}{fac}"
|
| 40 |
fac = f"{fac} "
|
| 41 |
+
print (rn)
|
| 42 |
return model(put),fac
|
| 43 |
elif h != o:
|
| 44 |
return(None,None)
|