Skip to content

[img2img, inpainting] fix fp16 inference #769

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

Merged
merged 9 commits into from
Oct 7, 2022
Merged

Conversation

patil-suraj
Copy link
Contributor

@patil-suraj patil-suraj commented Oct 7, 2022

Fix inference for image2image and inpainting pipeline in fp16.

  • Make sure the the init_image and mask are put fp16
  • Create noise in fp16

Should be merged after #767

@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Oct 7, 2022

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

Copy link
Member

@pcuenca pcuenca left a comment

Choose a reason for hiding this comment

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

An end-to-end test doesn't work for me with both branches applied. I think we need to cast the inputs to both encode and decode in the VAE.

Copy link
Member

@NouamaneTazi NouamaneTazi left a comment

Choose a reason for hiding this comment

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

The changes I suggested seem to be already in #767. But I added them to make sure they stay nonetheless

@patrickvonplaten
Copy link
Contributor

Code looks good to me! If code works for @pcuenca then good to merge for me :-)

Copy link
Member

@pcuenca pcuenca left a comment

Choose a reason for hiding this comment

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

LGTM!

@pcuenca
Copy link
Member

pcuenca commented Oct 7, 2022

Tests look good too. Thanks a lot!

@patil-suraj patil-suraj merged commit 92d7086 into main Oct 7, 2022
@patil-suraj patil-suraj deleted the fix-img2img-fp16 branch October 7, 2022 15:01
patrickvonplaten pushed a commit that referenced this pull request Oct 11, 2022
* handle dtype in vae and image2image pipeline

* fix inpaint in fp16

* dtype should be handled in add_noise

* style

* address review comments

* add simple fast tests to check fp16

* fix test name

* put mask in fp16
prathikr pushed a commit to prathikr/diffusers that referenced this pull request Oct 26, 2022
* handle dtype in vae and image2image pipeline

* fix inpaint in fp16

* dtype should be handled in add_noise

* style

* address review comments

* add simple fast tests to check fp16

* fix test name

* put mask in fp16
yoonseokjin pushed a commit to yoonseokjin/diffusers that referenced this pull request Dec 25, 2023
* handle dtype in vae and image2image pipeline

* fix inpaint in fp16

* dtype should be handled in add_noise

* style

* address review comments

* add simple fast tests to check fp16

* fix test name

* put mask in fp16
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.

5 participants