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

How to convert a loha safetensor trained from diffusers to webui format #1693

Open
JIAOJIAYUASD opened this issue Apr 30, 2024 · 1 comment

Comments

@JIAOJIAYUASD
Copy link

Hello, when I finetune SDXL (actually that is InstantID) with PEFT method, I use lora、loha and lokr for PEFT in diffuser.
I have a question, how to convert a loha safetensor trained from diffusers to webui format?
In the training process:
the loading way:
peft_config = LoHaConfig( r=args.rank, alpha=args.rank //2, target_modules=["to_k", "to_q", "to_v", "to_out.0"], )
unet = get_peft_model(unet, peft_config)
when train process finished, the saving way as:
unet.save_pretrained(args.output_dir)

and I get the safetensor as
image

But webui can't recognize it, I can't use it in webui.

How can I fix this promblem!

@BenjaminBossan
Copy link
Member

I don't have much experience with webui. Did you try running this script?

https://github.com/huggingface/peft/blob/main/examples/lora_dreambooth/convert_peft_sd_lora_to_kohya_ss.py

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