Skip to content

Commit

Permalink
Fix onnx export not working on flux.
Browse files Browse the repository at this point in the history
  • Loading branch information
comfyanonymous committed Sep 6, 2024
1 parent 0c7c98a commit c27ebeb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion comfy/ldm/common_dit.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def pad_to_patch_size(img, patch_size=(2, 2), padding_mode="circular"):
rms_norm_torch = None

def rms_norm(x, weight, eps=1e-6):
if rms_norm_torch is not None:
if rms_norm_torch is not None and not (torch.jit.is_tracing() or torch.jit.is_scripting()):
return rms_norm_torch(x, weight.shape, weight=comfy.ops.cast_to(weight, dtype=x.dtype, device=x.device), eps=eps)
else:
rrms = torch.rsqrt(torch.mean(x**2, dim=-1, keepdim=True) + eps)
Expand Down

0 comments on commit c27ebeb

Please sign in to comment.