Skip to content

Add Singlestep DPM-Solver (singlestep high-order schedulers) - #1442

Merged
patrickvonplaten merged 9 commits into
huggingface:mainfrom
LuChengTHU:singlestep-dpm-solver
Dec 7, 2022
Merged

patrickvonplaten merged 9 commits into
huggingface:mainfrom
LuChengTHU:singlestep-dpm-solver

Conversation

@LuChengTHU

Copy link
Copy Markdown
Contributor

#1308

I've implemented the single-step high-order solvers in an elegant way. It is very similar to the implementations with the multi-step schedulers, and we do not need to modify pipelines.

If this implementation is fine for you, I will further add the tests and the flax version.

@HuggingFaceDocBuilderDev

Copy link
Copy Markdown

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint.

@LuChengTHU

Copy link
Copy Markdown
Contributor Author

Emmm, I don't know what happened with the tests...

@LuChengTHU

LuChengTHU commented Nov 27, 2022 •

Copy link
Copy Markdown
Contributor Author

Here are some of my own suggestions:

  1. For few-step guided sampling, I still recommend using multi-step DPM-Solver++.

  2. For obtaining a converged sample with a faster convergence rate, I recommend using single-step DPM-Solver++. (Because it has a convergence order guarantee).

Nevertheless, the difference between multi-step DPM-Solver++ and single-step DPM-Solver++ on stable-diffusion seems very small.

Overall, I don't have much experience with which one is better, and I hope the community can have some more findings.

@LuChengTHU

Copy link
Copy Markdown
Contributor Author

Here are some examples for comparing multi-step and single-step DPM-Solver++ (2nd order, midpoint):

1

2

3

4

@patrickvonplaten patrickvonplaten left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great to me @LuChengTHU - thanks a lot!

Could you maybe add some quick tests to tests/test_scheduler.py ?

@patrickvonplaten

Copy link
Copy Markdown
Contributor

Implementation is exactly in line with the current design so that's perfect :-)

@LuChengTHU

Copy link
Copy Markdown
Contributor Author

No problem. I will add tests and flax version implementations :)

@patrickvonplaten

Copy link
Copy Markdown
Contributor

Cool! Let me know if you need any help :-)

@patrickvonplaten
patrickvonplaten merged commit 8e74efa into huggingface:main Dec 7, 2022
tcapelle pushed a commit to tcapelle/diffusers that referenced this pull request Dec 12, 2022
…face#1442)

* add singlestep dpmsolver

* fix a style typo

* fix a style typo

* add docs

* finish

Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com>
sliard pushed a commit to sliard/diffusers that referenced this pull request Dec 21, 2022
…face#1442)

* add singlestep dpmsolver

* fix a style typo

* fix a style typo

* add docs

* finish

Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com>
yoonseokjin pushed a commit to yoonseokjin/diffusers that referenced this pull request Dec 25, 2023
…face#1442)

* add singlestep dpmsolver

* fix a style typo

* fix a style typo

* add docs

* finish

Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com>
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.

3 participants