-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
[Big refactor] move unets to unets
module 🦋
#6630
Conversation
unets
module 🦋unets
module 🦋
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. |
The second one fails even on |
@@ -0,0 +1,3591 @@ | |||
# Copyright 2023 The HuggingFace Team. All rights reserved. |
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.
Why does this file only have 3591 lines but the original deleted unet_2d_blocks.py
file has 3635 lines?
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.
I see the exact same number here: https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/unet_2d_blocks.py
![image](https://private-user-images.githubusercontent.com/22957388/298019711-298a3f89-b2cc-412d-a6e2-385759f7a2d3.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk0NzMxODMsIm5iZiI6MTczOTQ3Mjg4MywicGF0aCI6Ii8yMjk1NzM4OC8yOTgwMTk3MTEtMjk4YTNmODktYjJjYy00MTJkLWE2ZTItMzg1NzU5ZjdhMmQzLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTMlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEzVDE4NTQ0M1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWE1ZDQwMDE3NWU5NjgzMjQ5NDA2MWRkNWZiMDUyMTU5ZTljNjE0NDY4OWU4Zjg2N2Q2N2VhZjhjN2JmZjgxOTgmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.TRhYNjwIrvMS6vT4TR1lJZ4FF8FtIW3SRv-zTArm5g4)
Am I missing something?
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.
Ok for me! Let's make sure that for import files such as unet_2d_condition.py
, unet_2d_blocks.py
, we keep the original file and import all classes of the moved files for backwards compatibility
Thanks, @patrickvonplaten. Added a couple classes in |
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.
Fine for me to merge. Failing pipeline test looks unrelated, think just rerunning the workflow should get it to pass.
I am going to merge this to avoid merge conflicts. |
* begin animatediff img2video and video2video * revert animatediff to original implementation * add img2video as pipeline * update * add vid2vid pipeline * update imports * update * remove copied from line for check_inputs * update * update examples * add multi-batch support * fix __init__.py files * move img2vid to community * update community readme and examples * fix * make fix-copies * add vid2vid batch params * apply suggestions from review Co-Authored-By: Dhruv Nair <[email protected]> * add test for animatediff vid2vid * torch.stack -> torch.cat Co-Authored-By: Dhruv Nair <[email protected]> * make style * docs for vid2vid * update * fix prepare_latents * fix docs * remove img2vid * update README to :main * remove slow test * refactor pipeline output * update docs * update docs * merge community readme from :main * final fix i promise * add support for url in animatediff example * update example * update callbacks to latest implementation * Update src/diffusers/pipelines/animatediff/pipeline_animatediff_video2video.py Co-authored-by: Patrick von Platen <[email protected]> * Update src/diffusers/pipelines/animatediff/pipeline_animatediff_video2video.py Co-authored-by: Patrick von Platen <[email protected]> * fix merge * Apply suggestions from code review * remove callback and callback_steps as suggested in review * Update tests/pipelines/animatediff/test_animatediff_video2video.py Co-authored-by: Patrick von Platen <[email protected]> * fix import error caused due to unet refactor in #6630 * fix numpy import error after tensor2vid refactor in #6626 * make fix-copies * fix numpy error * fix progress bar test --------- Co-authored-by: Dhruv Nair <[email protected]> Co-authored-by: Patrick von Platen <[email protected]>
* move unets to module 🦋 * parameterize unet-level import. * fix flax unet2dcondition model import * models __init__ * mildly depcrecating models.unet_2d_blocks in favor of models.unets.unet_2d_blocks. * noqa * correct depcrecation behaviour * inherit from the actual classes. * Empty-Commit * backwards compatibility for unet_2d.py * backward compatibility for unet_2d_condition * bc for unet_1d * bc for unet_1d_blocks
* begin animatediff img2video and video2video * revert animatediff to original implementation * add img2video as pipeline * update * add vid2vid pipeline * update imports * update * remove copied from line for check_inputs * update * update examples * add multi-batch support * fix __init__.py files * move img2vid to community * update community readme and examples * fix * make fix-copies * add vid2vid batch params * apply suggestions from review Co-Authored-By: Dhruv Nair <[email protected]> * add test for animatediff vid2vid * torch.stack -> torch.cat Co-Authored-By: Dhruv Nair <[email protected]> * make style * docs for vid2vid * update * fix prepare_latents * fix docs * remove img2vid * update README to :main * remove slow test * refactor pipeline output * update docs * update docs * merge community readme from :main * final fix i promise * add support for url in animatediff example * update example * update callbacks to latest implementation * Update src/diffusers/pipelines/animatediff/pipeline_animatediff_video2video.py Co-authored-by: Patrick von Platen <[email protected]> * Update src/diffusers/pipelines/animatediff/pipeline_animatediff_video2video.py Co-authored-by: Patrick von Platen <[email protected]> * fix merge * Apply suggestions from code review * remove callback and callback_steps as suggested in review * Update tests/pipelines/animatediff/test_animatediff_video2video.py Co-authored-by: Patrick von Platen <[email protected]> * fix import error caused due to unet refactor in huggingface#6630 * fix numpy import error after tensor2vid refactor in huggingface#6626 * make fix-copies * fix numpy error * fix progress bar test --------- Co-authored-by: Dhruv Nair <[email protected]> Co-authored-by: Patrick von Platen <[email protected]>
What does this PR do?
As discussed internally, we would like to move the UNet related stuff to their dedicated module
unets
just like we did withautoencoders
.Note to reviewers: It's a big refactor. So, please take your time in reviewing it. But sooner we're able to merge this, lesser the number of merge conflicts we'll run into.