Skip to content

feat: add DPM++ 2M SDE sampler#1742

Merged
leejet merged 1 commit into
leejet:masterfrom
fszontagh:feat/dpmpp-2m-sde
Jul 5, 2026
Merged

feat: add DPM++ 2M SDE sampler#1742
leejet merged 1 commit into
leejet:masterfrom
fszontagh:feat/dpmpp-2m-sde

Conversation

@fszontagh

@fszontagh fszontagh commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds dpm++2m_sde - DPM-Solver++(2M) SDE, midpoint variant. It uses the same multistep skeleton as the existing dpm++2m (one model eval per step) plus a stochastic term controlled by --eta (default 1.0, matching k-diffusion). At the same seed it produces different but plausible compositions from the ODE variant, which is the expected signature of a working SDE sampler.

Reference: Lu et al. arXiv:2211.01095; k-diffusion sample_dpmpp_2m_sde.

Wired through everywhere the existing samplers are: enum, name table, CLI --sampling-method and --eta help, sd-api A1111 aliases (dpm++ 2m sde, k_dpmpp_2m_sde), and resolve_eta default.

Related Issue / Discussion

None.

Additional Information

Verified end to end on:

  • SD 1.5 (v1-5-pruned-emaonly-fp16) at 512x512, 20 steps, karras, seed 42
  • SDXL (AcornXL_V2) at 1024x1024, 25 steps, karras, cfg 6.0, seed 42

Same prompt ("a cat"), same seed. SDE and ODE outputs diverge as expected while remaining coherent and artifact-free. Runtime is on par with dpm++2m (SDXL 25 steps: 47.76s SDE vs 46.70s ODE).

SD 1.5, 512x512, 20 steps

dpm++2m_sde dpm++2m (ODE)
sd15_cat_sde sd15_cat_ode

SDXL, 1024x1024, 25 steps

dpm++2m_sde dpm++2m (ODE)
sdxl_cat_sde sdxl_cat_ode

Design notes

  • Midpoint variant only. k-diffusion also exposes a heun variant, but midpoint is the community default and adding a flag for the other would just be a knob.
  • randn_like per step, matching sample_er_sde and sample_res_multistep. No BrownianTree sampler added.
  • No flow-denoiser branch, matching the existing sample_dpmpp_2m ODE sibling. Users on flow models should keep using euler_flow or res_multistep.
  • Enum value is appended, so existing integer values stay stable.

Checklist

@leejet leejet merged commit 38a51f8 into leejet:master Jul 5, 2026
11 checks passed
@fszontagh fszontagh deleted the feat/dpmpp-2m-sde branch July 5, 2026 14:03
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