From b72a7a835a5b20375f0f6760451ca0c79db8413a Mon Sep 17 00:00:00 2001 From: comfyanonymous Date: Mon, 26 Jun 2023 02:56:11 -0400 Subject: [PATCH] Support loras based on the stability unet implementation. --- comfy/sd.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/comfy/sd.py b/comfy/sd.py index 3f36b8c..dbfbdbe 100644 --- a/comfy/sd.py +++ b/comfy/sd.py @@ -285,6 +285,11 @@ def model_lora_keys(model, key_map={}): if key_in: counter += 1 + for k in sdk: + if k.startswith("diffusion_model.") and k.endswith(".weight"): + key_lora = k[len("diffusion_model."):-len(".weight")].replace(".", "_") + key_map["lora_unet_{}".format(key_lora)] = k + return key_map