Allow always discarding of penultimate sigma and fix doing 1 less step than specified #6044
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Allows the user to specify if to always discard the penultimate/next-to-last sigma (regardless of the sampler), and makes it so even if you discard the step, you still do the amount of steps specified.
Currently, only the DPM2 (/a) samplers discard the penultimate sigma. However, the quality of other samplers can also be increased by doing the same. This is particularly noticeable if you are using a very low amount of steps (< 10) and are not using a suitably low CFG scale.
With DPM++ 2M Karras (7 steps, 9 CFG scale):
Not-discarding:
Discarding:
Particularly noticeable in the 2nd image across.
Also, currently if discarding the last step, it will sample one less step than the amount of steps specified (which also causes the progress bar to never fill). This is fixed by adding +1 to the steps when getting the sigmas if discarding.