Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -3,34 +3,38 @@ import gradio as gr
|
|
3 |
import re
|
4 |
|
5 |
|
6 |
-
def desc_to_image(desc):
|
7 |
-
print("*****Inside desc_to_image")
|
8 |
-
desc = " ".join(desc.split('\n'))
|
9 |
-
#desc = desc + ", character art, concept art, artstation"
|
10 |
-
steps, width, height, images, diversity = '50','256','256','1',15
|
11 |
-
iface = gr.Interface.load("spaces/artificialguybr/DREAMSHAPER-XL-FREE-DEMO")
|
12 |
-
print("about to die",iface,dir(iface))
|
13 |
-
|
14 |
-
prompt = re.sub(r'[^a-zA-Z0-9 ,.]', '', desc)
|
15 |
-
print("about to die",prompt)
|
16 |
-
|
17 |
-
|
18 |
-
#img=iface(desc, steps, width, height, images, diversity)[0]
|
19 |
-
img=iface(desc)[0]
|
20 |
-
return img
|
21 |
|
|
|
22 |
|
23 |
-
|
24 |
-
iface = gr.Interface.load("spaces/akhaliq/Real-ESRGAN")
|
25 |
-
model='base'
|
26 |
-
uimg=iface(img,models)
|
27 |
-
return uimg
|
28 |
|
29 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
30 |
|
31 |
-
demo = gr.Blocks()
|
32 |
|
33 |
-
|
34 |
gr.Markdown("<h1><center>NPC Generator</center></h1>")
|
35 |
gr.Markdown(
|
36 |
"<div>Run <a href='https://huggingface.co/spaces/multimodalart/latentdiffusion'>Latent Diffusion</a> first to generate an image</div>"
|
|
|
3 |
import re
|
4 |
|
5 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6 |
|
7 |
+
demo = gr.Blocks()
|
8 |
|
9 |
+
with demo:
|
|
|
|
|
|
|
|
|
10 |
|
11 |
|
12 |
+
def desc_to_image(desc):
|
13 |
+
print("*****Inside desc_to_image")
|
14 |
+
desc = " ".join(desc.split('\n'))
|
15 |
+
#desc = desc + ", character art, concept art, artstation"
|
16 |
+
steps, width, height, images, diversity = '50','256','256','1',15
|
17 |
+
iface = gr.Interface.load("spaces/artificialguybr/DREAMSHAPER-XL-FREE-DEMO")
|
18 |
+
print("about to die",iface,dir(iface))
|
19 |
+
|
20 |
+
prompt = re.sub(r'[^a-zA-Z0-9 ,.]', '', desc)
|
21 |
+
print("about to die",prompt)
|
22 |
+
|
23 |
+
|
24 |
+
#img=iface(desc, steps, width, height, images, diversity)[0]
|
25 |
+
img=iface(desc)[0]
|
26 |
+
return img
|
27 |
+
|
28 |
+
|
29 |
+
def upscale_img(img):
|
30 |
+
iface = gr.Interface.load("spaces/akhaliq/Real-ESRGAN")
|
31 |
+
model='base'
|
32 |
+
uimg=iface(img,models)
|
33 |
+
return uimg
|
34 |
+
|
35 |
|
|
|
36 |
|
37 |
+
|
38 |
gr.Markdown("<h1><center>NPC Generator</center></h1>")
|
39 |
gr.Markdown(
|
40 |
"<div>Run <a href='https://huggingface.co/spaces/multimodalart/latentdiffusion'>Latent Diffusion</a> first to generate an image</div>"
|