From 6678d5cf65894e6bd46614a4e03c8036894d9a6a Mon Sep 17 00:00:00 2001 From: comfyanonymous Date: Fri, 9 Aug 2024 14:02:38 -0400 Subject: [PATCH] Fix regression. --- comfy/model_patcher.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/comfy/model_patcher.py b/comfy/model_patcher.py index 56e85f99..6c67193e 100644 --- a/comfy/model_patcher.py +++ b/comfy/model_patcher.py @@ -396,9 +396,10 @@ class ModelPatcher: 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 + if len(param) > 0: + weight = param[0] + if weight.device == device_to: + continue self.patch_weight_to_device(weight_key) #TODO: speed this up without OOM self.patch_weight_to_device(bias_key)