-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
Support LMSDiscreteScheduler in LDMPipeline #891
Conversation
This is a small change to support all schedulers such as LMSDiscreteScheduler in LDMPipeline. What's changed ------- * Add the `scale_model_input` function before `step` to ensure correct denoising (L77)
The documentation is not available anymore as the PR was closed or merged. |
This looks good to me! @anton-l could you also give it a quick review :-) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great idea @mkshing, thank you!
You'll just need one more modification to make it work with LMS-like schedulers:
latents = torch.randn(
(batch_size, self.unet.in_channels, self.unet.sample_size, self.unet.sample_size),
generator=generator,
)
latents = latents.to(self.device)
+ # scale the initial noise by the standard deviation required by the scheduler
+ latents = latents * self.scheduler.init_noise_sigma
Happy to merge your PR after that :)
@patrickvonplaten @anton-l Thank you for your review! I added 2 lines as #891 (review)! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, thanks @mkshing!
Great PR - thanks @mkshing :-) |
Co-authored-by: Elias Joseph <elias@nod-labs.com>
* Support LMSDiscreteScheduler in LDMPipeline This is a small change to support all schedulers such as LMSDiscreteScheduler in LDMPipeline. What's changed ------- * Add the `scale_model_input` function before `step` to ensure correct denoising (L77) * Add "scale the initial noise by the standard deviation required by the scheduler" * run `make style` Co-authored-by: Anton Lozhkov <anton@huggingface.co>
Hi, thank you for such a great repo. This is a small change to support all schedulers such as LMSDiscreteScheduler in LDMPipeline.
What's changed
scale_model_input
function beforestep
to ensure correct denoising (L77)