deep-floyd / IF

Other
7.64k stars 497 forks source link

Faster sampling by DPM-Solver++ #38

Open LuChengTHU opened 1 year ago

LuChengTHU commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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