From 111f583e00cbd7b08149856f2b6de7a58ea65c0b Mon Sep 17 00:00:00 2001 From: comfyanonymous <121283862+comfyanonymous@users.noreply.github.com> Date: Tue, 1 Jul 2025 21:57:13 -0700 Subject: [PATCH] Fallback to regular op when fp8 op throws exception. (#8761) --- comfy/ops.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/comfy/ops.py b/comfy/ops.py index 431c8f89d2e..2cc9bbc27e7 100644 --- a/comfy/ops.py +++ b/comfy/ops.py @@ -336,9 +336,12 @@ def reset_parameters(self): return None def forward_comfy_cast_weights(self, input): - out = fp8_linear(self, input) - if out is not None: - return out + try: + out = fp8_linear(self, input) + if out is not None: + return out + except Exception as e: + logging.info("Exception during fp8 op: {}".format(e)) weight, bias = cast_bias_weight(self, input) return torch.nn.functional.linear(input, weight, bias)