Spaces:
Runtime error
Runtime error
Commit
·
67db81c
1
Parent(s):
4444c53
Update app.py
Browse files
app.py
CHANGED
@@ -1,10 +1,8 @@
|
|
1 |
-
import
|
2 |
-
from
|
3 |
|
4 |
-
pipe =
|
|
|
5 |
|
6 |
-
|
7 |
-
|
8 |
-
if text:
|
9 |
-
out = pipe(text)
|
10 |
-
st.json(out)
|
|
|
1 |
+
import torch
|
2 |
+
from diffusers import StableDiffusionPipeline
|
3 |
|
4 |
+
pipe = StableDiffusionPipeline.from_pretrained("runwayml/stable-diffusion-v1-5", torch_dtype=torch.float16)
|
5 |
+
pipe = pipe.to("cuda")
|
6 |
|
7 |
+
prompt = "a photo of an astronaut riding a horse on mars"
|
8 |
+
image = pipe(prompt).images[0]
|
|
|
|
|
|