DiffSynth-Studio icon indicating copy to clipboard operation
DiffSynth-Studio copied to clipboard

Issues regarding the compatibility of flux lora

Open tayton42 opened this issue 10 months ago • 4 comments

Thank you very much for sharing the eligen lora at https://www.modelscope.cn/models/DiffSynth-Studio/Eligen, but I encountered a dict mismatch issue when trying to apply it to the original flux https://github.com/black-forest-labs/flux/blob/main/src/flux/model.py. How can I convert it to a format that can be used with the original flux?

tayton42 avatar Mar 24 '25 07:03 tayton42

Thank you for your attention to EliGen. EliGen is a LoRA trained based on Flux. You can refer to entity_control.py for usage. Maybe you can also provide the code you are using, and we will assist in analyzing the cause of any issues.

mi804 avatar Mar 24 '25 11:03 mi804

Thank you for your attention to EliGen. EliGen is a LoRA trained based on Flux. You can refer to entity_control.py for usage. Maybe you can also provide the code you are using, and we will assist in analyzing the cause of any issues.

Thanks for your reply! Actually, I'm trying to apply eligen to this project https://github.com/Xilluill/KV-Edit/blob/main/flux/model.py, and the structure of this project’s code is similar to the black-forest flux code https://github.com/black-forest-labs/flux/blob/main/src/flux/model.py, but I don't know how to load eligen lora in the original black-forest code. Can you give me some advice? Thanks a lot!

tayton42 avatar Mar 24 '25 14:03 tayton42

There exists a state_dict keyword mapping bewteen black-forest flux code and our code, which is defined here. And keywords in EliGen LoRA is got by here. You may take these codes for reference.

mi804 avatar Mar 25 '25 02:03 mi804

There exists a state_dict keyword mapping bewteen black-forest flux code and our code, which is defined here. And keywords in EliGen LoRA is got by here. You may take these codes for reference.

Thanks for your reply. I still have one more question, the layer trained by Lora here is the same as this in diffusers like here?

lanson07 avatar Mar 26 '25 01:03 lanson07

I also encountered the same problem, did you solve it?

YYH-oss avatar Jul 10 '25 08:07 YYH-oss