IF icon indicating copy to clipboard operation
IF copied to clipboard

Faster sampling by DPM-Solver++

Open LuChengTHU opened this issue 1 year ago • 2 comments

Congrats! Super great work!

I've noticed that you're currently using the original DDPM scheduler, which is rather slow. It would be much faster if we could apply DPM-Solver++ into this work to accelerate the sampling.

Note that the original DPM-Solver++ may have numerical issues when using the cosine beta schedule, and I've added a fix here: https://github.com/LuChengTHU/dpm-solver/blob/5c6ee9f1e6b60c8c54f955fbaab0a6717fc2b75b/dpm_solver_pytorch.py#L105

I'm happy to help to integrate DPM-Solver++ into IF when the model is released :)

LuChengTHU avatar Apr 28 '23 15:04 LuChengTHU

Here is an example code for applying DPM-Solver++ with cosine beta schedule:

https://github.com/LuChengTHU/dpm-solver/blob/5c6ee9f1e6b60c8c54f955fbaab0a6717fc2b75b/examples/ddpm_and_guided-diffusion/sample.sh#L22-L33

The model is the original improved-ddpm, which is the work that firstly introduces the cosine beta schedule.

LuChengTHU avatar Apr 28 '23 15:04 LuChengTHU

Here are some example images with "sde-dpmsolver++" in stage-1, and "dpmsolver++" in stage-2 and stage-3:

https://github.com/huggingface/diffusers/pull/3344

LuChengTHU avatar May 05 '23 14:05 LuChengTHU