Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

inpaint是否能使用lora #460

Open
guzichen opened this issue Mar 12, 2024 · 1 comment
Open

inpaint是否能使用lora #460

guzichen opened this issue Mar 12, 2024 · 1 comment
Assignees

Comments

@guzichen
Copy link

在Inpait中使用lora报错
pipe = StableDiffusionInpaintPipeline.from_pretrained("runwayml/stable-diffusion-v1-5", safety_checker=None)
pipe.load_lora_weights("./",weight_name="lora.safetensors",from_diffusers=True)
pipe.fuse_lora()

错误信息:
'StableDiffusionInpaintPipeline' object has no attribute 'fuse_lora'

如何在inpaint中使用lora?

软件版本:
paddle 2.5.2
ppdiffusers 0.19.4

@JunnYu
Copy link
Member

JunnYu commented Mar 12, 2024

0.19.4版本中不包含 fuse_lora 这个接口,现在的develop分支需要配合 USE_PEFT_BACKEND = True的环境变量才可以使用。

# 设置环境变量 USE_PEFT_BACKEND
import os
os.environ["USE_PEFT_BACKEND"] = "True"
from ppdiffusers import StableDiffusionInpaintPipeline

pipe = StableDiffusionInpaintPipeline.from_pretrained("runwayml/stable-diffusion-v1-5", safety_checker=None)
pipe.load_lora_weights("./",weight_name="lora.safetensors",from_diffusers=True)
pipe.fuse_lora()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants