Skip to content
Python

Fixed injected frames with control video with mask

deepbeepmeep81021e7a6fc7
diff --git a/wan/text2video.py b/wan/text2video.py
index dfa456b..ad008c2 100644
--- a/wan/text2video.py
+++ b/wan/text2video.py
@@ -253,7 +253,7 @@ class WanT2V:
if src_video_shape[1] != total_frames:
src_video[i] = torch.cat( [src_video[i], src_video[i].new_zeros(src_video_shape[0], total_frames -src_video_shape[1], *src_video_shape[-2:])], dim=1)
src_mask[i] = torch.cat( [src_mask[i], src_mask[i].new_ones(src_video_shape[0], total_frames -src_video_shape[1], *src_video_shape[-2:])], dim=1)
- src_mask[i] = torch.clamp((src_mask[i][:1, :, :, :] + 1) / 2, min=0, max=1)
+ src_mask[i] = torch.clamp((src_mask[i][:, :, :, :] + 1) / 2, min=0, max=1)
image_sizes.append(src_video[i].shape[2:])
elif sub_src_video is None:
if prepend_count > 0:
@@ -654,4 +654,4 @@ class WanT2V:
module = modules_dict[f"vace_blocks.{vace_layer}"]
target = modules_dict[f"blocks.{model_layer}"]
setattr(target, "vace", module )
- delattr(model, "vace_blocks")
\ No newline at end of file
+ delattr(model, "vace_blocks")