Yaron Koresh commited on
Commit
436d5bc
·
verified ·
1 Parent(s): b522f5d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -1
app.py CHANGED
@@ -33,7 +33,7 @@ step = 2
33
  #ckpt = f"animatediff_lightning_{step}step_diffusers.safetensors"
34
  #base = "emilianJR/epiCRealism"
35
  base = "SG161222/Realistic_Vision_V6.0_B1_noVAE"
36
- vae = AutoencoderKL.from_single_file("https://huggingface.co/stabilityai/sd-vae-ft-mse-original/vae-ft-mse-840000-ema-pruned.safetensors").to(device, dtype=dtype)
37
  #unet = UNet2DConditionModel.from_config("emilianJR/epiCRealism",subfolder="unet").to(device, dtype).load_state_dict(load_file(hf_hub_download("emilianJR/epiCRealism", "unet/diffusion_pytorch_model.safetensors"), device=device), strict=False)
38
  adapter = MotionAdapter.from_pretrained("guoyww/animatediff-motion-adapter-v1-5-3", torch_dtype=dtype, device=device)
39
 
@@ -142,6 +142,18 @@ def Piper(image,positive,negative,motion):
142
 
143
  pipe.to(device)
144
 
 
 
 
 
 
 
 
 
 
 
 
 
145
  return pipe(
146
  positive,
147
  negative_prompt=negative,
 
33
  #ckpt = f"animatediff_lightning_{step}step_diffusers.safetensors"
34
  #base = "emilianJR/epiCRealism"
35
  base = "SG161222/Realistic_Vision_V6.0_B1_noVAE"
36
+ vae = AutoencoderKL.from_single_file("https://huggingface.co/emilianJR/epiCRealism/vae/diffusion_pytorch_model.safetensors").to(device, dtype=dtype)
37
  #unet = UNet2DConditionModel.from_config("emilianJR/epiCRealism",subfolder="unet").to(device, dtype).load_state_dict(load_file(hf_hub_download("emilianJR/epiCRealism", "unet/diffusion_pytorch_model.safetensors"), device=device), strict=False)
38
  adapter = MotionAdapter.from_pretrained("guoyww/animatediff-motion-adapter-v1-5-3", torch_dtype=dtype, device=device)
39
 
 
142
 
143
  pipe.to(device)
144
 
145
+ if image == None:
146
+ return pipe(
147
+ positive,
148
+ negative_prompt=negative,
149
+ height=1024,
150
+ width=576,
151
+ ip_adapter_image=image.convert("RGB").resize((576,1024)),
152
+ num_inference_steps=step,
153
+ guidance_scale=1,
154
+ num_frames=(fps*time)
155
+ )
156
+
157
  return pipe(
158
  positive,
159
  negative_prompt=negative,