Spaces:
Running
on
Zero
Running
on
Zero
PseudoTerminal X
commited on
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,3 +1,15 @@
|
|
| 1 |
-
import
|
|
|
|
| 2 |
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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()
|