Unverified Commit 4e445348 authored by chaowenguo's avatar chaowenguo Committed by GitHub
Browse files

Update rerender_a_video.py fix dtype error (#10451)

Update rerender_a_video.py
parent a17832b2
...@@ -782,7 +782,7 @@ class RerenderAVideoPipeline(StableDiffusionControlNetImg2ImgPipeline): ...@@ -782,7 +782,7 @@ class RerenderAVideoPipeline(StableDiffusionControlNetImg2ImgPipeline):
self.attn_state.reset() self.attn_state.reset()
# 4.1 prepare frames # 4.1 prepare frames
image = self.image_processor.preprocess(frames[0]).to(dtype=torch.float32) image = self.image_processor.preprocess(frames[0]).to(dtype=self.dtype)
first_image = image[0] # C, H, W first_image = image[0] # C, H, W
# 4.2 Prepare controlnet_conditioning_image # 4.2 Prepare controlnet_conditioning_image
...@@ -926,8 +926,8 @@ class RerenderAVideoPipeline(StableDiffusionControlNetImg2ImgPipeline): ...@@ -926,8 +926,8 @@ class RerenderAVideoPipeline(StableDiffusionControlNetImg2ImgPipeline):
prev_image = frames[idx - 1] prev_image = frames[idx - 1]
control_image = control_frames[idx] control_image = control_frames[idx]
# 5.1 prepare frames # 5.1 prepare frames
image = self.image_processor.preprocess(image).to(dtype=torch.float32) image = self.image_processor.preprocess(image).to(dtype=self.dtype)
prev_image = self.image_processor.preprocess(prev_image).to(dtype=torch.float32) prev_image = self.image_processor.preprocess(prev_image).to(dtype=self.dtype)
warped_0, bwd_occ_0, bwd_flow_0 = get_warped_and_mask( warped_0, bwd_occ_0, bwd_flow_0 = get_warped_and_mask(
self.flow_model, first_image, image[0], first_result, False, self.device self.flow_model, first_image, image[0], first_result, False, self.device
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment