From 3e0033ef30a111076af54a7a4e6b470cdc570886 Mon Sep 17 00:00:00 2001 From: comfyanonymous Date: Fri, 10 Nov 2023 03:19:05 -0500 Subject: [PATCH] Fix model merge bug. Unload models before getting weights for model patching. --- comfy/model_patcher.py | 1 + 1 file changed, 1 insertion(+) diff --git a/comfy/model_patcher.py b/comfy/model_patcher.py index 55800e86ea4..ef18d1b2342 100644 --- a/comfy/model_patcher.py +++ b/comfy/model_patcher.py @@ -134,6 +134,7 @@ def add_patches(self, patches, strength_patch=1.0, strength_model=1.0): return list(p) def get_key_patches(self, filter_prefix=None): + comfy.model_management.unload_model_clones(self) model_sd = self.model_state_dict() p = {} for k in model_sd: