Uh oh!
There was an error while loading. Please reload this page.
Add EasyAnimateV5.1 text-to-video, image-to-video, control-to-video generation model - #10626
Conversation
a-r-r-o-w
left a comment
There was a problem hiding this comment.
Thank you for the PR @bubbliiiing! This is in great shape and already mostly in the implementation style used in diffusers 🤗
I've left some comments from a quick look through the PR. Happy to help make any of the required changes to help bring the PR to completion
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
| encoder_hidden_states: torch.Tensor, | ||
| attention_mask: Optional[torch.Tensor] = None, | ||
| image_rotary_emb: Optional[torch.Tensor] = None, | ||
| attn2: Attention = None, |
There was a problem hiding this comment.
This seems similar to Flux/SD3/HunyuanVideo's Joint-attention processors that concatenate the visual and text tokens. Let's do it the same way as done here:
There was a problem hiding this comment.
There are two things we could do here:
- Either convert the state dict of the original-format models (that you currently have on the HuggingFace Hub) and update them to diffusers-format (which would make
attn2.to_q -> add_q_proj,attn2.to_k -> add_k_proj,attn2.to_v -> add_v_proj - Create a custom attention class similar to
AttentionandMochiAttentionin which you are free to use layer naming of your choice (so basically keeping the sameto_q,to_kandto_v.
The first approach is more closely aligned with diffusers code style but would require you to update multiple checkpoints -- but we are transitioning to a single file modeling format, so if you choose to go with second approach for convenience, that works for us as well. Essentially, irrespective of the design you choose, we need to make sure:
- When the forward of a layer is called, it only takes tensors as input and produces tensors as output.
- Taking intermediate layers as input to forward, or making calls to other layers out-of-order randomly, is not supported by our design style of different current/upcoming features
cc @DN6 here in case you have thoughts about the single file format and model-specific Attention classes
There was a problem hiding this comment.
I moved attn2 to the processor's init; does this meet the requirements?
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
| for name, module in self.named_children(): | ||
| _set_3dgroupnorm_for_submodule(name, module) | ||
| def single_forward(self, x: torch.Tensor) -> torch.Tensor: |
There was a problem hiding this comment.
This is very different from diffusers-style implementation of encoder/decoder. Could we follow the style as done in:
There was a problem hiding this comment.
Sorry, does this mean that I cannot use functions like set_padding_one_frame?
There was a problem hiding this comment.
Do I need to use this conv_cache in autoencoder_kl_mochi?
There was a problem hiding this comment.
In the model implementations, we usually only try to keep (atleast in the latest model integrations):
- Submodel initializations
- Forward method
So, unless a helper function like set_padding_one_frame is used in multiple locations, I would suggest directly substituting its code in the forward implementation. If a helper function is required, let's make it a private function by prefixing the function name with an underscore
The conv_cache saves a few computations when running the VAE encode/decode process from repeated frames that are used as padding. As such, it is not required to implement it if it is not needed for framewise encoding and decoding.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
bubbliiiing
commented
Jan 23, 2025
Sorry for not standardizing some parts; I will make the necessary modifications. Also, I would like to ask if I need to add test files in |
a-r-r-o-w
commented
Jan 23, 2025
Yes, we will need a test for all three pipelines as well as model tests in Also, congratulations on the release! I tried out the original repository example and the model is very good! 🎉 |
a-r-r-o-w
commented
Feb 6, 2025
Thank you so much for addressing the reviews @bubbliiiing! The PR is almost ready to merge IMO. There are just a few more small changes to make to align to our model implementation design. Is it okay if I quickly push some last changes to this branch directly? |
bubbliiiing
commented
Feb 6, 2025
Of course, thank you very much for your help. |
nitinmukesh
commented
Feb 10, 2025
For some reason this isn't working anymore, it was working earlier. :( It just crashes |
bubbliiiing
commented
Feb 11, 2025
Thank you for your feedback, I'll give it a try. |
bubbliiiing
commented
Feb 11, 2025
|
nitinmukesh
commented
Feb 12, 2025
@bubbliiiing Sorry for the trouble. |
nitinmukesh
commented
Feb 12, 2025
20250212_154949_370380_easyanimate51_bnb.mp4A little white rabbit with glasses was sitting on a chair in a cafe reading a newspaper. There was a cup of hot coffee on the table. Nice output. Please add support of pipeline.enable_sequential_cpu_offload(). |
a-r-r-o-w
commented
Feb 12, 2025
@nitinmukesh |
bubbliiiing
commented
Feb 12, 2025
nitinmukesh
commented
Feb 12, 2025
Exactly this is the error I'm getting. |
a-r-r-o-w
commented
Feb 12, 2025
cc @SunMarc here for sequential cpu offload related issues in Qwen2VL |
No need to aplogize, you guys are doing very good. I'm not in hurry ()maybe excited to see all the development happening) just trying all the features that are being added and posting my feedback. I want to see this library grow as it's very easy to use. |
nitinmukesh
commented
Feb 12, 2025
Here is the code to reproduce the error [pipeline.enable_model_cpu_offload() works fine] and log Log 1: #10626 (comment) Log 2: |
bubbliiiing
commented
Feb 25, 2025
Sure, I'll do my best to make the necessary fixes. If there are any parts I haven't covered, please let me know and I'll be happy to help with the modifications. Thank you! |
bubbliiiing
commented
Feb 25, 2025
I have fixed some issues. Please take another look when you have time. |
There was a problem hiding this comment.
Thanks @bubbliiiing, the latest changes are great! @yiyixuxu Could you give this a look?
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
HuggingFaceDocBuilderDev
commented
Feb 27, 2025
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. |
yiyixuxu
commented
Feb 28, 2025
we have some tests are still failing though, |



What does this PR do?
This PR converts the EasyAnimateV5.1 model into a diffuser-supported inference model, including three complete pipelines and corresponding modules.
Before submitting
documentation guidelines, and
here are tips on formatting docstrings.
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.
@a-r-r-o-w