Skip to content

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 potential issue. (#11201)

comfyanonymousd50f342c9080
diff --git a/comfy/model_patcher.py b/comfy/model_patcher.py
index a7d24ac13..2e8ce2613 100644
--- a/comfy/model_patcher.py
+++ b/comfy/model_patcher.py
@@ -923,7 +923,7 @@ class ModelPatcher:
patch_counter += 1
cast_weight = True
- if cast_weight:
+ if cast_weight and hasattr(m, "comfy_cast_weights"):
m.prev_comfy_cast_weights = m.comfy_cast_weights
m.comfy_cast_weights = True
m.comfy_patched_weights = False