From 566656a539242048cf2d4f8e7b7f926365ef1ba2 Mon Sep 17 00:00:00 2001 From: Pierre Chapuis Date: Mon, 4 Sep 2023 14:38:03 +0200 Subject: [PATCH] fix text encoder LoRAs --- src/refiners/foundationals/latent_diffusion/lora.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/refiners/foundationals/latent_diffusion/lora.py b/src/refiners/foundationals/latent_diffusion/lora.py index bfde4aa..48bb7f3 100644 --- a/src/refiners/foundationals/latent_diffusion/lora.py +++ b/src/refiners/foundationals/latent_diffusion/lora.py @@ -100,7 +100,7 @@ class SD1LoraAdapter(fl.Chain, Adapter[StableDiffusion_1]): for model_name in MODELS: if not (model_targets := sub_targets.get(model_name, [])): continue - model = getattr(target, model_name) + model = getattr(target, "clip_text_encoder" if model_name == "text_encoder" else model_name) if model.find(SingleLoraAdapter): raise NotImplementedError(f"{model} already contains LoRA layers")