fffiloni commited on
Commit
a02fbe2
·
1 Parent(s): 02a090d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -28,7 +28,7 @@ hf_token = os.environ.get('HF_TOKEN')
28
  device = "cuda"
29
 
30
  #snapshot_download("runwayml/stable-diffusion-v1-5", cache_dir="checkpoints")
31
- sd_path = "runwayml/stable-diffusion-v1-5"
32
  inter_path = "checkpoints/flownet.pkl"
33
  controlnet_dict = {
34
  "pose": "checkpoints/sd-controlnet-openpose",
@@ -89,8 +89,8 @@ def infer(prompt, video_path, condition, video_length, is_long_video):
89
  tokenizer = CLIPTokenizer.from_pretrained(sd_path, subfolder="tokenizer")
90
  text_encoder = CLIPTextModel.from_pretrained(sd_path, subfolder="text_encoder").to(dtype=torch.float16)
91
  vae = AutoencoderKL.from_pretrained(sd_path, subfolder="vae").to(dtype=torch.float16)
92
- unet = UNet3DConditionModel.from_pretrained(sd_path, subfolder="unet").to(dtype=torch.float16)
93
- controlnet = ControlNetModel3D.from_pretrained(controlnet_dict[condition]).to(dtype=torch.float16)
94
  interpolater = IFNet(ckpt_path=inter_path).to(dtype=torch.float16)
95
  scheduler=DDIMScheduler.from_pretrained(sd_path, subfolder="scheduler")
96
 
@@ -150,7 +150,7 @@ with gr.Blocks() as demo:
150
  video_path = gr.Video(source="upload", type="filepath")
151
  condition = gr.Textbox(label="Condition", value="depth")
152
  video_length = gr.Slider(label="video length", minimum=1, maximum=15, step=1, value=2)
153
- seed = gr.Number(label="seed", valie=42)
154
  submit_btn = gr.Button("Submit")
155
  video_res = gr.Video(label="result")
156
 
 
28
  device = "cuda"
29
 
30
  #snapshot_download("runwayml/stable-diffusion-v1-5", cache_dir="checkpoints")
31
+ sd_path = "checkpoints/stable-diffusion-v1-5"
32
  inter_path = "checkpoints/flownet.pkl"
33
  controlnet_dict = {
34
  "pose": "checkpoints/sd-controlnet-openpose",
 
89
  tokenizer = CLIPTokenizer.from_pretrained(sd_path, subfolder="tokenizer")
90
  text_encoder = CLIPTextModel.from_pretrained(sd_path, subfolder="text_encoder").to(dtype=torch.float16)
91
  vae = AutoencoderKL.from_pretrained(sd_path, subfolder="vae").to(dtype=torch.float16)
92
+ unet = UNet3DConditionModel.from_pretrained_2d(sd_path, subfolder="unet").to(dtype=torch.float16)
93
+ controlnet = ControlNetModel3D.from_pretrained_2d(controlnet_dict[condition]).to(dtype=torch.float16)
94
  interpolater = IFNet(ckpt_path=inter_path).to(dtype=torch.float16)
95
  scheduler=DDIMScheduler.from_pretrained(sd_path, subfolder="scheduler")
96
 
 
150
  video_path = gr.Video(source="upload", type="filepath")
151
  condition = gr.Textbox(label="Condition", value="depth")
152
  video_length = gr.Slider(label="video length", minimum=1, maximum=15, step=1, value=2)
153
+ seed = gr.Number(label="seed", value=42)
154
  submit_btn = gr.Button("Submit")
155
  video_res = gr.Video(label="result")
156