Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow always discarding of penultimate sigma and fix doing 1 less step than specified #6044

Merged

Conversation

hentailord85ez
Copy link
Collaborator

@hentailord85ez hentailord85ez commented Dec 26, 2022

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:
2mka-no-discard

Discarding:
2mka-discard

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.

@cluder
Copy link
Contributor

cluder commented Dec 27, 2022

seems to work, its most noticeable as you said with very low steps < 15 or 15, and it seems DPM++ 2M (non-karras) profits a lot from it.
To easier test it, we can add 'always_discard_next_to_last_sigma' to the Quicksettings list

@eaglgenes101
Copy link
Contributor

Are there cases where it's bad to do this discard? (Besides backwards compatibility, maybe)

@hentailord85ez
Copy link
Collaborator Author

Are there cases where it's bad to do this discard? (Besides backwards compatibility, maybe)

If you are already using a reasonable CFG for the number of steps you are using, it can reduce detail in the generation. On larger step sizes, this doesn't matter.

@AUTOMATIC1111
Copy link
Owner

There is an issue with adding a lot of settings which would make reproduction more difficult since you wouldn't remember if this or that particular setting was on or off, so adding this is not 100% free. Let's see if there is more interest in this before merging in the setting.

@aliencaocao
Copy link
Contributor

Just here to add that I am interested to see this merged

@AUTOMATIC1111 AUTOMATIC1111 merged commit c53852e into AUTOMATIC1111:master Jan 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants