Nedyalko Demirev
commited on
Commit
•
20f0a97
1
Parent(s):
fcf4b9a
nvidia version created
Browse files- apple_silicon.py +12 -0
- test.py → nvidia.py +2 -2
apple_silicon.py
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
prompt = "Synthwave moonlight"
|
10 |
+
image = pipe(prompt).images[0]
|
11 |
+
image.save("pictures/Synthwave.png")
|
12 |
+
|
test.py → nvidia.py
RENAMED
@@ -7,9 +7,9 @@ pipe = StableDiffusionPipeline.from_pretrained(
|
|
7 |
"CompVis/stable-diffusion-v1-4",
|
8 |
use_auth_token=True
|
9 |
).to(DEVICE)
|
10 |
-
prompt = "
|
11 |
pipe.enable_attention_slicing()
|
12 |
# _ = pipe(prompt, num_inference_steps=1)
|
13 |
image = pipe(prompt).images[0]
|
14 |
-
image.save("
|
15 |
|
|
|
7 |
"CompVis/stable-diffusion-v1-4",
|
8 |
use_auth_token=True
|
9 |
).to(DEVICE)
|
10 |
+
prompt = "Barcelona moonlight"
|
11 |
pipe.enable_attention_slicing()
|
12 |
# _ = pipe(prompt, num_inference_steps=1)
|
13 |
image = pipe(prompt).images[0]
|
14 |
+
image.save("pictures/Barcelona1.png")
|
15 |
|