feat: add DPM++ (2S) Ancestral implementation for flow models#1428
Merged
leejet merged 1 commit intoleejet:masterfrom Apr 18, 2026
Merged
feat: add DPM++ (2S) Ancestral implementation for flow models#1428leejet merged 1 commit intoleejet:masterfrom
leejet merged 1 commit intoleejet:masterfrom
Conversation
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This went missing from the version merged on #1374 .
It's mostly based on the calculations from the ComfyUI implementation, but I've replaced the 'sigma_s = 0.9999' hack with an equivalent calculation that avoids that singularity.
For that same sigma==1 case, I've also added an optimization that skips the second model call (rationale on the comments). But that epsilon is arbitrary, and could change the result for sigmas close to 1, so a more conservative approach could be testing for exact 1.0 (although the schedulers may not use a hardcoded 1 constant in that case). The epsilon makes the sigma_s calculation change kind of redundant, but I've kept both because I consider the first just an optimization: everything should keep working if it's changed to
sigma==1.0, or disabled.The
opt_first_stepdance just avoids the progress bar being silent during the first step.5 steps (8 NFEs), simple scheduler: