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

fix noisy images at high step counts #1086

Merged
merged 1 commit into from
Oct 14, 2022
Merged

fix noisy images at high step counts #1086

merged 1 commit into from
Oct 14, 2022

Conversation

lstein
Copy link
Collaborator

@lstein lstein commented Oct 13, 2022

At step counts greater than ~75, the ksamplers start producing noisy images when using the Karras noise schedule. This PR reverts to using the model's own noise schedule, which eliminates the problem at the cost of slowing convergence at lower step counts.

This PR also introduces a new CLI --save_intermediates <n> argument, which will save every nth intermediate image into a subdirectory named intermediates/<image_prefix>.

Addresses issue #1083.

At step counts greater than ~75, the ksamplers start producing noisy
images when using the Karras noise schedule. This PR reverts to using
the model's own noise schedule, which eliminates the problem at the
cost of slowing convergence at lower step counts.

This PR also introduces a new CLI `--save_intermediates <n>' argument,
which will save every nth intermediate image into a subdirectory
named `intermediates/<image_prefix>'.

Addresses issue #1083.
@Neosettler
Copy link

Good catch lstein. This patch seems worthy of a new release.

@lstein
Copy link
Collaborator Author

lstein commented Oct 14, 2022

Good catch lstein. This patch seems worthy of a new release.

It wasn't me who caught it. It was the user who submitted issue #1083.

@lstein lstein merged commit e98fe9c into development Oct 14, 2022
@lstein lstein deleted the fix-noisy-images branch October 14, 2022 04:02
@db3000
Copy link
Contributor

db3000 commented Oct 14, 2022

Thanks for the quick fix!

@Neosettler
Copy link

The actual fix for the noisy image is in:
ldm/models/diffusion/ksampler.py just those 2 lines?
- self.sigmas = self.karras_sigmas
+self.sigmas = self.model_sigmas
+#self.sigmas = self.karras_sigmas

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.

None yet

4 participants