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
{{ message }}
Repository navigation
fix: honor the requested hires sampling step count - #2227
Trim the hires sigma schedule using the requested effective step count. Recomputing the count from the expanded schedule and denoising strength can add an extra sampling interval. For example, 2 hires steps at strength 0.5 currently run 3 steps; this change runs 2.
The existing schedule expansion, bounds clamp and custom-sigma handling remain unchanged.
Direct SD 1.5 CLI checks passed for hires step/strength pairs 1/0.5, 2/0.5, 2/0.7, 2/1.0, 4/0.4 and 7/0.35. Each resulting sigma schedule has exactly the requested number of intervals.
A local C++ harness exercising the source function passed 900 combinations, default-step handling and custom-sigma passthrough. The unmodified source fails the same check.
Test code is kept local in accordance with the contribution guidelines. Other backends were not tested.
High-resolution generation now calculates the denoising schedule trim point from the effective number of steps. This keeps the trim point aligned with the steps used for generation, helping ensure the selected denoising strength is applied consistently. The scheduler’s step count and bounds checking remain unchanged.
No actionable comments were generated in the recent review.
Recent review info
Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: e88b69f9-cc62-473d-93fd-5d6ceecdcee7
Commits
Reviewing files that changed from the base of the PR and between be48649 and 1d4fe1d.
Files selected for processing: 1
src/pipeline/request.cpp
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.
Walkthrough
The hires sigma schedule now sets its trim index from effective_steps - 1 instead of scaling the scheduler step count by denoising strength. The scheduler step count and subsequent bounds check remain unchanged.
Changes: Hires sigma schedule
Layer / File(s)
Summary
Set the hires schedule trim index src/pipeline/request.cpp
The trim index now uses effective_steps - 1. The scheduler step count and bounds check remain unchanged.
The hires trim correction matches the requested interval count on established paths, with no concrete PR-introduced failure identified.
Pre-merge checks: 4 · 1
Failed checks: 1 warning
Check name
Status
Explanation
Resolution
Docstring Coverage
Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files.
Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed checks: 4 passed
Check name
Status
Explanation
Title check
The title clearly and concisely describes the main change: making hires sampling honor the requested step count.
Description check
The description includes all required sections, explains the cause and fix, references the related issue, reports verification results, and completes the checklist.
Linked Issues check
Issue #2226 requires the hires pass to run the requested number of sampling steps, including strengths where the current schedule adds an extra interval. The whole-PR diff against the merge base chang…
Out of Scope Changes check
The whole-PR diff against the merge base changes one line in src/pipeline/request.cpp, inside make_hires_sigma_schedule. That line is the direct cause named in #2226. The PR description states that sc…
Full details: Linked Issues check
Explanation
Issue #2226 requires the hires pass to run the requested number of sampling steps, including strengths where the current schedule adds an extra interval. The whole-PR diff against the merge base changes one line in make_hires_sigma_schedule (src/pipeline/request.cpp). The line now sets t_enc = effective_steps - 1 instead of scheduler_steps * denoising_strength. The existing trim index (scheduler_steps - t_enc - 1, as described in the issue) and the clamp against scheduler_steps are unchanged. With N intervals kept, the trimmed schedule has t_enc + 2 sigmas, which gives effective_steps intervals. Example from the issue: 2 steps at strength 0.5 gives scheduler_steps = 4, t_enc = 1, start index 2, and 3 sigmas (2 intervals). The denoising strength still sets scheduler_steps, so it still affects the starting sigma. The author reports CLI checks for six step/strength pairs and a local harness for 900 combinations. Those results are not in the repository, so they are not independently verified. The file read was truncated, so the trim line and the definition of effective_steps were checked only through the diff context and the issue text. No automated tests are included in the PR.
Full details: Out of Scope Changes check
Explanation
The whole-PR diff against the merge base changes one line in src/pipeline/request.cpp, inside make_hires_sigma_schedule. That line is the direct cause named in #2226. The PR description states that schedule expansion, bounds clamping, and custom-sigma handling are unchanged. The diff matches that statement. No other files are changed, and no unrelated behavior is modified.
Finishing Touches
🧪 Generate unit tests (beta)
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)
src/pipeline/request.cpp
Cppcheck timed out; 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.
@Project516, hello, by the way, the t_enc can now safely use int type, if I'm not mistaken.
It's used only with effective_steps and scheduler_steps, and they are the integers in range 1...max.
Therefore t_enc is now predictably in range 0...max-1, will be compared with positive integer and then casted to <int>, so probably it can simply be int.
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
Trim the hires sigma schedule using the requested effective step count. Recomputing the count from the expanded schedule and denoising strength can add an extra sampling interval. For example, 2 hires steps at strength 0.5 currently run 3 steps; this change runs 2.
The existing schedule expansion, bounds clamp and custom-sigma handling remain unchanged.
Related Issue / Discussion
Fixes #2226.
Additional Information
Checklist
Summary by CodeRabbit