From 930bb46bd6b5f2f8a817c15fb3a736b954e69ae2 Mon Sep 17 00:00:00 2001 From: "hongliang.yuan" Date: Mon, 9 Feb 2026 16:02:49 +0800 Subject: [PATCH] fix flux fp64 on ixuca --- comfy/ldm/flux/math.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/comfy/ldm/flux/math.py b/comfy/ldm/flux/math.py index f9597de5b..80a5d0a03 100644 --- a/comfy/ldm/flux/math.py +++ b/comfy/ldm/flux/math.py @@ -21,7 +21,8 @@ def rope(pos: Tensor, dim: int, theta: int) -> Tensor: else: device = pos.device - scale = torch.linspace(0, (dim - 2) / dim, steps=dim//2, dtype=torch.float64, device=device) + dtype = torch.float32 if comfy.model_management.is_ixuca() else torch.float64 + scale = torch.linspace(0, (dim - 2) / dim, steps=dim//2, dtype=dtype, device=device) omega = 1.0 / (theta**scale) out = torch.einsum("...n,d->...nd", pos.to(dtype=torch.float32, device=device), omega) out = torch.stack([torch.cos(out), -torch.sin(out), torch.sin(out), torch.cos(out)], dim=-1)