From ee8a636cb7c7033e63b7ed8d184ee9a6b4afe2d3 Mon Sep 17 00:00:00 2001 From: Eugene Fairley Date: Fri, 27 Jun 2025 11:33:44 -0700 Subject: [PATCH] test --- comfy/ldm/wan/model.py | 2 +- comfy/model_base.py | 6 +++++- comfy_extras/nodes_wan.py | 3 +-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/comfy/ldm/wan/model.py b/comfy/ldm/wan/model.py index 1d6edb354..63ab3fbfc 100644 --- a/comfy/ldm/wan/model.py +++ b/comfy/ldm/wan/model.py @@ -440,7 +440,7 @@ class WanModel(torch.nn.Module): # embeddings self.patch_embedding = operations.Conv3d( - in_dim, dim, kernel_size=patch_size, stride=patch_size, device=operation_settings.get("device"), dtype=torch.float32) + 20, dim, kernel_size=patch_size, stride=patch_size, device=operation_settings.get("device"), dtype=torch.float32) self.text_embedding = nn.Sequential( operations.Linear(text_dim, dim, device=operation_settings.get("device"), dtype=operation_settings.get("dtype")), nn.GELU(approximate='tanh'), operations.Linear(dim, dim, device=operation_settings.get("device"), dtype=operation_settings.get("dtype"))) diff --git a/comfy/model_base.py b/comfy/model_base.py index 75ec42699..606def030 100644 --- a/comfy/model_base.py +++ b/comfy/model_base.py @@ -1064,6 +1064,7 @@ class WAN21(BaseModel): def concat_cond(self, **kwargs): noise = kwargs.get("noise", None) extra_channels = self.diffusion_model.patch_embedding.weight.shape[1] - noise.shape[1] + print(f"extra channels: {extra_channels}, noise shape: {noise.shape}, patch embedding weight shape: {self.diffusion_model.patch_embedding.weight.shape}") if extra_channels == 0: return None @@ -1080,6 +1081,7 @@ class WAN21(BaseModel): image[:, i: i + 16] = self.process_latent_in(image[:, i: i + 16]) image = utils.resize_to_batch_size(image, noise.shape[0]) + print(f"image shape: {image.shape}") if not self.image_to_video or extra_channels == image.shape[1]: return image @@ -1098,8 +1100,10 @@ class WAN21(BaseModel): mask = torch.nn.functional.pad(mask, (0, 0, 0, 0, 0, noise.shape[-3] - mask.shape[-3]), mode='constant', value=0) if mask.shape[1] == 1: mask = mask.repeat(1, 4, 1, 1, 1) + + print(f"Mask shape: {mask.shape}, noise shape: {noise.shape}") mask = utils.resize_to_batch_size(mask, noise.shape[0]) - + print(f"image shape: {image.shape}, mask shape: {mask.shape}") return torch.cat((mask, image), dim=1) def extra_conds(self, **kwargs): diff --git a/comfy_extras/nodes_wan.py b/comfy_extras/nodes_wan.py index 1d8e4dc22..3563b3ad7 100644 --- a/comfy_extras/nodes_wan.py +++ b/comfy_extras/nodes_wan.py @@ -657,7 +657,6 @@ class WanTrackToVideo: zero_frames = torch.zeros(3, 81 - 1, height, width) start_image = start_image.permute(3,0,1,2) # C, T, H, W - start_image = start_image * 2 - 1 res = torch.concat([ start_image.to(start_image.device), zero_frames @@ -668,7 +667,7 @@ class WanTrackToVideo: res.permute(1,2,3,0)[:, :, :, :3] # T, H, W, C )[0] y = torch.concat([msk, y]) - + print('?') motion_patched = patch_motion(processed_tracks, y, temperature, (4, 16), topk)[None] mask, video = motion_patched[:, 0:4], motion_patched[:, 4:] # Add motion features to conditioning