Giter Site home page Giter Site logo

scire-solver's Introduction

Accelerating Diffusion Models Sampling by Score-integrand Solver with Recursive Difference

PWC PWC

Created by Shigui Li*, Wei Chen, Delu Zeng

This code is an official demo of PyTorch implementation of SciRE-Solver.

ArXiv

The SciRE-Solver is a class of accelerating sampling algorithms tailored for diffusion models, requiring no training and optimization. Its numerical algorithm design is fundamentally predicated on the score-integrand form and the following recursive difference refinement, a novel numerical approach we introduce for improving the integral of the score function networks.

SciRE-Solver encompasses two algorithm types: SciRE_v1 and SciRE_v2, which come with three available iteration modes: multistep, singlestep_agile, and singlestep_fixed.

SciRE-Solver, while accelerating, has achieved a better 'FID' compared to the previous achievements of pre-trained models.

Test SciRE-Solver on EDM (1.76 FID on CIFAR-10)

  • SciRE_v1-2 (singlestep_fixed) with cpkt (edm-cifar10-32x32-cond-vp.pkl) attian $2.29$ FID with $12$ NFE, $2.16$ FID with $14$ NFE, $1.94$ FID with $20$ NFE, $1.79$ FID with $50$ NFE, $1.76$ FID with $100$ NFE, when $\phi_1(m)=\phi_1(3)$.

The code is now available in the 'sd_scire' folder, and we welcome everyone to use the SciRE-Solver on stable-diffusion. Next, we will integrate the code into the stable-diffusion repository.

Args:

  • algorithm_type: 'SciRE_v1' or 'SciRE_v2'

  • method: "multistep" or "singlestep_agile" or "singlestep_fixed".

  • When using a small number of sampling steps, we recommend using "multistep" method as:

    • "SciRE_v1-2m"
    • "SciRE_v1-3m"
    • "SciRE_v2-2m"
    • "SciRE_v2-3m" (at 6 steps, it is empirically better than other "m" options.)
  • When the number of sampling steps '>= 26', we recommend trying all available options that can help produce diversity (single-step with 50 NFE may better, empirically).

Empirically, SciRE-Solver with the multistep method can generate higher-quality samples in just a few steps and outperforms DPM-Solver++(multistep) in terms of sample quality even after 50 steps. While maintaining high quality, samples generated by SciRE-Solver using singlestep(and fixed) and multistep methods also display selectable diversity.

Comparison of images by SciRE-Solver with single-step and multi-step, using 50 NFE, and text prompt “a girl face in modern Disney style, physically-based rendering, ultimate painting, UHD”, and seed 33 (scale = 7.5).

The pictures correspond to SciRE_v1_2m, SciRE_v1_2s, SciRE_v2_2m and SciRE_v1_2s in order sequentially.

Comparison of images generated by SciRE-Solver with single-step and multi-step approaches for this Disney prompt.

SciRE_v2_2s, SciRE_v1_3s and SciRE_v2_3s with single-step (pictures sequentially).

SciRE_v2_2m, SciRE_v1_3m and SciRE_v2_3m with multi-step (pictures sequentially).

Samples by SciRE_V2_3 with singlestep (50 NFE) for this Disney prompt.

SciRE_v2_3s with 50 NFE.

Samples by Stable-Diffusion with SciRE-Solver and DPM-Solver++, using 50 NFE, and text prompt “A beautiful mansion beside a waterfall in the woods, by josef thoma, matte painting, trending on artstation HQ”, and seed 33 (scale = 7.5).

SciRE_v1 with 2m (left) and 3m (right).

SciRE_v2 with 2m (left) and 3m (right).

DPM-Solver++ with 2m (left) and 3m (right).

TODO:

Acknowledgement

Our code is based on ScoreSDE and DPM-Solver.

Citation

If you find our work beneficial to you, please consider citing:

@article{li2023scireAD,
  title={SciRE-Solver: Accelerating Diffusion Models Sampling  by Score-integrand Solver with Recursive Difference},
  author={Li, Shigui and Chen, Wei and Zeng, Delu},
  journal={arXiv preprint arXiv:2308.07896},
  year={2023}
}

scire-solver's People

Contributors

shiguili avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Forkers

hoemr

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.