LuChengTHU / dpm-solver

Official code for "DPM-Solver: A Fast ODE Solver for Diffusion Probabilistic Model Sampling in Around 10 Steps" (Neurips 2022 Oral)
MIT License
1.52k stars 120 forks source link

Worse in high guidance scale #50

Open yuhuUSTC opened 8 months ago

yuhuUSTC commented 8 months ago

Dear authors, Thank you for sharing this great work and open source! When following this work, I found that DPM-solver++ performs worse than DDIM under high classifier guidance scale, eg, scale=8 or 16. Concretely, under scale=8, the performance of DPM-solver++ approaches DDIM, and under scale=16, the performance of DDIM > DPM-solver++ > UniPC. Same issues alsp appy to UniPC.

Config: DPM-solver++ 2M, 50k samples

This contradicts the reported results in the paper. Thank you for your explanation and help.

LuChengTHU commented 6 months ago

Generally speaking, higher guidance scales will make the ODE ill-conditioned and higher-order solvers will become more and more unstable. The instability issue will be somehow eased with DPM++ because the property of data-pred model, but it cannot address it. So in my original paper I also applied dynamic thresholding to further reduce the condition numbers.

zxk72 commented 4 months ago

Hey fellows, really good work and thanks for sharing the code. @LuChengTHU Hello, I applied dpm-solver to guided diffusion, but the results were not satisfactory. Is this the same question you answered above? Would it be better to use SDE-based dpm-solver? Or is there a better solution? Looking forward for your reply, thank you!

LuChengTHU commented 4 months ago

Hi @zxk72 , did you use these commands?: https://github.com/LuChengTHU/dpm-solver/blob/52bc3fbcd5de56d60917b826b15d2b69460fc2fa/examples/ddpm_and_guided-diffusion/sample.sh#L38-L50

zxk72 commented 4 months ago

@LuChengTHU thank you for your reply! Sorry, I'm not using the example you provided. It is a diffusion medical segmentation project called MedSegDiff, which uses guided diffusion. The results after using dpm-solver have some noise, which is worse than the results without using it.