From 4fc4159c88c60703d2f7b4af7f031511cc6bc5f8 Mon Sep 17 00:00:00 2001 From: kijai <40791699+kijai@users.noreply.github.com> Date: Sun, 27 Apr 2025 17:22:02 +0300 Subject: [PATCH] fix up default rope dtype --- wanvideo/modules/model.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/wanvideo/modules/model.py b/wanvideo/modules/model.py index bd3d287..da05ead 100644 --- a/wanvideo/modules/model.py +++ b/wanvideo/modules/model.py @@ -118,7 +118,7 @@ def rope_apply(x, grid_sizes, freqs): # append to collection output.append(x_i) - return torch.stack(output).float() + return torch.stack(output).to(x.dtype) class WanRMSNorm(nn.Module): @@ -1021,7 +1021,8 @@ class WanModel(ModelMixin, ConfigMixin): camera_embed=None, unianim_data=None, fps_embeds=None, - fun_ref = None + fun_ref = None, + fun_camera=None, ): r""" Forward pass through the diffusion model @@ -1073,6 +1074,10 @@ class WanModel(ModelMixin, ConfigMixin): for u in x ] + if self.control_adapter is not None and fun_camera is not None: + fun_camera = self.control_adapter(fun_camera) + x = [u + v for u, v in zip(x, fun_camera)] + grid_sizes = torch.stack( [torch.tensor(u.shape[2:], dtype=torch.long) for u in x])