[SDXL and IP2P]: instruction pix2pix XL training and pipeline by kfzyqin · Pull Request #4079 · huggingface/diffusers (original) (raw)
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 andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Conversation92 Commits89 Checks0 Files changed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
[ Show hidden characters]({{ revealButtonHref }})
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.
kfzyqin changed the title
Support instruction pix2pix sdxl SDXL and IP2P: Support instruction pix2pix sdxl
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.
Hey what bugs did you observe? I was working on the same thing, maybe I can help.
Training generates weird artifacts like below.
Looking into this now.
kfzyqin changed the title
SDXL and IP2P: Support instruction pix2pix sdxl SDXL and IP2P: Support instruction pix2pix sdxl (WIP)
Hey what bugs did you observe? I was working on the same thing, maybe I can help.
Training generates weird artifacts like below. Looking into this now.
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?
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.
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.
I have addressed the code review. Once I have run more experiments, I will give more detailed documentation on training IP2P with SDXL.
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.
ew. Once I have run more experiments, I will give more detailed documentation on training IP2P with SDXL.
Ok for me!
ew. Once I have run more experiments, I will give more detailed documentation on training IP2P with SDXL.
Ok for me!
@patrickvonplaten Can you merge the code? I believe this one is self-contained :-)
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!
@harutatsuakiyama oh wow! InstructPix2Pix is always very dear to my heart. This is why I worked on this: https://huggingface.co/blog/instruction-tuning-sd.
But anyway, could I get some results from your training runs before I do a deep review of your PR if it's not too much?Sure. I trained on this dataset: https://www.zheyuanliu.me/CIRR/, since I have trained this dataset with IP2P before.
These are some examples:
Has dining room view, Change stools to long white benches, Add a chair on the right corner
![]()
Has similar layout of bed and pillows, Change bed to pink
![]()
The dataset is not very pix2pix, hence the change is big.
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?
@harutatsuakiyama oh wow! InstructPix2Pix is always very dear to my heart. This is why I worked on this: https://huggingface.co/blog/instruction-tuning-sd.
But anyway, could I get some results from your training runs before I do a deep review of your PR if it's not too much?Sure. I trained on this dataset: https://www.zheyuanliu.me/CIRR/, since I have trained this dataset with IP2P before.
These are some examples:
Has dining room view, Change stools to long white benches, Add a chair on the right corner![]()
Has similar layout of bed and pillows, Change bed to pink![]()
The dataset is not very pix2pix, hence the change is big.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.
@harutatsuakiyama oh wow! InstructPix2Pix is always very dear to my heart. This is why I worked on this: https://huggingface.co/blog/instruction-tuning-sd.
But anyway, could I get some results from your training runs before I do a deep review of your PR if it's not too much?Sure. I trained on this dataset: https://www.zheyuanliu.me/CIRR/, since I have trained this dataset with IP2P before.
These are some examples:
Has dining room view, Change stools to long white benches, Add a chair on the right corner![]()
Has similar layout of bed and pillows, Change bed to pink![]()
The dataset is not very pix2pix, hence the change is big.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
orpatashnik pushed a commit to orpatashnik/diffusers that referenced this pull request
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 kf.zy.qin@gmail.com Co-authored-by: Thomas Chambon 36728882+tchambon@users.noreply.github.com Co-authored-by: YiYi Xu yixu310@gmail.com Co-authored-by: yiyixuxu <yixu310@gmail,com> Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com Co-authored-by: Sayak Paul spsayakpaul@gmail.com
orpatashnik pushed a commit to orpatashnik/diffusers that referenced this pull request
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 kf.zy.qin@gmail.com Co-authored-by: Thomas Chambon 36728882+tchambon@users.noreply.github.com Co-authored-by: YiYi Xu yixu310@gmail.com Co-authored-by: yiyixuxu <yixu310@gmail,com> Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com Co-authored-by: Sayak Paul spsayakpaul@gmail.com
orpatashnik pushed a commit to orpatashnik/diffusers that referenced this pull request
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 kf.zy.qin@gmail.com Co-authored-by: Thomas Chambon 36728882+tchambon@users.noreply.github.com Co-authored-by: YiYi Xu yixu310@gmail.com Co-authored-by: yiyixuxu <yixu310@gmail,com> Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com Co-authored-by: Sayak Paul spsayakpaul@gmail.com
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.
yoonseokjin pushed a commit to yoonseokjin/diffusers that referenced this pull request
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 kf.zy.qin@gmail.com Co-authored-by: Thomas Chambon 36728882+tchambon@users.noreply.github.com Co-authored-by: YiYi Xu yixu310@gmail.com Co-authored-by: yiyixuxu <yixu310@gmail,com> Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com Co-authored-by: Sayak Paul spsayakpaul@gmail.com
AmericanPresidentJimmyCarter pushed a commit to AmericanPresidentJimmyCarter/diffusers that referenced this pull request
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 kf.zy.qin@gmail.com Co-authored-by: Thomas Chambon 36728882+tchambon@users.noreply.github.com Co-authored-by: YiYi Xu yixu310@gmail.com Co-authored-by: yiyixuxu <yixu310@gmail,com> Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com Co-authored-by: Sayak Paul spsayakpaul@gmail.com