The ten-step ODE solver behind Stable Diffusion
DPM-Solver is a high-order ODE integrator that generates diffusion samples in about ten to twenty function evaluations without retraining the model.

What it does
DPM-Solver (and its successor DPM-Solver++) is a dedicated high-order integrator for the ODEs that drive diffusion probabilistic models. It wraps existing noise-prediction, data-prediction, velocity, or score-function models and targets high-quality samples in roughly 10 to 20 function evaluations. The implementation supports both discrete-time and continuous-time schedules, and it slots into popular frameworks like Hugging Face Diffusers and AUTOMATIC1111’s WebUI.
The interesting bit
Instead of treating sampling as a black-box loop, the project approaches it as a numerical analysis problem, deriving Runge-Kutta-like and Adams-Bashforth-like solvers with convergence-order guarantees tailored specifically to diffusion ODEs. This mathematical focus is likely why it became the default scheduler for Stable Diffusion 2.1 and ended up ported to Apple’s Core ML stack.
Key highlights
- Supports four model types—noise, data, velocity, and score-function predictions—without any retraining.
- Offers singlestep and multistep solvers at orders 1, 2, and 3; DPM-Solver++ adds dynamic thresholding for guided sampling.
- Integrated into production pipelines: Stable Diffusion, DeepFloyd-IF, DiffEdit, ScoreSDE, and k-diffusion.
- The multistep DPM-Solver++ is the current default solver in Hugging Face Diffusers and several official online demos.
- A Hugging Face Spaces demo running on TPU reportedly cut steps from 50 to 25 and generated eight images in four seconds.
Caveats
- The Swift/Core ML port is restricted to second-order solvers and lacks dynamic thresholding.
- Version 2.0 revised the discrete-time noise schedule and
model_wrapperAPI, so older discrete-time integrations may need updating.
Verdict
If you are building or hacking on diffusion samplers and want to trade a small integration patch for a multistep speedup, this is the reference implementation to read. Application developers who just need faster inference can simply select the scheduler in Diffusers and never visit this repository.
Frequently asked
- What is LuChengTHU/dpm-solver?
- DPM-Solver is a high-order ODE integrator that generates diffusion samples in about ten to twenty function evaluations without retraining the model.
- Is dpm-solver open source?
- Yes — LuChengTHU/dpm-solver is open source, released under the MIT license.
- What language is dpm-solver written in?
- LuChengTHU/dpm-solver is primarily written in Python.
- How popular is dpm-solver?
- LuChengTHU/dpm-solver has 1.9k stars on GitHub.
- Where can I find dpm-solver?
- LuChengTHU/dpm-solver is on GitHub at https://github.com/LuChengTHU/dpm-solver.