hysts HF staff commited on
Commit
2cd1841
1 Parent(s): 8eb5d1d
Files changed (1) hide show
  1. app.py +6 -3
app.py CHANGED
@@ -23,10 +23,13 @@ DEFAULT_NUM_FRAMES = min(MAX_NUM_FRAMES,
23
  int(os.getenv('DEFAULT_NUM_FRAMES', '24')))
24
  MAX_SEED = np.iinfo(np.int32).max
25
 
26
- pipe = DiffusionPipeline.from_pretrained('cerspense/zeroscope_v2_576w',
27
- torch_dtype=torch.float16)
 
 
 
 
28
  pipe.scheduler = DPMSolverMultistepScheduler.from_config(pipe.scheduler.config)
29
- pipe.enable_model_cpu_offload()
30
  pipe.enable_vae_slicing()
31
 
32
 
 
23
  int(os.getenv('DEFAULT_NUM_FRAMES', '24')))
24
  MAX_SEED = np.iinfo(np.int32).max
25
 
26
+ if torch.cuda.is_available():
27
+ pipe = DiffusionPipeline.from_pretrained('cerspense/zeroscope_v2_576w',
28
+ torch_dtype=torch.float16)
29
+ pipe.enable_model_cpu_offload()
30
+ else:
31
+ pipe = DiffusionPipeline.from_pretrained('cerspense/zeroscope_v2_576w')
32
  pipe.scheduler = DPMSolverMultistepScheduler.from_config(pipe.scheduler.config)
 
33
  pipe.enable_vae_slicing()
34
 
35