-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Update LCMScheduler Inference Timesteps to be More Evenly Spaced #5836
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Update LCMScheduler Inference Timesteps to be More Evenly Spaced #5836
Conversation
The solution I have currently implemented differs from the solution suggested in #5815 (comment) as follows:
|
(Also, note that the timestep schedule produced by |
I think we want to avoid the cases that 3-step sampling is very similar to 2-step sampling, which means that we don't want setting anchor for the first timesteps 19. For example, i think the schedule of 2-step [999, 499] is better than [999, 19]. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot for fixing this @dg845 , lgtm!
Will run some tests then we can merge.
The documentation is not available anymore as the PR was closed or merged. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I trust you here @patil-suraj
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you consider the previous timestep spacing a bug, I'm ok with the PR. If not and it's just a "different way" of doing timestep spacing, we should probably be careful about backwards breaking
Should we do more test? or just like @patrickvonplaten suggestion. We can just add |
I'm currently running the slow tests that we have. All the fast tests are passing. |
Thanks @patil-suraj ! |
Some slow tests are failing,
@patrickvonplaten would it be okay to adjust the tests in this case ? |
All slow LCM tests are now passing, I updated the images here https://huggingface.co/datasets/hf-internal-testing/diffusers-images/tree/main/lcm_lora |
…com/dg845/diffusers into lcm-scheduler-fix-timestep-schedule
…gingface#5836) * Change LCMScheduler.set_timesteps to pick more evenly spaced inference timesteps. * Change inference_indices implementation to better match previous behavior. * Add num_inference_steps=26 test case to test_inference_steps. * run CI --------- Co-authored-by: patil-suraj <surajp815@gmail.com>
…gingface#5836) * Change LCMScheduler.set_timesteps to pick more evenly spaced inference timesteps. * Change inference_indices implementation to better match previous behavior. * Add num_inference_steps=26 test case to test_inference_steps. * run CI --------- Co-authored-by: patil-suraj <surajp815@gmail.com>
…gingface#5836) * Change LCMScheduler.set_timesteps to pick more evenly spaced inference timesteps. * Change inference_indices implementation to better match previous behavior. * Add num_inference_steps=26 test case to test_inference_steps. * run CI --------- Co-authored-by: patil-suraj <surajp815@gmail.com>
What does this PR do?
This PR modifies
LCMScheduler.set_timesteps
to producetimesteps
which are more evenly spaced across the range of candidate timesteps, which should lead to better sample quality.Fixes #5815.
Before submitting
documentation guidelines, and
here are tips on formatting docstrings.
Who can review?
Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.
@patrickvonplaten
@patil-suraj
@aifartist
@luosiallen