of the scheduler function, one of epsilon (predicting the noise of the diffusion
process), sample (directly predicting the noisy sample) or v_prediction` (see section 2.4
https://imagen.research.google/video/paper.pdf)



Implements Algorithm 2 (Heun steps) from Karras et al. (2022). for discrete beta schedules. Based on the original
k-diffusion implementation by Katherine Crowson:
https://github.com/crowsonkb/k-diffusion/blob/481677d114f6ea445