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

Add exponential scheduler variant to sampler selection for DPM-Solver++(2M) SDE sampler #12300

Merged
merged 1 commit into from
Aug 4, 2023

Conversation

catboxanon
Copy link
Collaborator

@catboxanon catboxanon commented Aug 4, 2023

Description

The exponential scheduler for this particular sampler produces better results than Karras. This was pointed out directly by the author of this sampler. This was already doable via #10649 but this makes using this "variant" of the sampler to make comparisons with the XYZ plot and non-interfering use with the hires sampler override possible (the option in settings overrides the scheduler for all samplers). I'd also say it makes the fact that Karras is not the only scheduler more discoverable.

Related discussion:
https://gist.github.com/crowsonkb/3ed16fba35c73ece7cf4b9a2095f2b78
crowsonkb/k-diffusion#59

Screenshots/videos:

example

Checklist:

@catboxanon catboxanon changed the title Add exponential scheduler variant to dropdown for DPM-Solver++(2M) SDE sampler Add exponential scheduler variant to sampler selection for DPM-Solver++(2M) SDE sampler Aug 4, 2023
@AUTOMATIC1111 AUTOMATIC1111 merged commit 01486f6 into AUTOMATIC1111:dev Aug 4, 2023
3 checks passed
brkirch pushed a commit to brkirch/stable-diffusion-webui that referenced this pull request Aug 4, 2023
Add exponential scheduler variant to sampler selection for DPM-Solver++(2M) SDE sampler
@KohakuBlueleaf
Copy link
Collaborator

@catboxanon
Copy link
Collaborator Author

Already pointed that out in my PR. I also mentioned a few reasons why I'm making it a "separate" sampler. If you think there's a better way to handle it that also makes what I mentioned doable (xyz plot, hires sampler) then I'd open a separate PR.

@KohakuBlueleaf
Copy link
Collaborator

for hires sampler that is make sense though
For xyz plot you already can choose different scheduler I think.

And in my opinion, we defintely need seperate settings on custom scheduler for hires fix.
or we may need to implement ALL the variants to ALL the k_diffusion sampler.

for example, I always use polyexp with rho 0.666 for t2i and exp for i2i
so yes, I cannot do this in hires fix.
And yes, yours cannot either

@catboxanon
Copy link
Collaborator Author

catboxanon commented Aug 5, 2023

Yeah, this sampler was the only one that I know of that technically should default to this, which is why I made it available. The other two shouldn't even be available in the dropdown (if we're going with the assumption we only provide known good sampler configurations to users, i.e. how we fix some samplers to always discard the last sigma). Realistically speaking the Karras "variants" and this "variant" shouldn't exist in the dropdown in the first place, but auto has already said he wants to leave them there.

You can modify the scheduler in the XYZ plot but it requires a separate axis if you want to compare with other samplers easily (i.e., if you want to compare Euler and DPM++ 2M SDE with the exponential scheduler, and only those two, and this PR didn't exist, you would need to generate 4 images rather than 2).

I think the only way you could provide the sort of control you want while being able to use it as a "separate" sampler would be to implement some sort of sampler preset creator, and those get added to the sampler selection.

@KohakuBlueleaf
Copy link
Collaborator

Yeah, this sampler was the only one that I know of that technically should default to this, which is why I made it available. The other two shouldn't even be available in the dropdown (if we're going with the assumption we only provide known good sampler configurations to users, i.e. how we fix some samplers to always discard the last sigma). Realistically speaking the Karras "variants" and this "variant" shouldn't exist in the dropdown in the first place, but auto has already said he wants to leave them there.

You can modify the scheduler in the XYZ plot but it requires a separate axis if you want to compare with other samplers easily (i.e., if you want to compare Euler and DPM++ 2M SDE with the exponential scheduler, and only those two, and this PR didn't exist, you would need to generate 4 images rather than 2).

I think the only way you could provide the sort of control you want while being able to use it as a "separate" sampler would be to implement some sort of sampler preset creator, and those get added to the sampler selection.

Actually that's what I want to say... but backward compatibility may be bad
What I think is something like you said and with some preset (like 2M SDE with exponential)
the problem is it is hard to keep backward compatibility with old info text

@KohakuBlueleaf
Copy link
Collaborator

Yeah, this sampler was the only one that I know of that technically should default to this, which is why I made it available. The other two shouldn't even be available in the dropdown (if we're going with the assumption we only provide known good sampler configurations to users, i.e. how we fix some samplers to always discard the last sigma). Realistically speaking the Karras "variants" and this "variant" shouldn't exist in the dropdown in the first place, but auto has already said he wants to leave them there.

You can modify the scheduler in the XYZ plot but it requires a separate axis if you want to compare with other samplers easily (i.e., if you want to compare Euler and DPM++ 2M SDE with the exponential scheduler, and only those two, and this PR didn't exist, you would need to generate 4 images rather than 2).

I think the only way you could provide the sort of control you want while being able to use it as a "separate" sampler would be to implement some sort of sampler preset creator, and those get added to the sampler selection.

But I also need to say, I have got some infos like " CLIP guided diffusion should use polyexp + rho 2/3"
So actually it is really hard to say the "technically should default to this" for every sampler. (like, DPM++ all with exponential? or only 2M SDE? why?)

I think the better way is customizable sampler. If we can figure out the infotext format and backward compatibility

@w-e-w w-e-w mentioned this pull request Aug 24, 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.

4 participants