-
Notifications
You must be signed in to change notification settings - Fork 6k
add support for pre-calculated prompt embeds to Stable Diffusion ONNX pipelines #2597
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
13789ed
to
51d33fd
Compare
The documentation is not available anymore as the PR was closed or merged. |
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.
Looks very clean to me and makes sens! Thanks a lot - @anton-l could you take a quick look here?
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. |
72d1546
to
57f93de
Compare
This is still useful to me (and hopefully others). I got sidetracked for a little bit, but I've rebased the branch and the existing tests look good - happy to add more if you'd like, or make any other changes. This will be really helpful for custom prompt parsing, like weights and group and expansion stuff. |
Sorry for taking so long here @ssube - merging! |
No worries, thank you! Always happy to add more tests or make changes, I don't want to break things for anyone, especially my own project 😄 |
… pipelines (huggingface#2597) * add support for prompt embeds to SD ONNX pipeline * fix up the pipeline copies * add prompt embeds param to other ONNX pipelines * fix up prompt embeds param for SD upscaling ONNX pipeline * add missing type annotations to ONNX pipes
… pipelines (huggingface#2597) * add support for prompt embeds to SD ONNX pipeline * fix up the pipeline copies * add prompt embeds param to other ONNX pipelines * fix up prompt embeds param for SD upscaling ONNX pipeline * add missing type annotations to ONNX pipes
… pipelines (huggingface#2597) * add support for prompt embeds to SD ONNX pipeline * fix up the pipeline copies * add prompt embeds param to other ONNX pipelines * fix up prompt embeds param for SD upscaling ONNX pipeline * add missing type annotations to ONNX pipes
… pipelines (huggingface#2597) * add support for prompt embeds to SD ONNX pipeline * fix up the pipeline copies * add prompt embeds param to other ONNX pipelines * fix up prompt embeds param for SD upscaling ONNX pipeline * add missing type annotations to ONNX pipes
Motivation
I would like to calculate the prompt and negative prompt embeds ahead of time using my own logic and pass them into the ONNX version of the SD pipeline, which is supported by the regular non-ONNX pipeline, https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion.py#L571, but not available for ONNX. This should bring parity between the two for the
prompt_embeds
andnegative_prompt_embeds
parameters.If this change is acceptable, I would like to do the same to the other ONNX pipelines. I can add those changes to this same PR or make another one, whatever works, I know you all have limited time for the ONNX stuff.Looks like the build requires the change to be copied out to the other pipelines, so that's in this PR as well.Example