Spaces:
Runtime error
Runtime error
verkaDerkaDerk
commited on
Commit
•
d800787
1
Parent(s):
a22a765
Update app.py
Browse files
app.py
CHANGED
@@ -3,6 +3,8 @@ from diffusers import DDPMPipeline, DDIMPipeline, PNDMPipeline
|
|
3 |
|
4 |
MODEL_ID = "verkaDerkaDerk/tiki-based-128"
|
5 |
PIPELINE = DDPMPipeline.from_pretrained(MODEL_ID)
|
|
|
|
|
6 |
|
7 |
#def imagine(name):
|
8 |
def imagine():
|
@@ -10,10 +12,31 @@ def imagine():
|
|
10 |
return image
|
11 |
|
12 |
def main():
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |
|
18 |
|
19 |
main()
|
|
|
3 |
|
4 |
MODEL_ID = "verkaDerkaDerk/tiki-based-128"
|
5 |
PIPELINE = DDPMPipeline.from_pretrained(MODEL_ID)
|
6 |
+
PIPELINE = PIPELINE.to("cuda")
|
7 |
+
|
8 |
|
9 |
#def imagine(name):
|
10 |
def imagine():
|
|
|
12 |
return image
|
13 |
|
14 |
def main():
|
15 |
+
if True:
|
16 |
+
# try some https://huggingface.co/spaces/stabilityai/stable-diffusion/blob/main/app.py trix
|
17 |
+
block = gr.Blocks()
|
18 |
+
with block:
|
19 |
+
gr.HTML('''
|
20 |
+
maybe this will work?
|
21 |
+
|
22 |
+
''')
|
23 |
+
with gr.Group():
|
24 |
+
with gr.Box():
|
25 |
+
with gr.Row():
|
26 |
+
btn = gr.Button("Generate image")
|
27 |
+
btn.click(infer, inputs=[text, samples, steps, scale, seed], outputs=gallery)
|
28 |
+
gallery = gr.Gallery(
|
29 |
+
label="Generated images", show_label=False, elem_id="gallery"
|
30 |
+
).style(grid=[1], height="auto")
|
31 |
+
btn.click(imagine, inputs=None, outputs=gallery)
|
32 |
+
gr.HTML('''
|
33 |
+
Then a nice little footer?
|
34 |
+
'''')
|
35 |
+
else:
|
36 |
+
inputs = "text"
|
37 |
+
inputs = None
|
38 |
+
outputs = "pil"
|
39 |
+
gr.Interface(fn=imagine, inputs=inputs, outputs=outputs).launch()
|
40 |
|
41 |
|
42 |
main()
|