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

Inference with LoRA weights #65

Open
trqminh opened this issue Oct 5, 2024 · 1 comment
Open

Inference with LoRA weights #65

trqminh opened this issue Oct 5, 2024 · 1 comment

Comments

@trqminh
Copy link

trqminh commented Oct 5, 2024

Hi @pixeli99 ,

Thank you for your great work! I am wondering if you have the script for inference with lora model. I am struggling with loading lora and run the trained lora models. It seems I cannot get the pipeline to run the lora part in inference, it just like I am running everything with the original pretrained model.

Thank you for your help!

@zzhang2816
Copy link

zzhang2816 commented Oct 28, 2024

Add these lines to inference code

if lora_folder != "":
   unet.load_attn_procs(lora_folder)
   unet.to(torch.float16)
   unet.requires_grad_(False)

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