fffiloni commited on
Commit
b9c8bbb
·
1 Parent(s): 2e78fa3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -24,7 +24,7 @@ from models.unet import UNet3DConditionModel
24
  from models.controlnet import ControlNetModel3D
25
  from models.RIFE.IFNet_HDv3 import IFNet
26
 
27
-
28
  device = "cuda"
29
 
30
  sd_path = "checkpoints/stable-diffusion-v1-5"
@@ -85,13 +85,13 @@ def infer(prompt, video_path, condition, video_length, is_long_video):
85
  else:
86
  annotator = controlnet_parser_dict[condition]()
87
 
88
- tokenizer = CLIPTokenizer.from_pretrained(sd_path, subfolder="tokenizer")
89
- text_encoder = CLIPTextModel.from_pretrained(sd_path, subfolder="text_encoder").to(dtype=torch.float16)
90
- vae = AutoencoderKL.from_pretrained(sd_path, subfolder="vae").to(dtype=torch.float16)
91
- unet = UNet3DConditionModel.from_pretrained_2d(sd_path, subfolder="unet").to(dtype=torch.float16)
92
  controlnet = ControlNetModel3D.from_pretrained_2d(controlnet_dict[condition]).to(dtype=torch.float16)
93
  interpolater = IFNet(ckpt_path=inter_path).to(dtype=torch.float16)
94
- scheduler=DDIMScheduler.from_pretrained(sd_path, subfolder="scheduler")
95
 
96
  pipe = ControlVideoPipeline(
97
  vae=vae, text_encoder=text_encoder, tokenizer=tokenizer, unet=unet,
 
24
  from models.controlnet import ControlNetModel3D
25
  from models.RIFE.IFNet_HDv3 import IFNet
26
 
27
+ hf_token = os.environ['HF_TOKEN']
28
  device = "cuda"
29
 
30
  sd_path = "checkpoints/stable-diffusion-v1-5"
 
85
  else:
86
  annotator = controlnet_parser_dict[condition]()
87
 
88
+ tokenizer = CLIPTokenizer.from_pretrained(sd_path, subfolder="tokenizer", use_auth_token=hf_token)
89
+ text_encoder = CLIPTextModel.from_pretrained(sd_path, subfolder="text_encoder", use_auth_token=hf_token).to(dtype=torch.float16)
90
+ vae = AutoencoderKL.from_pretrained(sd_path, subfolder="vae", use_auth_token=hf_token).to(dtype=torch.float16)
91
+ unet = UNet3DConditionModel.from_pretrained_2d(sd_path, subfolder="unet", use_auth_token=hf_token).to(dtype=torch.float16)
92
  controlnet = ControlNetModel3D.from_pretrained_2d(controlnet_dict[condition]).to(dtype=torch.float16)
93
  interpolater = IFNet(ckpt_path=inter_path).to(dtype=torch.float16)
94
+ scheduler=DDIMScheduler.from_pretrained(sd_path, subfolder="scheduler", use_auth_token=hf_token)
95
 
96
  pipe = ControlVideoPipeline(
97
  vae=vae, text_encoder=text_encoder, tokenizer=tokenizer, unet=unet,