hpoghos commited on
Commit
b6ec94d
·
verified ·
1 Parent(s): 222790c

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -0
app.py ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import spaces
2
+ from diffusers import DiffusionPipeline
3
+
4
+ pipe = DiffusionPipeline.from_pretrained(...)
5
+ pipe.to('cuda')
6
+
7
+ @spaces.GPU
8
+ def generate(prompt):
9
+ return pipe(prompt).images
10
+
11
+ gr.Interface(
12
+ fn=generate,
13
+ inputs=gr.Text(),
14
+ outputs=gr.Gallery(),
15
+ ).launch()