fix text encoder LoRAs

This commit is contained in:
Pierre Chapuis 2023-09-04 14:38:03 +02:00
parent ebfa51f662
commit 566656a539

View file

@ -100,7 +100,7 @@ class SD1LoraAdapter(fl.Chain, Adapter[StableDiffusion_1]):
for model_name in MODELS: for model_name in MODELS:
if not (model_targets := sub_targets.get(model_name, [])): if not (model_targets := sub_targets.get(model_name, [])):
continue continue
model = getattr(target, model_name) model = getattr(target, "clip_text_encoder" if model_name == "text_encoder" else model_name)
if model.find(SingleLoraAdapter): if model.find(SingleLoraAdapter):
raise NotImplementedError(f"{model} already contains LoRA layers") raise NotImplementedError(f"{model} already contains LoRA layers")