ppbrown commited on
Commit
42e7692
·
verified ·
1 Parent(s): e89ef5c

Update demo.py

Browse files

used pipe.enable_sequential_cpu_offload() for lower vram use.

Files changed (1) hide show
  1. demo.py +2 -2
demo.py CHANGED
@@ -10,8 +10,8 @@ pipe = DiffusionPipeline.from_pretrained(
10
  torch_dtype=torch.bfloat16,
11
  )
12
 
13
- print("model initialized. Now moving to CUDA")
14
- pipe.to("cuda")
15
 
16
  print("Trying render now...")
17
  images = pipe("a misty Tokyo alley at night",num_inference_steps=30).images
 
10
  torch_dtype=torch.bfloat16,
11
  )
12
 
13
+ print("model initialized.")
14
+ pipe.enable_sequential_cpu_offload()
15
 
16
  print("Trying render now...")
17
  images = pipe("a misty Tokyo alley at night",num_inference_steps=30).images