Skip to content

Add cond + uncond batching to Chroma #11729

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

Open
wants to merge 4 commits into
base: chroma-fixes
Choose a base branch
from

Conversation

Ednaordinary
Copy link
Contributor

@Ednaordinary Ednaordinary commented Jun 17, 2025

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

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

@Ednaordinary Ednaordinary mentioned this pull request Jun 17, 2025
6 tasks
@@ -846,11 +850,13 @@ def __call__(
if image_embeds is not None:
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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

curious are we batching cond + uncond just to be consistent with diffusers pipeline style or do we see a performance benefit with it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mainly for consistency, I don't see too much difference with or without it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants