diff --git a/comfy/ldm/modules/diffusionmodules/mmdit.py b/comfy/ldm/modules/diffusionmodules/mmdit.py index 0cb6bd31..20d3a321 100644 --- a/comfy/ldm/modules/diffusionmodules/mmdit.py +++ b/comfy/ldm/modules/diffusionmodules/mmdit.py @@ -243,9 +243,9 @@ class TimestepEmbedder(nn.Module): half = dim // 2 freqs = torch.exp( -math.log(max_period) - * torch.arange(start=0, end=half, dtype=torch.float32) + * torch.arange(start=0, end=half, dtype=torch.float32, device=t.device) / half - ).to(device=t.device) + ) args = t[:, None].float() * freqs[None] embedding = torch.cat([torch.cos(args), torch.sin(args)], dim=-1) if dim % 2: