Code Monkey home page Code Monkey logo

dm-nonuniform's Introduction

DM-NonUniform

Official code for Accelerating Diffusion Sampling with Optimized Time Steps (CVPR 2024)

Accelerating Diffusion Sampling with Optimized Time Steps (CVPR 2024)
Shuchen Xue, Zhaoqiang Liu†, Fei Chen, Shifeng Zhang, Tianyang Hu, Enze Xie, Zhenguo Li
University of Chinese Academy of Sciences, University of Electronic Science and Technology of China, Huawei Noah’s Ark Lab


Abstract

Discretization of sampling time steps are mainly hand-crafted designed, such as uniform-t scheme, quadratic-t scheme, uniform logSNR scheme and EDM scheme. We propose an optimization-based method to choose appropriate time steps for a specific numerical ODE solver for Diffusion Models.

Integration with DPM-Solver, UniPC

Add the following code in "get_time_steps" method in DPM-Solver or UniPC

from step_optim import StepOptim
elif skip_type == "optimized":
    optimizer = StepOptim(self.noise_schedule)
    t, _ = optimizer.get_ts_lambdas(N, t_0, optimized_type)
    t = t.to(device).to(torch.float32)
    return t

For pixel-space diffusion models, we recommend use "optimized_type" as "unif", which means that the optimization algorithm will use uniform-logSNR steps as initialization; for latent-space diffusion models, we recommend use "optimized_type" = "unif_t", which means that the optimization algorithm will use uniform-time steps as initialization.

Citation

If you find our work useful in your research, please consider citing:

@article{xue2024accelerating,
  title={Accelerating Diffusion Sampling with Optimized Time Steps},
  author={Xue, Shuchen and Liu, Zhaoqiang and Chen, Fei and Zhang, Shifeng and Hu, Tianyang and Xie, Enze and Li, Zhenguo},
  journal={arXiv preprint arXiv:2402.17376},
  year={2024}
}

dm-nonuniform's People

Contributors

scxue avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.