From 81021e7a6fc7483ff832e95adf4bdd8ecc1a2c08 Mon Sep 17 00:00:00 2001 From: deepbeepmeep <84379123+deepbeepmeep@users.noreply.github.com> Date: Fri, 27 Jun 2025 08:28:28 +0200 Subject: [PATCH] Fixed injected frames with control video with mask --- wan/text2video.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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")