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

[PNDM] Stable diffusion #186

Merged
merged 2 commits into from
Aug 16, 2022
Merged

[PNDM] Stable diffusion #186

merged 2 commits into from
Aug 16, 2022

Conversation

patrickvonplaten
Copy link
Contributor

@patrickvonplaten patrickvonplaten commented Aug 16, 2022

This PR allows to use the PNDM scheduler without the prk steps so that it matches 1-to-1 @crowsonkb implementation as shown here.

As soon as a new diffusers version is released, we have to add a flag "skip_prk_ steps" to all stable diffusion configs.

@patrickvonplaten patrickvonplaten changed the title [PNDM] Stable diffusino [PNDM] Stable diffusion Aug 16, 2022
@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Aug 16, 2022

The documentation is not available anymore as the PR was closed or merged.

@@ -56,6 +56,7 @@ def __init__(
beta_end=0.02,
beta_schedule="linear",
tensor_format="pt",
skip_prk_steps=False,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This should default to True for all stable diffusion models

Copy link
Member

@anton-l anton-l left a comment

Choose a reason for hiding this comment

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

Great refactor, thank you Patrick!

Comment on lines +206 to +209
elif len(self.ets) == 3:
model_output = (23 * self.ets[-1] - 16 * self.ets[-2] + 5 * self.ets[-3]) / 12
else:
model_output = (1 / 24) * (55 * self.ets[-1] - 59 * self.ets[-2] + 37 * self.ets[-3] - 9 * self.ets[-4])
Copy link
Member

Choose a reason for hiding this comment

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

Now it looks much more familiar :D

@patrickvonplaten
Copy link
Contributor Author

Tests are passing - merging now!

@patrickvonplaten patrickvonplaten merged commit 194ed79 into main Aug 16, 2022
@patrickvonplaten patrickvonplaten deleted the add_stable_diffusion_pndm branch August 16, 2022 13:33
PhaneeshB pushed a commit to nod-ai/diffusers that referenced this pull request Mar 1, 2023
Make PyTorch model tests importer-independent and add benchmarks.
yoonseokjin pushed a commit to yoonseokjin/diffusers that referenced this pull request Dec 25, 2023
* [PNDM] Stable diffusino

* finish
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