Spaces:
Runtime error
Runtime error
homer-meng
commited on
Commit
•
7671d2b
1
Parent(s):
499b36d
Update app.py
Browse files
app.py
CHANGED
@@ -1,8 +1,12 @@
|
|
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 = "
|
8 |
-
image = pipe(prompt).images[0]
|
|
|
|
|
|
|
|
1 |
import torch
|
2 |
from diffusers import StableDiffusionPipeline
|
3 |
+
from PIL import Image
|
4 |
|
5 |
pipe = StableDiffusionPipeline.from_pretrained("runwayml/stable-diffusion-v1-5", torch_dtype=torch.float16)
|
6 |
pipe = pipe.to("cuda")
|
7 |
|
8 |
+
prompt = input("Enter a prompt: ")
|
9 |
+
image = pipe(prompt).images[0]
|
10 |
+
|
11 |
+
image = Image.fromarray(image)
|
12 |
+
image.show()
|