Yaron Koresh commited on
Commit
925da88
·
verified ·
1 Parent(s): 42f41a3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -203,6 +203,8 @@ def main():
203
 
204
  progress=gr.Progress()
205
 
 
 
206
  repo="stabilityai/sd-vae-ft-mse-original"
207
  ckpt="vae-ft-mse-840000-ema-pruned.safetensors"
208
  vae = load_file(hf_hub_download(repo, ckpt), device=device)
@@ -211,9 +213,7 @@ def main():
211
  ckpt=f"sdxl_lightning_{step}step_unet.safetensors"
212
  unet = load_file(hf_hub_download(repo, ckpt), device=device)
213
 
214
- repo = "SG161222/Realistic_Vision_V6.0_B1_noVAE"
215
- ckpt="feature_extractor/preprocessor_config.json"
216
- fext = load_file(hf_hub_download(repo, ckpt), device=device)
217
 
218
  #repo = "emilianJR/epiCRealism"
219
  #ckpt = "unet/diffusion_pytorch_model.safetensors"
@@ -223,7 +223,7 @@ def main():
223
  ckpt = f"animatediff_lightning_{step}step_diffusers.safetensors"
224
  base = "black-forest-labs/FLUX.1-schnell"
225
 
226
- pipe = AnimateDiffPipeline.from_pretrained(base, vae=vae, feature_extractor=fext, unet=unet, torch_dtype=dtype, token=os.getenv("hf_token")).to(device)
227
  pipe.scheduler = EulerDiscreteScheduler.from_config(pipe.scheduler.config, timestep_spacing="trailing", beta_schedule="linear")
228
  pipe.unet.load_state_dict(load_file(hf_hub_download(repo, ckpt), device=device), strict=False)
229
  pipe.enable_free_init(method="butterworth", use_fast_sampling=False)
 
203
 
204
  progress=gr.Progress()
205
 
206
+ adapter = MotionAdapter.from_pretrained("guoyww/animatediff-motion-adapter-v1-5-2")
207
+
208
  repo="stabilityai/sd-vae-ft-mse-original"
209
  ckpt="vae-ft-mse-840000-ema-pruned.safetensors"
210
  vae = load_file(hf_hub_download(repo, ckpt), device=device)
 
213
  ckpt=f"sdxl_lightning_{step}step_unet.safetensors"
214
  unet = load_file(hf_hub_download(repo, ckpt), device=device)
215
 
216
+ #repo = "SG161222/Realistic_Vision_V6.0_B1_noVAE"
 
 
217
 
218
  #repo = "emilianJR/epiCRealism"
219
  #ckpt = "unet/diffusion_pytorch_model.safetensors"
 
223
  ckpt = f"animatediff_lightning_{step}step_diffusers.safetensors"
224
  base = "black-forest-labs/FLUX.1-schnell"
225
 
226
+ 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)
227
  pipe.scheduler = EulerDiscreteScheduler.from_config(pipe.scheduler.config, timestep_spacing="trailing", beta_schedule="linear")
228
  pipe.unet.load_state_dict(load_file(hf_hub_download(repo, ckpt), device=device), strict=False)
229
  pipe.enable_free_init(method="butterworth", use_fast_sampling=False)