patrickvonplaten commited on
Commit
e567b02
1 Parent(s): daaf23e
Files changed (2) hide show
  1. fantasy_landscape.png +2 -2
  2. run.py +3 -5
fantasy_landscape.png CHANGED

Git LFS Details

  • SHA256: 2a71399a219086f294f19e1a6547b272ba055b48309fe03566e28952c5b26855
  • Pointer size: 131 Bytes
  • Size of remote file: 797 kB

Git LFS Details

  • SHA256: 99a9d836b8a296b2bba08064da1a4844379dd9943b8c81d51c28274ce90b39a2
  • Pointer size: 131 Bytes
  • Size of remote file: 914 kB
run.py CHANGED
@@ -6,9 +6,8 @@ import time
6
 
7
  from diffusers import DiffusionPipeline
8
 
9
- start_time = time.time()
10
- pipe = DiffusionPipeline.from_pretrained("/home/patrick_huggingface_co/stable-diffusion-2-1-unclip", torch_dtype=torch.float16, variant="fp16")
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(prompt, init_image).images
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")