-
Notifications
You must be signed in to change notification settings - Fork 6k
Add sdxl prompt embeddings #3995
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
@@ -17,13 +16,9 @@ class StableDiffusionXLPipelineOutput(BaseOutput): | |||
images (`List[PIL.Image.Image]` or `np.ndarray`) | |||
List of denoised PIL images of length `batch_size` or numpy array of shape `(batch_size, height, width, | |||
num_channels)`. PIL images or numpy array present the denoised images of the diffusion pipeline. | |||
nsfw_content_detected (`List[bool]`) |
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 are removing this?
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.
@sayakpaul There is no safety checker in these pipelines.
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 would have expected to see a change in encode_prompt()
to accommodate the pooled embeddings. But didn't notice it.
What am I missing out on? We should maybe also include tests for those.
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.
I don't fully follow. How would this be used with the compel
library?
@@ -17,13 +16,9 @@ class StableDiffusionXLPipelineOutput(BaseOutput): | |||
images (`List[PIL.Image.Image]` or `np.ndarray`) | |||
List of denoised PIL images of length `batch_size` or numpy array of shape `(batch_size, height, width, | |||
num_channels)`. PIL images or numpy array present the denoised images of the diffusion pipeline. | |||
nsfw_content_detected (`List[bool]`) |
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.
@sayakpaul There is no safety checker in these pipelines.
Having chatted offilne with @pcuenca this is the only way really we can do things. If the user passes |
Merging |
So, pooled_prompt_embeds is also needed with prompt_embeds We have understanding of creating embeds, but pooled embeds will be same or they are different? Can we pass same prompt embeddings in pooled and prompt_embeds? If not, how can we create pooled embeds? Can compel work? |
Hi @adhikjoshi. If you check out diffusers/src/diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl.py Line 242 in 78922ed
you will notice the code for computing the pooled prompt embeddings. Let me know if that helps. |
# We are only ALWAYS interested in the pooled output of the final text encoder
negative_pooled_prompt_embeds = negative_prompt_embeds[0] seems like it's not needed and we can just pass in the negative prompt embeds etc? |
docs for encode_prompt say prompt is optional, but signature has no default value of None |
* Add sdxl prompt embeddings * Fix more * fix some slow tests
* Add sdxl prompt embeddings * Fix more * fix some slow tests
What does this PR do?
Make sure prompt embeddings can be passed to SD-XL.
Fixes #3970
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.