dpm-solver  by LuChengTHU

Fast ODE solver for diffusion probabilistic model sampling

Created 3 years ago
1,756 stars

Top 24.4% on SourcePulse

GitHubView on GitHub
Project Summary

DPM-Solver provides a fast, high-order ODE solver specifically designed for diffusion probabilistic models, enabling high-quality sample generation in as few as 10-20 steps. It supports both discrete-time and continuous-time diffusion models without requiring additional training, making it a versatile tool for researchers and practitioners in generative AI.

How It Works

DPM-Solver implements a family of solvers for the underlying ODEs of diffusion models. It offers both single-step (Runge-Kutta-like) and multi-step (Adams-Bashforth-like) methods with convergence orders up to 3. The improved DPM-Solver++ variant incorporates dynamic thresholding for enhanced sample quality in pixel-space models. The library provides a model_wrapper to seamlessly integrate various diffusion model types (noise, data, velocity, score prediction) and sampling strategies (unconditional, classifier, classifier-free guidance).

Quick Start & Requirements

  • Install: Typically integrated via libraries like diffusers. For direct use, copy dpm_solver_pytorch.py or dpm_solver_jax.py.
  • Prerequisites: PyTorch or JAX. GPU recommended for performance.
  • Resources: Integration with diffusers simplifies setup. Direct usage requires defining noise schedules and model wrappers.
  • Docs: Official Documentation

Highlighted Details

  • Achieves high-quality samples in 10-20 steps, significantly faster than traditional methods.
  • Supports multiple diffusion model types (noise, x_start, v, score prediction).
  • Offers both single-step and multi-step solvers with varying orders (1-3).
  • DPM-Solver++ includes dynamic thresholding for improved pixel-space image quality.
  • Integrates with popular libraries like diffusers, Stable-Diffusion, and DeepFloyd-IF.

Maintenance & Community

The project is associated with academic research from Tsinghua University. It has seen significant adoption and integration into major diffusion model libraries.

Licensing & Compatibility

The repository does not explicitly state a license in the provided README. Users should verify licensing for commercial or closed-source use.

Limitations & Caveats

The README suggests that DPM-Solver cannot improve sample quality if the base diffusion model performs poorly with 1000-step DDIM. Dynamic thresholding is noted as only valid for pixel-space diffusion models.

Health Check
Last Commit

1 year ago

Responsiveness

Inactive

Pull Requests (30d)
0
Issues (30d)
0
Star History
11 stars in the last 30 days

Explore Similar Projects

Starred by Andrej Karpathy Andrej Karpathy(Founder of Eureka Labs; Formerly at Tesla, OpenAI; Author of CS 231n), Clement Delangue Clement Delangue(Cofounder of Hugging Face), and
37 more.

diffusers by huggingface

0.3%
31k
PyTorch/Flax library for diffusion model research and applications
Created 3 years ago
Updated 13 hours ago
Feedback? Help us improve.