Description
Describe the bug
There is a bug in DDIMInverseScheduler.step related to how the previous timestep is computed.
The inverse scheduler should move from timestep
https://github.com/huggingface/diffusers/blob/89e4d6219805975bd7d253a267e1951badc9f1c0/src/diffusers/schedulers/scheduling_ddim_inverse.py#L327C1-L331C10
This should be corrected to ensure the inverse process aligns properly with the intended scheduling.
# 1. get previous step value (=t+1)
prev_timestep = min(
timestep + self.config.num_train_timesteps // self.num_inference_steps,
self.config.num_train_timesteps - 1
)
For comparison, DDIMScheduler correctly calculates
https://github.com/huggingface/diffusers/blob/89e4d6219805975bd7d253a267e1951badc9f1c0/src/diffusers/schedulers/scheduling_ddim.py#L401C1-L402C95
Reproduction
This issue is straightforward to verify, so a reproduction snippet is omitted.
Logs
System Info
diffusers==0.32.2