LaurentMazare / diffusers-rs

An implementation of the diffusers api in Rust
Apache License 2.0
521 stars 54 forks source link

[Bug fix] DDPM scheduler arbitrary infer steps count #47

Closed mspronesti closed 1 year ago

mspronesti commented 1 year ago

When I implemented the DDPM Scheduler (#21), I noticed that nothing below 1000 inference steps produced a "meaningful" image (with 1000 training timesteps). Basically I only had noise back. However, since this behavior was common to HF python version, we agreed it was "normal". Nevertheless, this morning HF people pubblished a fix to this scheduler, which contained in fact a bug when used with a number of inference steps smaller the number of training steps. This PR aims at porting this fix to diffusers-rs.

Example of produced images with 30 steps: image image

mspronesti commented 1 year ago

The failed check has to do with a file I haven't worked on in this PR. I think it's due to the fact that the latest version of clippy requires inlined variables in format strings. Should be easy to solve with cargo clippy --fix.

LaurentMazare commented 1 year ago

Thanks for the fix, and no worries re the clippy lint, I'll just run a clippy fix everywhere.