Skip to content

Commit f20e4af

Browse files
committed
update
1 parent 7787ec1 commit f20e4af

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/diffusers/pipelines/flux/pipeline_flux.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ def _get_t5_prompt_embeds(
248248
padding="max_length",
249249
max_length=max_sequence_length,
250250
truncation=True,
251-
return_length=(self.variant == "chroma"),
251+
return_length=True,
252252
return_overflowing_tokens=False,
253253
return_tensors="pt",
254254
)
@@ -262,6 +262,7 @@ def _get_t5_prompt_embeds(
262262
f" {max_sequence_length} tokens: {removed_text}"
263263
)
264264

265+
text_inputs.attention_mask[:, : text_inputs.length + 1] = 1.0
265266
prompt_embeds = self.text_encoder_2(
266267
text_input_ids.to(device), output_hidden_states=False, attention_mask=text_inputs.attention_mask.to(device)
267268
)[0]

0 commit comments

Comments
 (0)