From a8f3bbc35d34a8631b47be46d6e66d2beeda56b1 Mon Sep 17 00:00:00 2001 From: ComfyUI-Community <138906221+ComfyUI-Community@users.noreply.github.com> Date: Sat, 15 Jul 2023 17:11:12 -0700 Subject: [PATCH] Patch del self.loaded_lora to prevent error with persistent lora_name swapping --- nodes.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/nodes.py b/nodes.py index 32bcf141..a1c4b843 100644 --- a/nodes.py +++ b/nodes.py @@ -497,7 +497,9 @@ class LoraLoader: if self.loaded_lora[0] == lora_path: lora = self.loaded_lora[1] else: - del self.loaded_lora + temp = self.loaded_lora + self.loaded_lora = None + del temp if lora is None: lora = comfy.utils.load_torch_file(lora_path, safe_load=True)