diffusers icon indicating copy to clipboard operation
diffusers copied to clipboard

Add Singlestep DPM-Solver (singlestep high-order schedulers)

Open LuChengTHU opened this issue 1 year ago • 6 comments

#1308

I've implemented the single-step high-order solvers in an elegant way. It is very similar to the implementations with the multi-step schedulers, and we do not need to modify pipelines.

If this implementation is fine for you, I will further add the tests and the flax version.

LuChengTHU avatar Nov 27 '22 16:11 LuChengTHU

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint.

Emmm, I don't know what happened with the tests...

LuChengTHU avatar Nov 27 '22 16:11 LuChengTHU

Here are some of my own suggestions:

  1. For few-step guided sampling, I still recommend using multi-step DPM-Solver++.

  2. For obtaining a converged sample with a faster convergence rate, I recommend using single-step DPM-Solver++. (Because it has a convergence order guarantee).

Nevertheless, the difference between multi-step DPM-Solver++ and single-step DPM-Solver++ on stable-diffusion seems very small.

Overall, I don't have much experience with which one is better, and I hope the community can have some more findings.

LuChengTHU avatar Nov 27 '22 17:11 LuChengTHU

Here are some examples for comparing multi-step and single-step DPM-Solver++ (2nd order, midpoint):

1

2

3

4

LuChengTHU avatar Nov 27 '22 17:11 LuChengTHU

Implementation is exactly in line with the current design so that's perfect :-)

patrickvonplaten avatar Nov 30 '22 12:11 patrickvonplaten

No problem. I will add tests and flax version implementations :)

LuChengTHU avatar Nov 30 '22 12:11 LuChengTHU

Cool! Let me know if you need any help :-)

patrickvonplaten avatar Dec 01 '22 17:12 patrickvonplaten