Skip to content

Commit 0325ca4

Browse files
YangKai0616dg845
andauthored
Fix MotionConv2d to cast blur_kernel to input dtype instead of reverse (#13364)
Co-authored-by: dg845 <58458699+dg845@users.noreply.github.com>
1 parent a807542 commit 0325ca4

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/diffusers/models/transformers/transformer_wan_animate.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,7 @@ def forward(self, x: torch.Tensor, channel_dim: int = 1) -> torch.Tensor:
166166
# NOTE: the original implementation uses a 2D upfirdn operation with the upsampling and downsampling rates
167167
# set to 1, which should be equivalent to a 2D convolution
168168
expanded_kernel = self.blur_kernel[None, None, :, :].expand(self.in_channels, 1, -1, -1)
169-
x = x.to(expanded_kernel.dtype)
170-
x = F.conv2d(x, expanded_kernel, padding=self.blur_padding, groups=self.in_channels)
169+
x = F.conv2d(x, expanded_kernel.to(x.dtype), padding=self.blur_padding, groups=self.in_channels)
171170

172171
# Main Conv2D with scaling
173172
x = x.to(self.weight.dtype)

0 commit comments

Comments
 (0)