Repository navigation
Add DPM-Solver++(2M) diffusion sampler #1896
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
Closed
Closed
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.
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.
Why is this needed? The new solver should work for any noise schedule that is of the linear-gaussian form
x_t = alpha_t * x_0 + sigma_t * epsilon. I think it would be better (and not very difficult) to generalize its implementation to make it work for any schedule(alpha_t, sigma_t)(and not just(1, t)), rather than adding edge cases and checks.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.
You are right, the implementation can be generalized using the scheduler’s
alpha,sigmaand their derivativesalpha_dotandsigma_dot. These provide the schedule values needed by the update and allow the solver to recover the data prediction from the denoiser’s ODE output. I can letsample()pass them when constructingdpmpp_2m, making the string API work with every linear-Gaussian scheduler. I would then remove the EDM-only checks and detect the final step usingsigma_next == 0.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.
Yes, I think that would make sense.
For broader context, we have other noise schedules that we might merge soon, so we don't want to have this new solver compatible with EDM but not with those.
Just a detail:
This would work, but is a little bit cumbersome in terms of API for
sample(), because one would have to pass allsigma,alphaand their derivative to thesample()(which itself needs to pass them to the constructor of the solver). But that's more a detail, you can go for this and I'll try to think of a more elegant way to handle this in thesample()API.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.
The new commit generalizes the solver using
alpha,sigmaand their derivatives from the noise scheduler. Whendpmpp_2mis selected by name,sample()configures it automatically. I have removed the EDM-only attribute and checks.