Add cond + uncond batching to Chroma#11729
Closed
Ednaordinary wants to merge 4 commits into
Closed
Conversation
yiyixuxu
reviewed
Jun 18, 2025
| self._joint_attention_kwargs["ip_adapter_image_embeds"] = image_embeds | ||
|
|
||
| # expand the latents if we are doing classifier free guidance | ||
| latent_model_input = torch.cat([latents] * 2) if self.do_classifier_free_guidance else latents |
Collaborator
There was a problem hiding this comment.
curious are we batching cond + uncond just to be consistent with diffusers pipeline style or do we see a performance benefit with it?
Contributor
Author
There was a problem hiding this comment.
Mainly for consistency, I don't see too much difference with or without it
hameerabbasi
approved these changes
Jun 22, 2025
hameerabbasi
left a comment
Contributor
There was a problem hiding this comment.
LGTM; thanks @Ednaordinary
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Small PR, adds cond and uncond batch to Chroma now that prompt embeds are in a consistent size
Relevant #11725
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.
@DN6