peft icon indicating copy to clipboard operation
peft copied to clipboard

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

Open JIAOJIAYUASD opened this issue 1 year ago • 1 comments

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!

JIAOJIAYUASD avatar Apr 30 '24 07:04 JIAOJIAYUASD

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

BenjaminBossan avatar Apr 30 '24 09:04 BenjaminBossan

This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

github-actions[bot] avatar May 30 '24 15:05 github-actions[bot]