diffusers icon indicating copy to clipboard operation
diffusers copied to clipboard

Add the SDE variant of DPM-Solver and DPM-Solver++ to DPM Single Step

Open cmdr2 opened this issue 1 year ago • 21 comments

Following up on our conversation at https://github.com/huggingface/diffusers/issues/4167#issuecomment-1648464442

Uses the same approach as https://github.com/huggingface/diffusers/pull/3344/files

Note: This PR is not ready to merge yet, since it's not clear whether to use sigma_s0 or sigma_s1 in the second-order update. There is a discrepancy between the implementations of single-step and multi-step for second-order.

The current Single Step implementation uses sigma_s1 for the second-order update: https://github.com/huggingface/diffusers/blob/45f6d52b109604d6754ffefa9e289acd1df92994/src/diffusers/schedulers/scheduling_dpmsolver_singlestep.py#L503

While the reference PR for Multi Step uses sigma_s0 for the second-order update: https://github.com/huggingface/diffusers/pull/3344/files#diff-517cce3913a4b16e1d17a0b945a920e400aa5553471df6cd85f71fc8f079b4b4R478

@patrickvonplaten I don't know which is the correct one. Is it a bug in multi-step, or single-step, or should I use sigma_s1 for single-step?

The test doesn't pass right now due to this error, I intentionally left the code in this state.

Thanks!

cmdr2 avatar Jul 25 '23 02:07 cmdr2

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

Gently pinging the OG DPM author @LuChengTHU

Do you have an idea here by any chance? :-)

patrickvonplaten avatar Jul 25 '23 11:07 patrickvonplaten

Hi all, just see this cool PR! Thank you for the effort! The single-step sde-dpm++ may be a bit tricky and I need to carefully check this PR. Please give me some more time :)

LuChengTHU avatar Jul 25 '23 11:07 LuChengTHU

Thanks @LuChengTHU ! :)

The second-order update confuses me - in DPM Single Step it divides by the second-last timestep, while in DPM Multi Step it divides by the last timestep. Not sure if that's intentional.

Single Step:

https://github.com/huggingface/diffusers/blob/45f6d52b109604d6754ffefa9e289acd1df92994/src/diffusers/schedulers/scheduling_dpmsolver_singlestep.py#L491 https://github.com/huggingface/diffusers/blob/45f6d52b109604d6754ffefa9e289acd1df92994/src/diffusers/schedulers/scheduling_dpmsolver_singlestep.py#L503

Multi Step:

https://github.com/huggingface/diffusers/blob/45f6d52b109604d6754ffefa9e289acd1df92994/src/diffusers/schedulers/scheduling_dpmsolver_multistep.py#L508 https://github.com/huggingface/diffusers/blob/45f6d52b109604d6754ffefa9e289acd1df92994/src/diffusers/schedulers/scheduling_dpmsolver_multistep.py#L520

Thanks for your help!

cmdr2 avatar Jul 25 '23 15:07 cmdr2

This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the contributing guidelines are likely to be ignored.

github-actions[bot] avatar Aug 24 '23 15:08 github-actions[bot]

Sorry for the delay. will check it soon

LuChengTHU avatar Aug 24 '23 15:08 LuChengTHU

This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the contributing guidelines are likely to be ignored.

github-actions[bot] avatar Oct 18 '23 15:10 github-actions[bot]

This PR is actually an important one - @yiyixuxu can you try taking this over?

patrickvonplaten avatar Oct 18 '23 20:10 patrickvonplaten

This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the contributing guidelines are likely to be ignored.

github-actions[bot] avatar Nov 20 '23 15:11 github-actions[bot]

Not stale

cmdr2 avatar Nov 21 '23 05:11 cmdr2

Gentle ping here @yiyixuxu

patrickvonplaten avatar Nov 21 '23 14:11 patrickvonplaten

Gentle ping again @yiyixuxu

patrickvonplaten avatar Jan 02 '24 13:01 patrickvonplaten

Gentle ping @yiyixuxu

patrickvonplaten avatar Jan 30 '24 09:01 patrickvonplaten

This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the contributing guidelines are likely to be ignored.

github-actions[bot] avatar Feb 23 '24 15:02 github-actions[bot]

It has been on my to-do list for a while, but I don't have time for it right now. If anyone in the community wants to take a shot, feel free! This is an important feature to add.

yiyixuxu avatar Feb 23 '24 20:02 yiyixuxu

This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the contributing guidelines are likely to be ignored.

github-actions[bot] avatar Mar 19 '24 15:03 github-actions[bot]

Don't think this is stale

Scorpinaus avatar Mar 19 '24 15:03 Scorpinaus

This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the contributing guidelines are likely to be ignored.

github-actions[bot] avatar Apr 13 '24 15:04 github-actions[bot]

This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the contributing guidelines are likely to be ignored.

github-actions[bot] avatar May 13 '24 15:05 github-actions[bot]

I want to work on continuing this PR if it is OK.

tolgacangoz avatar May 15 '24 16:05 tolgacangoz

@standardAI please!!

yiyixuxu avatar May 15 '24 17:05 yiyixuxu

This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the contributing guidelines are likely to be ignored.

github-actions[bot] avatar Sep 14 '24 15:09 github-actions[bot]

this was continued and merged in another PR, so closing, if you feel there's something missing please feel free to open an issue about it.

asomoza avatar Sep 16 '24 14:09 asomoza