Compare commits

...

6 Commits

Author SHA1 Message Date
honglyua
75579b40fc
Merge 70c58ba68e into 3fe9f5fecb 2026-07-04 14:10:53 +08:00
honglyua
70c58ba68e
Merge branch 'master' into fix_flux_fp64 2026-04-27 17:02:32 +08:00
honglyua
aac362a764
Merge branch 'master' into fix_flux_fp64 2026-03-24 14:04:44 +08:00
honglyua
64d4ec95ef
Merge branch 'master' into fix_flux_fp64 2026-02-27 09:37:27 +08:00
honglyua
6e32d04168
Merge branch 'master' into fix_flux_fp64 2026-02-24 09:56:32 +08:00
hongliang.yuan
930bb46bd6 fix flux fp64 on ixuca 2026-02-09 16:02:49 +08:00

View File

@ -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)