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

convert_lora.py fails on Lycoris LoKr #68

Open
Enyakk opened this issue Jan 30, 2025 · 2 comments
Open

convert_lora.py fails on Lycoris LoKr #68

Enyakk opened this issue Jan 30, 2025 · 2 comments

Comments

@Enyakk
Copy link

Enyakk commented Jan 30, 2025

The inclusion of Lycoris support via the following PRs worked great and greatly expands the possible training options. Lycoris LoKr also works perfectly when training, sampling and generating videos via musubi repository.

However convert_lora.py does not recognize the lokr-specific keys produced. This results in an empty .safetensors when trying to convert a training LoKr .safetensors.

This produces warnings as such:
WARNING:__main__:unexpected key: lora_unet_double_blocks_0_img_attn_proj.lokr_w1 in default LoRA format WARNING:__main__:unexpected key: lora_unet_double_blocks_0_img_attn_proj.lokr_w2 in default LoRA format WARNING:__main__:unexpected key: lora_unet_double_blocks_0_img_attn_qkv.lokr_w1 in default LoRA format WARNING:__main__:unexpected key: lora_unet_double_blocks_0_img_attn_qkv.lokr_w2 in default LoRA format WARNING:__main__:unexpected key: lora_unet_double_blocks_0_img_mlp_fc1.lokr_w1 in default LoRA format WARNING:__main__:unexpected key: lora_unet_double_blocks_0_img_mlp_fc1.lokr_w2 in default LoRA format WARNING:__main__:unexpected key: lora_unet_double_blocks_0_img_mlp_fc2.lokr_w1 in default LoRA format WARNING:__main__:unexpected key: lora_unet_double_blocks_0_img_mlp_fc2.lokr_w2 in default LoRA format

To train Lycoris LoKr the following lines have been used:

network_module="lycoris.kohya"
network_dim = 100000
network_alpha = 1
network_args = [ "preset=attn-mlp", "algo=lokr", "factor=140", ]

Attachements:

  • convert_lora.py log
  • training config + minimal LokR safetensors (ZIP)

convert_lora.log
test_lokr.zip

@sdbds
Copy link
Contributor

sdbds commented Jan 31, 2025

To be honest, I think ComfYUI should use the default Lycoris Key, because this is the official format of Lycoris.

@Enyakk
Copy link
Author

Enyakk commented Jan 31, 2025

Well, I could raise the issue on the ComfyUI github if that makes sense.

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