-
Notifications
You must be signed in to change notification settings - Fork 2k
Closed
Description
Hi, I have followed the guidance https://huggingface.co/docs/diffusers/using-diffusers/merge_loras here,
pipeline = AutoPipelineForText2Image.from_pretrained(
source_pipeline_path,
vae=vae,
# variant="fp16",
torch_dtype=torch.float16
).to("cuda")
pipeline.to(device, torch.float16)
print("Load unet lora")
pipeline.unet = PeftModel.from_pretrained(pipeline.unet, os.path.join(lora_path, "unet"), adapter_name="unet")
print(type(pipeline.unet)) # output: PeftModel
pipeline.unet.add_weighted_adapter(["unet"], weights=[lora_scale])
pipeline.unet.merge_and_unload()
pipeline.unet.to(device, dtype=torch.float16)
When calling pipeline.unet.add_weighted_adapter(["unet"], weights=[lora_scale])
, the following error was encountered
UNet2DConditionModel has no 'add_weighted_adapter'
Not only the unet but also the two text_encoders.
My expectation is to set the lora scale of these components. Thanks!
diffusers 0.32.2
peft 0.15.2
Metadata
Metadata
Assignees
Labels
No labels