From a3cc3267489bfd44e5a994d98d52481c0cc80730 Mon Sep 17 00:00:00 2001 From: comfyanonymous Date: Fri, 9 Aug 2024 12:16:25 -0400 Subject: [PATCH] Better fix for lowvram issue. --- comfy/model_patcher.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/comfy/model_patcher.py b/comfy/model_patcher.py index 5577ca4b..56e85f99 100644 --- a/comfy/model_patcher.py +++ b/comfy/model_patcher.py @@ -393,9 +393,9 @@ class ModelPatcher: if m.comfy_cast_weights: wipe_lowvram_weight(m) - param = list(m.parameters()) - if len(param) > 0: + if hasattr(m, "weight"): mem_counter += comfy.model_management.module_size(m) + param = list(m.parameters()) weight = param[0] if weight.device == device_to: continue