Skip to content

Commit

Permalink
Fix Flux FP64 math on XPU (comfyanonymous#4210)
Browse files Browse the repository at this point in the history
  • Loading branch information
a-One-Fan authored Aug 5, 2024
1 parent 78e133d commit a178e25
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion comfy/ldm/flux/math.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def attention(q: Tensor, k: Tensor, v: Tensor, pe: Tensor) -> Tensor:

def rope(pos: Tensor, dim: int, theta: int) -> Tensor:
assert dim % 2 == 0
if comfy.model_management.is_device_mps(pos.device):
if comfy.model_management.is_device_mps(pos.device) or comfy.model_management.is_intel_xpu():
device = torch.device("cpu")
else:
device = pos.device
Expand Down

0 comments on commit a178e25

Please sign in to comment.