mirror of
https://github.com/Wan-Video/Wan2.1.git
synced 2025-11-04 14:16:57 +00:00
Fixed injected frames with control video with mask
This commit is contained in:
parent
10db954aaa
commit
81021e7a6f
@ -253,7 +253,7 @@ class WanT2V:
|
|||||||
if src_video_shape[1] != total_frames:
|
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_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.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:])
|
image_sizes.append(src_video[i].shape[2:])
|
||||||
elif sub_src_video is None:
|
elif sub_src_video is None:
|
||||||
if prepend_count > 0:
|
if prepend_count > 0:
|
||||||
@ -654,4 +654,4 @@ class WanT2V:
|
|||||||
module = modules_dict[f"vace_blocks.{vace_layer}"]
|
module = modules_dict[f"vace_blocks.{vace_layer}"]
|
||||||
target = modules_dict[f"blocks.{model_layer}"]
|
target = modules_dict[f"blocks.{model_layer}"]
|
||||||
setattr(target, "vace", module )
|
setattr(target, "vace", module )
|
||||||
delattr(model, "vace_blocks")
|
delattr(model, "vace_blocks")
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user