-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Add Prompt2Prompt pipeline #4563
Conversation
…nto prompt2prompt
- made fast inference tests faster - corrected image shape assertions
- used conditional unet2d - set expected image slices - edit_kwargs are now not popped, so pipe can be run multiple times
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. |
…nto prompt2prompt
Hi @UmerHA. I should be able to review this by tomorrow. |
src/diffusers/pipelines/alt_diffusion/pipeline_alt_diffusion.py
Outdated
Show resolved
Hide resolved
src/diffusers/pipelines/alt_diffusion/pipeline_alt_diffusion_img2img.py
Outdated
Show resolved
Hide resolved
I'm not sure how relevant this pipeline still is to be honest - @apolinario do you think there is still a big demand for this pipeline? |
As an user of this pipeline, I hope this pipeline could be merged or at least make it a community pipeline. |
Do you think we could add this pipeline as a community pipeline instead? Our test suite and maintenance cost is exploding at the moment and we need to be a bit more selective which pipelines shall be added to "main" |
@patrickvonplaten Absolutely, will do! |
- Moved prompt2prompt pipeline from main to community - Deleted tests - Moved documentation to community and shorted it
Have now:
I think I've done everything, but would appreciate if you could quickly check. Thanks! |
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.
Just some final clean-ups :-)
Co-authored-by: Patrick von Platen <[email protected]>
As this has been an InvokeAI feature since before Invoke adopted diffusers, it's been on the list of things I've hoped to see supported here. Partly to ease Invoke's maintenance for a feature that has required some messy kludges at times (factoring out the AttentionProcessor helped, but I lost track of where that whole thing ended up), but also because Invoke's implementation only does the replace operator and I've been looking forward to being able to use reweight.
😵 a fully implemented feature with tests and then you deleted them? [keturn dies inside] |
Tests are exploding and becoming too expensive/slow (currently at 20min just for fast tests). We sadly need to be more selective with pipeline testing. |
Thanks a mille for the PR @UmerHA |
I've opened an issue over at invoke-ai/InvokeAI#4541 to figure out how to handle things on Invoke's side. @UmerHA, if you're interested in contributing prompt2prompt and attention-map-visualization code to Invoke, your input would be very welcome! |
How can I use this? I try
it outputs
I have the newest version of diffusers. |
can you try: from diffusers import DiffusionPipeline
pipeline = DiffusionPipeline.from_pretrained("runwayml/stable-diffusion-v1-5", custom_pipeline="pipeline_prompt2prompt") |
Does it support sdxl? when i run
the following error occurs
Thank you for your help. |
@betterze unfortunately no. SDXL versions of pipelines are their own classes. For this pipeline, there currently is no SDXL version. Feel free to implement one! |
* Initial commit P2P * Replaced CrossAttention, added test skeleton * bug fixes * Updated docstring * Removed unused function * Created tests * improved tests - made fast inference tests faster - corrected image shape assertions * Corrected expected output shape in tests * small fix: test inputs * Update tests - used conditional unet2d - set expected image slices - edit_kwargs are now not popped, so pipe can be run multiple times * Fixed bug in int tests * Fixed tests * Linting * Create prompt2prompt.md * Added to docs toc * Ran make fix-copies * Fixed code blocks in docs * Using same interface as StableDiffusionPipeline * Fixed small test bug * Added all options SDPipeline.__call_ has * Fixed docstring; made __call__ like in SD * Linting * Added test for multiple prompts * Improved docs * Incorporated feedback * Reverted formatting on unrelated files * Moved prompt2prompt to community - Moved prompt2prompt pipeline from main to community - Deleted tests - Moved documentation to community and shorted it * Update src/diffusers/utils/dummy_torch_and_transformers_objects.py Co-authored-by: Patrick von Platen <[email protected]> --------- Co-authored-by: Patrick von Platen <[email protected]>
What does this PR do?
Adds the Prompt-to-Prompt pipeline, as discussed in #2121
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.
Pipelines: @patrickvonplaten and @sayakpaul