astronaut
Browse files- astronaut_horse_on_moon.png +0 -0
- test.py +1 -17
astronaut_horse_on_moon.png
ADDED
test.py
CHANGED
@@ -1,28 +1,12 @@
|
|
1 |
-
# # make sure you're logged in with `huggingface-cli login`
|
2 |
-
# from diffusers import StableDiffusionPipeline
|
3 |
-
|
4 |
-
# pipe = StableDiffusionPipeline.from_pretrained("CompVis/stable-diffusion-v1-4")
|
5 |
-
# pipe = pipe.to("cpu")
|
6 |
-
|
7 |
-
# prompt = "a photo of an astronaut riding a horse on mars"
|
8 |
-
|
9 |
-
# # First-time "warmup" pass (see explanation above)
|
10 |
-
# _ = pipe(prompt, num_inference_steps=1)
|
11 |
-
|
12 |
-
# # Results match those from the CPU device after the warmup pass.
|
13 |
-
# image = pipe(prompt).images[0]
|
14 |
-
|
15 |
from diffusers import StableDiffusionPipeline
|
16 |
|
17 |
-
|
18 |
DEVICE = 'mps'
|
19 |
|
20 |
-
|
21 |
pipe = StableDiffusionPipeline.from_pretrained(
|
22 |
"CompVis/stable-diffusion-v1-4",
|
23 |
use_auth_token=True
|
24 |
).to(DEVICE)
|
25 |
|
26 |
-
image = pipe(prompt="a
|
27 |
"sample"][0]
|
28 |
image.save("diffusion.png")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
from diffusers import StableDiffusionPipeline
|
2 |
|
|
|
3 |
DEVICE = 'mps'
|
4 |
|
|
|
5 |
pipe = StableDiffusionPipeline.from_pretrained(
|
6 |
"CompVis/stable-diffusion-v1-4",
|
7 |
use_auth_token=True
|
8 |
).to(DEVICE)
|
9 |
|
10 |
+
image = pipe(prompt="a photo of an astronaut riding a horse on mars")[
|
11 |
"sample"][0]
|
12 |
image.save("diffusion.png")
|