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 Karras Sigmas to all schedulers #2905

Closed
patrickvonplaten opened this issue Mar 30, 2023 · 7 comments
Closed

Add Karras Sigmas to all schedulers #2905

patrickvonplaten opened this issue Mar 30, 2023 · 7 comments
Assignees

Comments

@patrickvonplaten
Copy link
Contributor

Is your feature request related to a problem? Please describe.

As stated in multiple issue:

Describe the solution you'd like

It would be nice to be able to do:

scheduler = DPMSolverMultistepScheduler(use_karras_sigmas=True)

and

scheduler = DPMSolverMultistepScheduler.from_config(scheduler.config, use_karras_sigmas=True)

Describe alternatives you've considered
No alternative possible

Additional context
We have a nice PR: #2874 that solves this for the Karras stable diffusion pipeline, but it would be nice to have this for all native diffusion schedulers as well.

#2874 can be very nicely used for integration testing.

Also cc @sayakpaul @takuma104

@aandyw
Copy link
Contributor

aandyw commented Mar 31, 2023

Seems fun. Currently working on the LoRA tests PR but I'd like to take a crack at this if it's not urgent.

@sayakpaul
Copy link
Member

Seems like a requested feature. I will try to allocate some time next week. @patrickvonplaten, anything you have in mind regarding the design I should know? I think we should consider separate PRs for separate schedulers to help with the reviews and also to keep the PRs disentangled.

@pie31415 thanks so much for being willing to help! We deeply appreciate it. Let's see how we want to tackle this and based on that we can circle back :)

@aandyw
Copy link
Contributor

aandyw commented Mar 31, 2023

Looking forward to it!

@patrickvonplaten
Copy link
Contributor Author

Regarding design I think it'll be all about changing the sigmas here correctly:

sigmas = np.array(((1 - self.alphas_cumprod) / self.alphas_cumprod) ** 0.5)

In my opinion some kind of helper function that we can easily copy-paste to other schedulels like:

if use_karras_sigmas:
    sigmas = self.convert_to_karras(sigmas)

would make sense

@sayakpaul
Copy link
Member

#2956 could be a good reference PR to add use_karras_sigmas to the rest of the schedulers. Let's continue the discussion there.

@sayakpaul
Copy link
Member

Related PR: #3001

@sayakpaul
Copy link
Member

I think we have added support for Karras sigmas for all the most popular schedulers now. So, I think it's okay to close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants