From 4f00bae5de60f1ad0a6f9123be76dffdc99bc637 Mon Sep 17 00:00:00 2001 From: DN6 Date: Sat, 14 Jun 2025 00:31:33 +0530 Subject: [PATCH] update --- src/diffusers/pipelines/chroma/pipeline_chroma.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/diffusers/pipelines/chroma/pipeline_chroma.py b/src/diffusers/pipelines/chroma/pipeline_chroma.py index a0a6fd6ba6..0b00005fe3 100644 --- a/src/diffusers/pipelines/chroma/pipeline_chroma.py +++ b/src/diffusers/pipelines/chroma/pipeline_chroma.py @@ -299,6 +299,8 @@ class ChromaPipeline( max_sequence_length=max_sequence_length, device=device, ) + + negative_text_ids = None if do_classifier_free_guidance and negative_prompt_embeds is None: negative_prompt = negative_prompt or "" negative_prompt = batch_size * [negative_prompt] if isinstance(negative_prompt, str) else negative_prompt @@ -321,6 +323,7 @@ class ChromaPipeline( max_sequence_length=max_sequence_length, device=device, ) + negative_text_ids = torch.zeros(negative_prompt_embeds.shape[1], 3).to(device=device, dtype=dtype) if self.text_encoder is not None: if isinstance(self, FluxLoraLoaderMixin) and USE_PEFT_BACKEND: @@ -329,7 +332,6 @@ class ChromaPipeline( dtype = self.text_encoder.dtype if self.text_encoder is not None else self.transformer.dtype text_ids = torch.zeros(prompt_embeds.shape[1], 3).to(device=device, dtype=dtype) - negative_text_ids = torch.zeros(negative_prompt_embeds.shape[1], 3).to(device=device, dtype=dtype) return prompt_embeds, text_ids, negative_prompt_embeds, negative_text_ids