Yaron Koresh commited on
Commit
5b2061c
·
verified ·
1 Parent(s): 1c3508c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -214,10 +214,10 @@ def main():
214
  repo = "ByteDance/AnimateDiff-Lightning"
215
  ckpt = f"animatediff_lightning_{step}step_diffusers.safetensors"
216
 
217
- adapter = MotionAdapter().to(device, dtype)
218
- adapter.load_state_dict(load_file(hf_hub_download(repo ,ckpt), device=device))
219
- pipe = AnimateDiffPipeline.from_pretrained(base, motion_adapter=adapter, torch_dtype=dtype).to(device)
220
  pipe.scheduler = EulerDiscreteScheduler.from_config(pipe.scheduler.config, timestep_spacing="trailing", beta_schedule="linear")
 
 
221
 
222
  mp.set_start_method("spawn", force=True)
223
 
 
214
  repo = "ByteDance/AnimateDiff-Lightning"
215
  ckpt = f"animatediff_lightning_{step}step_diffusers.safetensors"
216
 
217
+ pipe = AnimateDiffPipeline.from_pretrained(base, torch_dtype=dtype).to(device)
 
 
218
  pipe.scheduler = EulerDiscreteScheduler.from_config(pipe.scheduler.config, timestep_spacing="trailing", beta_schedule="linear")
219
+ pipe.unet.load_state_dict(load_file(hf_hub_download(repo, ckpt), device=device), strict=False)
220
+ pipe.unet.load_state_dict(torch.load(hf_hub_download(base, "unet/diffusion_pytorch_model.bin"), map_location=device), strict=False)
221
 
222
  mp.set_start_method("spawn", force=True)
223