divamgupta / stable-diffusion-tensorflow

Stable Diffusion in TensorFlow / Keras
Other
1.57k stars 227 forks source link

sigma_t always 0 => no noise being added? #21

Closed matpalm closed 1 year ago

matpalm commented 1 year ago

noticed in get_x_prev_and_pred_x0 that sigma_t is always set to 0. which means the later noise calculation will always be zero at

https://github.com/divamgupta/stable-diffusion-tensorflow/blob/master/stable_diffusion_tf/stable_diffusion.py#L124

furthermore noise is never used ? ( which means that the temperature is not used either )

i notice in the DDIMSampler (and PLMS) that noise is usually added to x_prev e.g.

https://github.com/CompVis/stable-diffusion/blob/main/ldm/models/diffusion/ddim.py#L203

not sure if this is a bug (in which case it should be added) or if it's not required for inference? (in which case the noise and sigma can just be removed from code)

StephenJHardy commented 1 year ago

Hi @matpalm - did you ever get a clear explanation as to by sigma_t = 0? It doesn't seems to be denoising diffusion if this is zero.