You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Restore Qwen Image 2.1 prefix caching after the DGL migration by passing a stable, nonzero prefix_id from each fixed predictor to the runner. Addresses the edit-sampling regression reported in #2401.
Give positive, negative, and distinct reference predictors separate IDs within each sampling run. Step-dependent conditioning keeps ID 0. The existing runner handles cache cleanup and low-memory fallback.
If this PR adds or changes model support, I have added or updated its usage guide and relevant model index/README entries following the model documentation requirements.
Summary by CodeRabbit
Bug Fixes
Improved image generation with Qwen Image 2.1 models in configurations without controls, IP-Adapters, or PuLID bindings.
Generation now better distinguishes eligible model configurations, helping produce more consistent results across image-generation steps.
No actionable comments were generated in the recent review.
Walkthrough
Qwen Image 2.1 prediction steps now carry a prefix ID. Predictor collection assigns IDs to eligible leaves, and the DiT code passes each ID in QwenImage21DiffusionExtra.
Changes: Qwen Image 2.1 prefix ID flow
Layer / File(s)
Summary
Assign and forward prefix IDs src/dgl/models/diffusion_prediction.h, src/dgl/ops/predictor.cpp, src/dgl/models/dit.cpp
DiffusionPredictionStep gains a uint64_t prefix ID. Predictor collection stores sequential IDs for Qwen Image 2.1 leaves without control, IP-Adapter, or PuLID bindings. Prediction passes the stored ID, or 0 when none is stored, to QwenImage21DiffusionExtra.
leejet/stable-diffusion.cpp#2401: The prefix ID changes target the reported lack of prefix-cache use during Qwen Image 2.1 edits and the associated slowdown. The reported VRAM retention between jobs is not addressed.
Suggested reviewers:wbruna
Merge Risk: Minimal · up to a56b3
This change restores prefix caching for Qwen Image 2.1 edit sampling by passing a stable prefix ID per predictor. No actionable merge-blocking risk was found, and unsupported cases fall back to the existing uncached behavior.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title names the main change: restoring Qwen Image 2.1 prefix caching, which matches the raw summary's changes to pass a stable nonzero qwen_prefix_id from predictors to the step. The 'fix:' prefix…
Description check
The description has the Summary, Related Issue / Discussion, Additional Information, and Checklist sections from the template. The Summary explains the change and links issue #2401. Related Issue is N…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title names the main change: restoring Qwen Image 2.1 prefix caching, which matches the raw summary's changes to pass a stable nonzero qwen_prefix_id from predictors to the step. The 'fix:' prefix is conventional and the title is specific enough for a teammate scanning history.
Full details: Description check
Explanation
The description has the Summary, Related Issue / Discussion, Additional Information, and Checklist sections from the template. The Summary explains the change and links issue #2401. Related Issue is N/A, which is acceptable here since the issue is linked in the Summary. Additional Information is N/A, with no verification notes. The checklist is ticked, but the model-documentation item does not clearly apply to this DGL C++ change, which touches no model support docs.
Finishing Touches
Generate unit tests (beta)
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Warning
Some tools did not complete. Review the errors below.
Cppcheck (2.22.0)
Cppcheck (2.22.0) exceeded its 180-second time budget. Findings from completed work are retained; remaining checks are incomplete.
src/dgl/ops/predictor.cpp
Cppcheck interrupted; analysis of this file is incomplete
src/dgl/models/dit.cpp
Cppcheck interrupted; analysis of this file is incomplete
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: a3e02706-6414-478a-958b-2aa67f6774f8
Commits
Reviewing files that changed from the base of the PR and between 5b80e1f and a56b3bc.
Files selected for processing: 3
src/dgl/models/diffusion_prediction.h
src/dgl/models/dit.cpp
src/dgl/ops/predictor.cpp
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 4 remain after this review.
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
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.
Summary
prefix_idfrom each fixed predictor to the runner. Addresses the edit-sampling regression reported in #2401.0. The existing runner handles cache cleanup and low-memory fallback.Related Issue / Discussion
N/A
Additional Information
N/A
Checklist
Summary by CodeRabbit