Skip to content

[WIP ] Add AnimateDiff SparseCntrl #6289

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

Closed
wants to merge 9 commits into from
Closed

[WIP ] Add AnimateDiff SparseCntrl #6289

wants to merge 9 commits into from

Conversation

DN6
Copy link
Collaborator

@DN6 DN6 commented Dec 22, 2023

What does this PR do?

Add AnimateDiff SparseCntrl model to diffusers
https://github.com/guoyww/AnimateDiff/tree/main?tab=readme-ov-file#202312-animatediff-v3-and-sparsectrl

TODO:

  • Convert checkpoints to diffusers format
  • Add sparse control pipeline and sparse controlnet model
  • Docs
  • Ensure outputs are equivalent for original model and diffusers version

Fixes # (issue)

Before submitting

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.

@HuggingFaceDocBuilderDev

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.

# skip loading position embeddings
adapter.load_state_dict(conv_state_dict, strict=False)
adapter.save_pretrained(args.output_path)
adapter.save_pretrained(args.output_path, variant="fp16")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For fp16 variant, we should also set the dtype to torch.float16. I don't see that being used. This issue persists here too: https://huggingface.co/guoyww/animatediff-motion-adapter-v1-5-2/tree/main.

Both the fp16 and non-fp16 variants have the same size which shouldn't be the case.

Am I missing out on anything?

@chuck-ma
Copy link

chuck-ma commented Jan 4, 2024

It seems that AnimateDiffSparseControlNetPipeline cannot be imported because nothing added in init.py.
Besides, the quality seems not good enough. The scribble control model does not effectively control the frames of the corresponding video based on the input controlnet image

@DN6 DN6 mentioned this pull request Jan 24, 2024
Copy link
Contributor

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.

Please note that issues that do not follow the contributing guidelines are likely to be ignored.

@github-actions github-actions bot added the stale Issues that haven't received updates label Jan 28, 2024
@sayakpaul
Copy link
Member

@DN6

Copy link
Contributor

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.

Please note that issues that do not follow the contributing guidelines are likely to be ignored.

@DN6 DN6 removed the stale Issues that haven't received updates label Feb 22, 2024
@a-r-r-o-w
Copy link
Member

@DN6 Hey, what's holding this from merge? Happy to help if there's anything I can look into

@yiyixuxu yiyixuxu added the video video generation label Mar 8, 2024
@DN6
Copy link
Collaborator Author

DN6 commented Mar 12, 2024

Hi @a-r-r-o-w sorry been a bit caught up with some other things. Feel free to take over this PR or open a new one if you prefer.

The SparseControlNet needs to be cleaned up and we need to verify that the outputs match the original models.

Copy link
Contributor

github-actions bot commented Apr 5, 2024

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.

Please note that issues that do not follow the contributing guidelines are likely to be ignored.

@github-actions github-actions bot added the stale Issues that haven't received updates label Apr 5, 2024
@DN6 DN6 removed the stale Issues that haven't received updates label Apr 8, 2024
Copy link
Contributor

github-actions bot commented May 2, 2024

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.

Please note that issues that do not follow the contributing guidelines are likely to be ignored.

@github-actions github-actions bot added the stale Issues that haven't received updates label May 2, 2024
@DN6 DN6 removed the stale Issues that haven't received updates label May 6, 2024
@eps696
Copy link

eps696 commented Jul 3, 2024

hello, is this WIP still in progress?
seems stuck for half a year, which is very sad, as this is a much wanted feature.

i've tried to employ it as is and got some working controlnet-related results, but it worked per-frame (as usual non-sparse controlnet), not affecting the motion. that is, "controlled" (indexed) frames reproduced controlnet inputs while the rest was generated as if there was no controlnet at all.
on my understanding it looked like the motion part of the model (some 3d blocks?) were not properly connected to the controlnet somehow, or i'm missing something..

UPD: another glue is that setting strict=True in the checkpoint conversion script brings some missing motion modules keys. I used the checkpoint from guoyww as a source.

@a-r-r-o-w
Copy link
Member

hello @eps696! we recently shipped SparseCtrl in #8897 and it will be part of the next release. apologies for the delay :) feel free to try it out and let us know if you find any bugs, thanks!

@DN6 this can be closed now, no?

@DN6
Copy link
Collaborator Author

DN6 commented Jul 29, 2024

Closing in favour of #8897

@DN6 DN6 closed this Jul 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
video video generation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants