The most powerful and modular diffusion model GUI, api and backend with a graph/nodes interface. The fastest local inference engine in the world.
Fix issue with bypass loras and fused paths. (#16862)
comfyanonymousd91ed5f5b7fa
diff --git a/comfy/ops.py b/comfy/ops.pyindex 3ae8722b2..4fdbc0dac 100644--- a/comfy/ops.py+++ b/comfy/ops.py@@ -500,6 +500,7 @@ class CastBiasWeightContext:class CastWeightBiasOp:comfy_cast_weights = False+ comfy_force_forward = Falseweight_function = []bias_function = []@@ -1019,7 +1020,7 @@ def linear_input_act(linear, x, input_act, act_weight=None, act_eps=0.0,run_every_op()weight = linear.weightquantized = isinstance(weight, QuantizedTensor)- if (comfy.model_management.in_training or getattr(linear, "_full_precision_mm", False)+ if (comfy.model_management.in_training or getattr(linear, "comfy_force_forward", False) or getattr(linear, "_full_precision_mm", False)or not ((quantized and weight._layout_cls == "TensorWiseINT8Layout"and not getattr(weight._params, "transposed", False))or (not quantized and _fp16_linear_wanted(x)))):diff --git a/comfy/weight_adapter/bypass.py b/comfy/weight_adapter/bypass.pyindex b9d5ec7d9..f97bd2c81 100644--- a/comfy/weight_adapter/bypass.py+++ b/comfy/weight_adapter/bypass.py@@ -199,6 +199,8 @@ class BypassForwardHook:self._move_adapter_weights_to_device(device, dtype)self.original_forward = self.module.forward+ self.original_force_forward = getattr(self.module, "comfy_force_forward", False)+ self.module.comfy_force_forward = Trueself.module.forward = self._bypass_forwardlogging.debug(f"[BypassHook] Injected bypass forward for {type(self.module).__name__} (adapter={type(self.adapter).__name__})"@@ -255,6 +257,7 @@ class BypassForwardHook:return # Not injectedself.module.forward = self.original_forward+ self.module.comfy_force_forward = self.original_force_forwardself.original_forward = Nonelogging.debug(f"[BypassHook] Ejected bypass forward for {type(self.module).__name__}"