-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
[LoRA] Support HunyuanVideo #10254
[LoRA] Support HunyuanVideo #10254
Conversation
@SHYuanBest We're actually already working on this at https://github.com/a-r-r-o-w/cogvideox-factory. Diffusers format training scripts for video models will be hosted there, and we're working on exposing a Trainer API to make finetuning more accessible. If you're interested in that, we'd love contributions! At the moment, I'm not sure if we will be able to merge but I'll let @sayakpaul make the call. Thank you so much for working on this though! It's very cool. Maybe we can set up a collaboration channel with you on our internal Slack to work on research projects together if that's something of interest |
That's great. Happy to help for |
Perhaps, we could just keep the LoRA related changes and honor your contributions in this PR? Once that is done (should be quick) we can continue your contributions in the https://github.com/a-r-r-o-w/cogvideox-factory repo. WDYT? @a-r-r-o-w thoughts? |
Yes, the lora loading related changes look good to me and we can add that here. Since you already have a working script, we could definitely honor the contributions wherever necessary. @sayakpaul Could you set up the channel on Slack? He's also the creator of ConsisID for CogVideoX, which is very cool and something we could explore on Hunyuan too, among other ideas |
Of course! Please let me know about your email id @SHYuanBest and your collaborators (if you want) and I will proceed. |
That's great. I have send a email to you, happy to help for the community. |
Just replied to your email. Meanwhile, could you please update the PR to only include the LoRA level changes and we can quickly review and merge. Cc: @a-r-r-o-w |
got it. i will update the code later. |
I have update the PR to only include the LoRA level changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks awesome, thanks much!
Let's add a test too? Should be similar to https://github.com/huggingface/diffusers/blob/main/tests/lora/test_lora_layers_mochi.py.
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
I have add a test, but there is a
|
I have passed or skipped all items.
|
@SHYuanBest thanks, but I think we will need to resolve the conflicts first. And then I will let @a-r-r-o-w take care of the final merge. Thanks once again for your patience. |
solved |
@SHYuanBest Thank you for working on this! In the latest commit, I've made the following changes:
@sayakpaul I've also updated some logic of the tests to enable subfolder's to be specified when loading from a HF repo. Could you give it a look? cc @yiyixuxu too for the lora test changes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
subfolder
related changes look good to me, thanks!
Sounds good! Will merge this once I get a good training run finished. Should be hopefully in about 5-6 hours. |
Failing tests are unrelated so merging. LoRA training for HunyuanVideo available here: a-r-r-o-w/finetrainers#126. More memory optimizations are on the way! Currently requires about 50 GB for 49x512x768. @SHYuanBest Thank you for working on this! We'll be sure to mention your contribution and hard work into making this work in the README |
@a-r-r-o-w So cool the training script for HunyuanVideo. And It is my pleasure to contribute to the community. |
* 1217 * 1217 * 1217 * update * reverse * add test * update test * make style * update * make style --------- Co-authored-by: Aryan <aryan@huggingface.co>
* 1217 * 1217 * 1217 * update * reverse * add test * update test * make style * update * make style --------- Co-authored-by: Aryan <aryan@huggingface.co>
Hi, where can I find the train.py file? |
@yardenfren1996 We've added support for hunyuan lora training here: https://github.com/a-r-r-o-w/finetrainers. There's a folder specific to hunyuan and all the relevant code for training is in |
What does this PR do?
Finetuning script on-the-way.
enable gradient_checkpointing
.To run training, use:
Who can review?
Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.