From ec120001363271ca039c8e07dabd8837df6498cd Mon Sep 17 00:00:00 2001 From: comfyanonymous Date: Wed, 8 Nov 2023 22:05:31 -0500 Subject: [PATCH 1/2] Add support for full diff lora keys. --- comfy/lora.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/comfy/lora.py b/comfy/lora.py index d4cf94c95..29c59d893 100644 --- a/comfy/lora.py +++ b/comfy/lora.py @@ -131,6 +131,18 @@ def load_lora(lora, to_load): loaded_keys.add(b_norm_name) patch_dict["{}.bias".format(to_load[x][:-len(".weight")])] = (b_norm,) + diff_name = "{}.diff".format(x) + diff_weight = lora.get(diff_name, None) + if diff_weight is not None: + patch_dict[to_load[x]] = (diff_weight,) + loaded_keys.add(diff_name) + + diff_bias_name = "{}.diff_b".format(x) + diff_bias = lora.get(diff_bias_name, None) + if diff_bias is not None: + patch_dict["{}.bias".format(to_load[x][:-len(".weight")])] = (diff_bias,) + loaded_keys.add(diff_bias_name) + for x in lora.keys(): if x not in loaded_keys: print("lora key not loaded", x) From cd6df8b323d4d7d32730f4460f76795dd9b8ca60 Mon Sep 17 00:00:00 2001 From: comfyanonymous Date: Thu, 9 Nov 2023 13:10:19 -0500 Subject: [PATCH 2/2] Fix sanitize node name removing the "/" character. --- web/scripts/app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/scripts/app.js b/web/scripts/app.js index 638afd56c..50e205222 100644 --- a/web/scripts/app.js +++ b/web/scripts/app.js @@ -16,7 +16,7 @@ function sanitizeNodeName(string) { '`': '', '=': '' }; - return String(string).replace(/[&<>"'`=\/]/g, function fromEntityMap (s) { + return String(string).replace(/[&<>"'`=]/g, function fromEntityMap (s) { return entityMap[s]; }); }