patrickvonplaten
commited on
Commit
•
e567b02
1
Parent(s):
daaf23e
up
Browse files- fantasy_landscape.png +2 -2
- run.py +3 -5
fantasy_landscape.png
CHANGED
Git LFS Details
|
Git LFS Details
|
run.py
CHANGED
@@ -6,9 +6,8 @@ import time
|
|
6 |
|
7 |
from diffusers import DiffusionPipeline
|
8 |
|
9 |
-
|
10 |
-
pipe
|
11 |
-
pipe.enable_model_cpu_offload()
|
12 |
|
13 |
url = "https://raw.githubusercontent.com/CompVis/stable-diffusion/main/assets/stable-samples/img2img/sketch-mountains-input.jpg"
|
14 |
|
@@ -18,6 +17,5 @@ init_image = init_image.resize((768, 512))
|
|
18 |
|
19 |
prompt = "A fantasy landscape, trending on artstation"
|
20 |
|
21 |
-
images = pipe(
|
22 |
-
print(time.time() - start_time)
|
23 |
images[0].save("fantasy_landscape.png")
|
|
|
6 |
|
7 |
from diffusers import DiffusionPipeline
|
8 |
|
9 |
+
pipe = DiffusionPipeline.from_pretrained("stabilityai/stable-diffusion-2-1-unclip", torch_dtype=torch.float16, variant="fp16")
|
10 |
+
pipe.to("cuda")
|
|
|
11 |
|
12 |
url = "https://raw.githubusercontent.com/CompVis/stable-diffusion/main/assets/stable-samples/img2img/sketch-mountains-input.jpg"
|
13 |
|
|
|
17 |
|
18 |
prompt = "A fantasy landscape, trending on artstation"
|
19 |
|
20 |
+
images = pipe(init_image).images
|
|
|
21 |
images[0].save("fantasy_landscape.png")
|