Fixed new breaking change in diffusers with with qwen image

This commit is contained in:
Jaret Burkett
2026-03-23 14:10:55 -06:00
parent 5642b656b9
commit 295094b4b5

View File

@@ -355,11 +355,12 @@ class QwenImageModel(BaseModel):
if self.pipeline.text_encoder.device != self.device_torch: if self.pipeline.text_encoder.device != self.device_torch:
self.pipeline.text_encoder.to(self.device_torch) self.pipeline.text_encoder.to(self.device_torch)
prompt_embeds, prompt_embeds_mask = self.pipeline.encode_prompt( max_sequence_length = 1024
prompt,
device=self.device_torch, prompt_embeds, prompt_embeds_mask = self.pipeline._get_qwen_prompt_embeds(prompt, self.device_torch)
num_images_per_prompt=1, prompt_embeds = prompt_embeds[:, :max_sequence_length]
) prompt_embeds_mask = prompt_embeds_mask[:, :max_sequence_length]
pe = PromptEmbeds(prompt_embeds) pe = PromptEmbeds(prompt_embeds)
pe.attention_mask = prompt_embeds_mask pe.attention_mask = prompt_embeds_mask
return pe return pe