Skip to content

Add cond + uncond batching to Chroma#11729

Closed
Ednaordinary wants to merge 4 commits into
huggingface:chroma-fixesfrom
Ednaordinary:chroma-attn-fix
Closed

Add cond + uncond batching to Chroma#11729
Ednaordinary wants to merge 4 commits into
huggingface:chroma-fixesfrom
Ednaordinary:chroma-attn-fix

Conversation

@Ednaordinary

@Ednaordinary Ednaordinary commented Jun 17, 2025

Copy link
Copy Markdown
Contributor

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
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
Copy Markdown
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
Copy Markdown
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

@hameerabbasi hameerabbasi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM; thanks @Ednaordinary

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.

3 participants