Skip to content

feat: add DPM++ (2S) Ancestral implementation for flow models#1428

Merged
leejet merged 1 commit intoleejet:masterfrom
wbruna:sd_dpmpp_2sa_flow
Apr 18, 2026
Merged

feat: add DPM++ (2S) Ancestral implementation for flow models#1428
leejet merged 1 commit intoleejet:masterfrom
wbruna:sd_dpmpp_2sa_flow

Conversation

@wbruna
Copy link
Copy Markdown
Contributor

@wbruna wbruna commented Apr 16, 2026

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_step dance just avoids the progress bar being silent during the first step.

5 steps (8 NFEs), simple scheduler:

eta 1 eta 0
test_1776356487 test_1776356599

@leejet leejet merged commit f3f69e2 into leejet:master Apr 18, 2026
14 of 16 checks passed
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.

2 participants