Patch del self.loaded_lora to prevent error with persistent lora_name swapping

This commit is contained in:
ComfyUI-Community 2023-07-15 17:11:12 -07:00 committed by GitHub
parent 490771b7f4
commit a8f3bbc35d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -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)