crowsonkb / k-diffusion

Karras et al. (2022) diffusion models for PyTorch
MIT License
2.26k stars 372 forks source link

DPM2 ancestral produce odd nosiy/sharpened output during final iteration when using with Stable Difussion #34

Closed Hakkin closed 1 year ago

Hakkin commented 1 year ago

Hi, I'm cross-posting this issue from https://github.com/AUTOMATIC1111/stable-diffusion-webui/issues/1435 since it seems like may be more relevant here.

Basically, when using DPM2a with the above Stable Diffusion UI, the output becomes "noisy" or like it had some kind of over sharpening filter applied to it during the final iteration. If you interrupt the image generation before the final pass, the output looks more or less normal.

Here's an example taken from the above issue: broken fixed

The top one is the default behavior, the bottom one is one I created by modifying sampler.py to skip the final DPM2 pass (effectively the same result you get when you interrupt the image generation).

Other people in the above issue have said there are similar issues with other samplers as well, but personally I've only confirmed it while using DPM2a.