Stability-AI / stablediffusion

High-Resolution Image Synthesis with Latent Diffusion Models
MIT License
37.84k stars 4.88k forks source link

'alphas_prev' of the DDIM sampler should start with 1. #345

Open chenky9106 opened 8 months ago

chenky9106 commented 8 months ago

'alphas_prev' of the DDIM sampler here should start with 1. In the original implementation, 'alpha_prev' starts with 'alphacums[0]', which is close to but not 1.. and is not theoretically correct. 'alphacums_prev[0]' is 1. instead.

This will lead to noisy outputs of the diffusion model. I understand it has limited influence to the LDM framework, since generated latent variables are not directly visible. But I believe the model perform better if modified.