...     latents = scheduler.step(noise_pred, t, latents).prev_sample  Decode the image The final step is to use the vae to decode the latent representation into an image and get the decoded output with sample:   Copied # scale and decode the image latents with vae