fix detection of unet-only LoRAs

This commit is contained in:
Pierre Chapuis 2024-01-26 17:02:28 +01:00
parent ce0339b4cc
commit ce22c8f51b

View file

@ -44,8 +44,8 @@ class SDLoraManager:
loras = {key: loras[key] for key in sorted(loras.keys(), key=SDLoraManager.sort_keys)} loras = {key: loras[key] for key in sorted(loras.keys(), key=SDLoraManager.sort_keys)}
# if no key contains "unet" or "text", assume all keys are for the unet # if no key contains "unet" or "text", assume all keys are for the unet
if not "unet" in loras and not "text" in loras: if all(["unet" not in key and "text" not in key for key in loras.keys()]):
loras = {f"unet_{key}": loras[key] for key in loras.keys()} loras = {f"unet_{key}": value for key, value in loras.items()}
self.add_loras_to_unet(loras) self.add_loras_to_unet(loras)
self.add_loras_to_text_encoder(loras) self.add_loras_to_text_encoder(loras)