From 7da6120b39c05a5cd43d6d8a8623fe1002b93d7a Mon Sep 17 00:00:00 2001 From: Sergey Borisov Date: Tue, 6 Aug 2024 04:16:21 +0300 Subject: [PATCH] Fix LoKR refactor bug --- invokeai/backend/lora.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/invokeai/backend/lora.py b/invokeai/backend/lora.py index cec76ffea2..11e1764a0a 100644 --- a/invokeai/backend/lora.py +++ b/invokeai/backend/lora.py @@ -218,13 +218,19 @@ class LoKRLayer(LoRALayerBase): self.w1 = values.get("lokr_w1", None) if self.w1 is None: - self.w1_a = values["lokr_w1_a"] - self.w1_b = values["lokr_w1_b"] + self.w1_a = values.get("lokr_w1_a", None) + self.w1_b = values.get("lokr_w1_b", None) + else: + self.w1_b = None + self.w1_a = None self.w2 = values.get("lokr_w2", None) if self.w2 is None: self.w2_a = values["lokr_w2_a"] self.w2_b = values["lokr_w2_b"] + else: + self.w2_a = None + self.w2_b = None self.t2 = values.get("lokr_t2", None)