Skip to content

Commit 0497faa

Browse files
committed
update
1 parent 4f00bae commit 0497faa

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/diffusers/pipelines/chroma/pipeline_chroma.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,10 @@ def encode_prompt(
300300
device=device,
301301
)
302302

303+
dtype = self.text_encoder.dtype if self.text_encoder is not None else self.transformer.dtype
304+
text_ids = torch.zeros(prompt_embeds.shape[1], 3).to(device=device, dtype=dtype)
303305
negative_text_ids = None
306+
304307
if do_classifier_free_guidance and negative_prompt_embeds is None:
305308
negative_prompt = negative_prompt or ""
306309
negative_prompt = batch_size * [negative_prompt] if isinstance(negative_prompt, str) else negative_prompt
@@ -330,9 +333,6 @@ def encode_prompt(
330333
# Retrieve the original scale by scaling back the LoRA layers
331334
unscale_lora_layers(self.text_encoder, lora_scale)
332335

333-
dtype = self.text_encoder.dtype if self.text_encoder is not None else self.transformer.dtype
334-
text_ids = torch.zeros(prompt_embeds.shape[1], 3).to(device=device, dtype=dtype)
335-
336336
return prompt_embeds, text_ids, negative_prompt_embeds, negative_text_ids
337337

338338
# Copied from diffusers.pipelines.flux.pipeline_flux.FluxPipeline.encode_image

0 commit comments

Comments
 (0)