Yaron Koresh commited on
Commit
47bf657
·
verified ·
1 Parent(s): 19c4037

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -3
app.py CHANGED
@@ -85,7 +85,6 @@ def Piper(name,positive_prompt,negative,motion):
85
  global base
86
  global device
87
 
88
- pipe.unet.load_state_dict(torch.load(hf_hub_download(base, "unet/diffusion_pytorch_model.bin"), map_location=device), strict=False)
89
  progress((0, step))
90
 
91
  if last_motion != motion:
@@ -198,7 +197,7 @@ def main():
198
  fps=20
199
  time=16
200
  device = "cuda"
201
- dtype = torch.bfloat16
202
  result=[]
203
  step = 2
204
 
@@ -216,7 +215,7 @@ def main():
216
  pipe = AnimateDiffPipeline.from_pretrained(base, vae=vae, motion_adapter=adapter, feature_extractor=None, image_encoder=None, unet=unet, torch_dtype=dtype, token=os.getenv("hf_token")).to(device)
217
  pipe.scheduler = EulerDiscreteScheduler.from_config(pipe.scheduler.config, timestep_spacing="trailing", beta_schedule="linear")
218
  pipe.unet.load_state_dict(load_file(hf_hub_download(repo, ckpt), device=device), strict=False)
219
- pipe.enable_free_init(method="butterworth", use_fast_sampling=False)
220
 
221
  mp.set_start_method("spawn", force=True)
222
 
 
85
  global base
86
  global device
87
 
 
88
  progress((0, step))
89
 
90
  if last_motion != motion:
 
197
  fps=20
198
  time=16
199
  device = "cuda"
200
+ dtype = torch.float16
201
  result=[]
202
  step = 2
203
 
 
215
  pipe = AnimateDiffPipeline.from_pretrained(base, vae=vae, motion_adapter=adapter, feature_extractor=None, image_encoder=None, unet=unet, torch_dtype=dtype, token=os.getenv("hf_token")).to(device)
216
  pipe.scheduler = EulerDiscreteScheduler.from_config(pipe.scheduler.config, timestep_spacing="trailing", beta_schedule="linear")
217
  pipe.unet.load_state_dict(load_file(hf_hub_download(repo, ckpt), device=device), strict=False)
218
+ pipe.enable_free_init(method="butterworth", use_fast_sampling=True)
219
 
220
  mp.set_start_method("spawn", force=True)
221