From ef50c4023ea424f24690865273c7d1c5ff47ea08 Mon Sep 17 00:00:00 2001 From: Won-Kyu Park Date: Fri, 29 Dec 2023 06:06:24 +0900 Subject: [PATCH] fix another bug found at #95 * simple check acceptable keys in the partial update routine --- scripts/model_mixer.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/model_mixer.py b/scripts/model_mixer.py index 8eeb707..f0d96d9 100644 --- a/scripts/model_mixer.py +++ b/scripts/model_mixer.py @@ -3681,7 +3681,8 @@ def fake_checkpoint(checkpoint_info, metadata, model_name, sha256, fake=True): for k in weight_changed[prefix]: # remove prefix, 'cond_stage_model.' or 'conditioner.' will be removed key = k[len(prefix):] - base_dict[key] = theta_0[k] + if k in theta_0: + base_dict[key] = theta_0[k] if isxl: shared.sd_model.conditioner.load_state_dict(base_dict, strict=False) else: