- Notifications
You must be signed in to change notification settings - Fork 6.6k
Fix QwenImage txt_seq_lens handling #12702
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
kashif wants to merge 48 commits into huggingface:main Choose a base branch from kashif:txt_seq_lens
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline, and old review comments may become outdated.
+506 −163
Open
Changes from 3 commits
Commits
Show all changes
48 commits Select commit Hold shift + click to select a range
b547fcf Fix QwenImage txt_seq_lens handling
kashif 72a80c6 formatting
kashif 88cee8b formatting
kashif ac5ac24 remove txt_seq_lens and use bool mask
kashif 0477526 Merge branch 'main' into txt_seq_lens
kashif 18efdde use compute_text_seq_len_from_mask
kashif 6a549d4 add seq_lens to dispatch_attention_fn
kashif 2d424e0 use joint_seq_lens
kashif 30b5f98 remove unused index_block
kashif 588dc04 Merge branch 'main' into txt_seq_lens
kashif f1c2d99 WIP: Remove seq_lens parameter and use mask-based approach
kashif ec52417 Merge branch 'txt_seq_lens' of https://github.com/kashif/diffusers in…
kashif beeb020 fix formatting
kashif 5c6f8e3 undo sage changes
kashif 5d434f6 xformers support
kashif 71ba603 hub fix
kashif babf490 Merge branch 'main' into txt_seq_lens
kashif afad335 fix torch compile issues
kashif 2d5ab16 Merge branch 'main' into txt_seq_lens
sayakpaul c78a1e9 fix tests
kashif d6d4b1d use _prepare_attn_mask_native
kashif e999b76 proper deprecation notice
kashif 8115f0b add deprecate to txt_seq_lens
kashif 3b1510c Update src/diffusers/models/transformers/transformer_qwenimage.py
kashif 3676d8e Update src/diffusers/models/transformers/transformer_qwenimage.py
kashif 9ed0ffd Only create the mask if there's actual padding
kashif abec461 Merge branch 'main' into txt_seq_lens
kashif e26e7b3 fix order of docstrings
kashif 59e3882 Adds performance benchmarks and optimization details for QwenImage
cdutr 0cb2138 Merge branch 'main' into txt_seq_lens
kashif 60bd454 rope_text_seq_len = text_seq_len
kashif a5abbb8 rename to max_txt_seq_len
kashif 8415c57 Merge branch 'main' into txt_seq_lens
kashif afff5b7 Merge branch 'main' into txt_seq_lens
kashif 8dc6c3f Merge branch 'main' into txt_seq_lens
kashif 22cb03d removed deprecated args
kashif 125a3a4 undo unrelated change
kashif b5b6342 Updates QwenImage performance documentation
cdutr 61f5265 Updates deprecation warnings for txt_seq_lens parameter
cdutr 2ef38e2 fix compile
kashif 270c63f Merge branch 'txt_seq_lens' of https://github.com/kashif/diffusers in…
kashif 35efa06 formatting
kashif 50c4815 fix compile tests
kashif c88bc06 Merge branch 'main' into txt_seq_lens
kashif 1433783 rename helper
kashif 8de799c remove duplicate
kashif fc93747 smaller values
kashif 8bb47d8 Merge branch 'main' into txt_seq_lens
kashif File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This only works if the attention mask is in the form of [True, True, True, ..., False, False, False]. While this is the case in the most common use case of text attention masks, it doesn't have to be the case.
If the mask is [True, False, True, False, True, False],
self.pos_embedreceives an incorrect sequence length