-
Notifications
You must be signed in to change notification settings - Fork 6.1k
[SDXL and IP2P]: instruction pix2pix XL training and pipeline #4079
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
Conversation
The documentation is not available anymore as the PR was closed or merged. |
Bugs observed. Fixing now. |
Hey what bugs did you observe? I was working on the same thing, maybe I can help. |
Now bugs have been fixed. Reasonable images can be generated. Working on cleaning up code now. |
Did you take an SDXL training pipeline as base? Or what did you start with? |
I modified the original instruct pix2pix training pipeline to be compatible with SDXL. You may refer to the code. |
…e#3996) * community pipeline: implementation of iadb * iadb.py: reformat using black * iadb.py: linting update
Hi @sayakpaul and @patrickvonplaten, I have addressed the code review. Once I have run more experiments, I will give more detailed documentation on training IP2P with SDXL. I will become very busy starting this week, since the semester has started and I need to teach and supervise students. If possible, can we merge this PR? If we have more interesting thoughts, we can address them in the future when I am not so busy. |
Having some good results documented (like the one you presented on interior design), preferably with the trained checkpoints, will be very beneficial to the community. Maybe we could simply write something like WIP on the corresponding pages. @patrickvonplaten WDYT? |
Sure, we can do this in another PR, maybe this weekend. Let's please complete this one now. |
Ok for me! |
@patrickvonplaten Can you merge the code? I believe this one is self-contained :-) |
If ok for @sayakpaul let's merge it :-) |
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.
Let's merge. I think it's safe to revisit some stuff (documentation, examples, etc.) later. At least with the PR, we can enable the community.
@harutatsuakiyama I took the liberty of adding mentions of SDXL InstructPix2Pix from the REAMDEs and also applied @patrickvonplaten's suggestions. Will merge after the CI is green :) |
Thanks for your contribution! |
It's really great, but I follow the training script in reademe, the loss can't converge well, so I wonder if you can share ckpt? |
Will give more details on weekends. You will need to increase the batch size to be 4, which will improve performance. Also, be patient. I found loss may oscillate, but generated results are good. If you have QQ, you can add me: 290956355. We can discuss more. |
Nice |
…gface#4079) * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * [Community] Implementation of the IADB community pipeline (huggingface#3996) * community pipeline: implementation of iadb * iadb.py: reformat using black * iadb.py: linting update * add kandinsky to readme table (huggingface#4081) Co-authored-by: yiyixuxu <yixu310@gmail,com> * [From Single File] Force accelerate to be installed (huggingface#4078) force accelerate to be installed * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Clean up IP2P SDXL code * Clean up IP2P SDXL code * [IP2P and SDXL] clean up code * [IP2P and SDXL] clean up code * [IP2P and SDXL] clean up code * [IP2P SDXL] Address code reviews * [IP2P SDXL] Address code reviews, add docs, tests * [IP2P SDXL] Address code reviews, add docs, tests * [IP2P SDXL] Address code reviews, add docs, tests * [IP2P SDXL] Address code reviews, add docs, tests * [IP2P SDXL] Address code reviews, add docs, tests * [IP2P SDXL] Address code reviews, add docs, tests * [IP2P SDXL] Address code reviews, add docs, tests * [IP2P SDXL] Address code reviews, add docs, tests * [IP2P SDXL] Address code reviews, add docs, tests * [IP2P SDXL] Address code reviews, add docs, tests * [IP2P SDXL] Address code reviews, add docs, tests * [IP2P SDXL] Address code reviews, add docs, tests * [IP2P SDXL] Address code reviews * [IP2P SDXL] Address code reviews * [IP2P SDXL] Add README_SDXL * [IP2P SDXL] Address code reviews * [IP2P SDXL] Address code reviews * [IP2P SDXL] Fix the copy problems * [IP2P SDXL] Add license * [IP2P SDXL] Add license * [IP2P SDXL] Add license * [IP2P SDXL] Address code reivew for selecting VAE andd others * [IP2P SDXL] Update README_sdxl * [IP2P SDXL] Update __init__ * [IP2P SDXL] Update dummy_torch_and_transformers_and_invisible_watermark_objects * address patrick's comments and some additions to readmes. --------- Co-authored-by: Harutatsu Akiyama <[email protected]> Co-authored-by: Thomas Chambon <[email protected]> Co-authored-by: YiYi Xu <[email protected]> Co-authored-by: yiyixuxu <yixu310@gmail,com> Co-authored-by: Patrick von Platen <[email protected]> Co-authored-by: Sayak Paul <[email protected]>
…gface#4079) * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * [Community] Implementation of the IADB community pipeline (huggingface#3996) * community pipeline: implementation of iadb * iadb.py: reformat using black * iadb.py: linting update * add kandinsky to readme table (huggingface#4081) Co-authored-by: yiyixuxu <yixu310@gmail,com> * [From Single File] Force accelerate to be installed (huggingface#4078) force accelerate to be installed * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Clean up IP2P SDXL code * Clean up IP2P SDXL code * [IP2P and SDXL] clean up code * [IP2P and SDXL] clean up code * [IP2P and SDXL] clean up code * [IP2P SDXL] Address code reviews * [IP2P SDXL] Address code reviews, add docs, tests * [IP2P SDXL] Address code reviews, add docs, tests * [IP2P SDXL] Address code reviews, add docs, tests * [IP2P SDXL] Address code reviews, add docs, tests * [IP2P SDXL] Address code reviews, add docs, tests * [IP2P SDXL] Address code reviews, add docs, tests * [IP2P SDXL] Address code reviews, add docs, tests * [IP2P SDXL] Address code reviews, add docs, tests * [IP2P SDXL] Address code reviews, add docs, tests * [IP2P SDXL] Address code reviews, add docs, tests * [IP2P SDXL] Address code reviews, add docs, tests * [IP2P SDXL] Address code reviews, add docs, tests * [IP2P SDXL] Address code reviews * [IP2P SDXL] Address code reviews * [IP2P SDXL] Add README_SDXL * [IP2P SDXL] Address code reviews * [IP2P SDXL] Address code reviews * [IP2P SDXL] Fix the copy problems * [IP2P SDXL] Add license * [IP2P SDXL] Add license * [IP2P SDXL] Add license * [IP2P SDXL] Address code reivew for selecting VAE andd others * [IP2P SDXL] Update README_sdxl * [IP2P SDXL] Update __init__ * [IP2P SDXL] Update dummy_torch_and_transformers_and_invisible_watermark_objects * address patrick's comments and some additions to readmes. --------- Co-authored-by: Harutatsu Akiyama <[email protected]> Co-authored-by: Thomas Chambon <[email protected]> Co-authored-by: YiYi Xu <[email protected]> Co-authored-by: yiyixuxu <yixu310@gmail,com> Co-authored-by: Patrick von Platen <[email protected]> Co-authored-by: Sayak Paul <[email protected]>
…gface#4079) * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * [Community] Implementation of the IADB community pipeline (huggingface#3996) * community pipeline: implementation of iadb * iadb.py: reformat using black * iadb.py: linting update * add kandinsky to readme table (huggingface#4081) Co-authored-by: yiyixuxu <yixu310@gmail,com> * [From Single File] Force accelerate to be installed (huggingface#4078) force accelerate to be installed * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Clean up IP2P SDXL code * Clean up IP2P SDXL code * [IP2P and SDXL] clean up code * [IP2P and SDXL] clean up code * [IP2P and SDXL] clean up code * [IP2P SDXL] Address code reviews * [IP2P SDXL] Address code reviews, add docs, tests * [IP2P SDXL] Address code reviews, add docs, tests * [IP2P SDXL] Address code reviews, add docs, tests * [IP2P SDXL] Address code reviews, add docs, tests * [IP2P SDXL] Address code reviews, add docs, tests * [IP2P SDXL] Address code reviews, add docs, tests * [IP2P SDXL] Address code reviews, add docs, tests * [IP2P SDXL] Address code reviews, add docs, tests * [IP2P SDXL] Address code reviews, add docs, tests * [IP2P SDXL] Address code reviews, add docs, tests * [IP2P SDXL] Address code reviews, add docs, tests * [IP2P SDXL] Address code reviews, add docs, tests * [IP2P SDXL] Address code reviews * [IP2P SDXL] Address code reviews * [IP2P SDXL] Add README_SDXL * [IP2P SDXL] Address code reviews * [IP2P SDXL] Address code reviews * [IP2P SDXL] Fix the copy problems * [IP2P SDXL] Add license * [IP2P SDXL] Add license * [IP2P SDXL] Add license * [IP2P SDXL] Address code reivew for selecting VAE andd others * [IP2P SDXL] Update README_sdxl * [IP2P SDXL] Update __init__ * [IP2P SDXL] Update dummy_torch_and_transformers_and_invisible_watermark_objects * address patrick's comments and some additions to readmes. --------- Co-authored-by: Harutatsu Akiyama <[email protected]> Co-authored-by: Thomas Chambon <[email protected]> Co-authored-by: YiYi Xu <[email protected]> Co-authored-by: yiyixuxu <yixu310@gmail,com> Co-authored-by: Patrick von Platen <[email protected]> Co-authored-by: Sayak Paul <[email protected]>
thanks to your great work @harutatsuakiyama i created a great extension for SimpleTuner, for general fine-tuning. you might find some improvements or changes there, that you might like. including min-SNR, which greatly assisted with convergence, and options to use D-adaptation for the same reason. |
…gface#4079) * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * [Community] Implementation of the IADB community pipeline (huggingface#3996) * community pipeline: implementation of iadb * iadb.py: reformat using black * iadb.py: linting update * add kandinsky to readme table (huggingface#4081) Co-authored-by: yiyixuxu <yixu310@gmail,com> * [From Single File] Force accelerate to be installed (huggingface#4078) force accelerate to be installed * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Clean up IP2P SDXL code * Clean up IP2P SDXL code * [IP2P and SDXL] clean up code * [IP2P and SDXL] clean up code * [IP2P and SDXL] clean up code * [IP2P SDXL] Address code reviews * [IP2P SDXL] Address code reviews, add docs, tests * [IP2P SDXL] Address code reviews, add docs, tests * [IP2P SDXL] Address code reviews, add docs, tests * [IP2P SDXL] Address code reviews, add docs, tests * [IP2P SDXL] Address code reviews, add docs, tests * [IP2P SDXL] Address code reviews, add docs, tests * [IP2P SDXL] Address code reviews, add docs, tests * [IP2P SDXL] Address code reviews, add docs, tests * [IP2P SDXL] Address code reviews, add docs, tests * [IP2P SDXL] Address code reviews, add docs, tests * [IP2P SDXL] Address code reviews, add docs, tests * [IP2P SDXL] Address code reviews, add docs, tests * [IP2P SDXL] Address code reviews * [IP2P SDXL] Address code reviews * [IP2P SDXL] Add README_SDXL * [IP2P SDXL] Address code reviews * [IP2P SDXL] Address code reviews * [IP2P SDXL] Fix the copy problems * [IP2P SDXL] Add license * [IP2P SDXL] Add license * [IP2P SDXL] Add license * [IP2P SDXL] Address code reivew for selecting VAE andd others * [IP2P SDXL] Update README_sdxl * [IP2P SDXL] Update __init__ * [IP2P SDXL] Update dummy_torch_and_transformers_and_invisible_watermark_objects * address patrick's comments and some additions to readmes. --------- Co-authored-by: Harutatsu Akiyama <[email protected]> Co-authored-by: Thomas Chambon <[email protected]> Co-authored-by: YiYi Xu <[email protected]> Co-authored-by: yiyixuxu <yixu310@gmail,com> Co-authored-by: Patrick von Platen <[email protected]> Co-authored-by: Sayak Paul <[email protected]>
…gface#4079) * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * [Community] Implementation of the IADB community pipeline (huggingface#3996) * community pipeline: implementation of iadb * iadb.py: reformat using black * iadb.py: linting update * add kandinsky to readme table (huggingface#4081) Co-authored-by: yiyixuxu <yixu310@gmail,com> * [From Single File] Force accelerate to be installed (huggingface#4078) force accelerate to be installed * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Support instruction pix2pix sdxl * Clean up IP2P SDXL code * Clean up IP2P SDXL code * [IP2P and SDXL] clean up code * [IP2P and SDXL] clean up code * [IP2P and SDXL] clean up code * [IP2P SDXL] Address code reviews * [IP2P SDXL] Address code reviews, add docs, tests * [IP2P SDXL] Address code reviews, add docs, tests * [IP2P SDXL] Address code reviews, add docs, tests * [IP2P SDXL] Address code reviews, add docs, tests * [IP2P SDXL] Address code reviews, add docs, tests * [IP2P SDXL] Address code reviews, add docs, tests * [IP2P SDXL] Address code reviews, add docs, tests * [IP2P SDXL] Address code reviews, add docs, tests * [IP2P SDXL] Address code reviews, add docs, tests * [IP2P SDXL] Address code reviews, add docs, tests * [IP2P SDXL] Address code reviews, add docs, tests * [IP2P SDXL] Address code reviews, add docs, tests * [IP2P SDXL] Address code reviews * [IP2P SDXL] Address code reviews * [IP2P SDXL] Add README_SDXL * [IP2P SDXL] Address code reviews * [IP2P SDXL] Address code reviews * [IP2P SDXL] Fix the copy problems * [IP2P SDXL] Add license * [IP2P SDXL] Add license * [IP2P SDXL] Add license * [IP2P SDXL] Address code reivew for selecting VAE andd others * [IP2P SDXL] Update README_sdxl * [IP2P SDXL] Update __init__ * [IP2P SDXL] Update dummy_torch_and_transformers_and_invisible_watermark_objects * address patrick's comments and some additions to readmes. --------- Co-authored-by: Harutatsu Akiyama <[email protected]> Co-authored-by: Thomas Chambon <[email protected]> Co-authored-by: YiYi Xu <[email protected]> Co-authored-by: yiyixuxu <yixu310@gmail,com> Co-authored-by: Patrick von Platen <[email protected]> Co-authored-by: Sayak Paul <[email protected]>
Support for Training Instruct Pix2Pix with Stable Diffusion XL
Description:
This pull request introduces support for training Instruct Pix2Pix with Stable Diffusion XL. The changes include two new files:
train_instruct_pix2pix_xl.py: This file contains the necessary code to train the Instruct Pix2Pix model using the Stable Diffusion XL method. It includes the training loop, loss function calculations, and backpropagation steps.
pipeline_stable_diffusion_xl_instruct_pix2pix.py: This file provides the pipeline for inferencing with the trained Instruct Pix2Pix model. It handles the pre-processing of input data, model inference, and post-processing of model outputs.
The addition of these files will allow users to train and inference with the Instruct Pix2Pix model of Stable Diffusion XL, which can potentially lead to improved performance and results.