From 2f12a8a7900c6d1f5a479e11564d38d328813b99 Mon Sep 17 00:00:00 2001 From: Max Tretikov Date: Thu, 13 Jun 2024 15:32:09 -0600 Subject: [PATCH] Ensure patch_data is defined --- comfy/model_patcher.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/comfy/model_patcher.py b/comfy/model_patcher.py index fb22c2cdb..367913c4d 100644 --- a/comfy/model_patcher.py +++ b/comfy/model_patcher.py @@ -360,11 +360,13 @@ class ModelPatcher(ModelManageable): if isinstance(v, list): v = (self.calculate_weight(v[1:], v[0].clone(), key),) - if len(v) == 1: - patch_type = "diff" - elif len(v) == 2: + patch_type = "diff" + if len(v) == 2: patch_type = v[0] v = v[1] + elif len(v) != 1: + logging.warning("patch {} not recognized: {}".format(key, v)) + continue if patch_type == "diff": w1 = v[0]