Skip to content

Conversation

@tonera
Copy link

@tonera tonera commented Jan 17, 2026

What does this PR do?

This PR fixes two issues in QwenImageEditPlusPipeline (pipeline_qwenimage_edit_plus.py) related to text sequence length handling:

  • Make max_sequence_length effective: the parameter was accepted by the public API but previously not applied. We now truncate prompt_embeds and prompt_embeds_mask to max_sequence_length.

  • Prevent failures in the denoising loop: QwenImage transformer/RoPE needs an explicit text sequence length, but some accelerated/quantized transformer implementations (e.g. nunchaku) don’t accept the new max_txt_seq_len kwarg. The pipeline now adapts to the transformer forward signature:

  • Prefer passing max_txt_seq_len when supported (or when **kwargs is accepted)

  • Otherwise fall back to deprecated txt_seq_lens

  • Otherwise pass nothing (let the implementation handle it)

  • This avoids runtime errors such as:

  • ValueError: Either max_txt_seq_len or txt_seq_lens ... must be provided

  • TypeError: ... forward() got an unexpected keyword argument 'max_txt_seq_len'

  • Who can review?

Tagging: @yiyixuxu @asomoza (pipelines)

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.

1 participant