-
Notifications
You must be signed in to change notification settings - Fork 6.3k
[schedulers] hanlde dtype in add_noise #767
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
Conversation
The documentation is not available anymore as the PR was closed or merged. |
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.
Thanks!
@patil-suraj should i add tests for fp16 schedulers? |
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.
LGTM :)
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.
I believe that
if self.alphas_cumprod.dtype != original_samples.dtype:
self.alphas_cumprod = self.alphas_cumprod.to(original_samples.dtype)
is equivalent to just doing
self.alphas_cumprod = self.alphas_cumprod.to(original_samples.dtype)
Same for device
. And that could cut off the lines of code quite a bit
Removed the if as suggested by @NouamaneTazi ! The |
According to this comment it may have a penalty https://github.com/huggingface/diffusers/pull/511/files#r987896215. Is there any way we can now for sure? |
* handle dtype in vae and image2image pipeline * handle dtype in add noise * don't modify vae and pipeline * remove the if
* handle dtype in vae and image2image pipeline * handle dtype in add noise * don't modify vae and pipeline * remove the if
* handle dtype in vae and image2image pipeline * handle dtype in add noise * don't modify vae and pipeline * remove the if
Make sure that the
alphas/sigmas
have the samedtype
as the input samples.