Skip to content

qwen_image: fixes for TREAD - #2459

Merged
bghira merged 3 commits into
mainfrom
feature/qwen-tread
Jan 21, 2026
Merged

qwen_image: fixes for TREAD#2459
bghira merged 3 commits into
mainfrom
feature/qwen-tread

Conversation

@bghira

@bghira bghira commented Jan 20, 2026

Copy link
Copy Markdown
Owner

This pull request adds and enhances support for the TREAD routing method in the Qwen Image model and transformer, including improved handling of routing logic and expanded test coverage. The main changes are grouped below.

TREAD Integration in Qwen Image Model

  • Added a new tread_init method to the QwenImage model that initializes TREAD routing, validates configuration, and sets up the router with the specified routes.

Improved TREAD Routing Logic in Transformer

  • Refactored the TREAD routing logic in the QwenImageTransformer2DModel's forward method to pre-normalize route indices (including handling negative indices), and to clearly delineate when to start and end a route using route_ptr and routing_now state variables. This makes the routing process more robust and easier to follow. [1] [2] [3]

Expanded Test Coverage

  • Added new tests for TREAD integration and initialization in the Qwen Image transformer and model, ensuring that the router and routes are correctly set and initialized, and that the new tread_init method behaves as expected. [1] [2]

@bghira
bghira merged commit 7ca5656 into main Jan 21, 2026
2 checks passed
@bghira
bghira deleted the feature/qwen-tread branch January 21, 2026 03:11
samzhang996-hue pushed a commit to samzhang996-hue/SimpleTuner that referenced this pull request Apr 27, 2026
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