-
Couldn't load subscription status.
- Fork 6.5k
Fixed incorrect width/height assignment in StableDiffusionDepth2ImgPi… #2558
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
…peline when passing in tensor
|
The documentation is not available anymore as the PR was closed or merged. |
|
@patil-suraj could you check this? |
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.
@antoche can you give a bit more background why this change, I'm a bit surprised that we need this. Usually height and width are in the same order whether it's PIL or not
|
Hi Patrick, the image layout on torch tensors is BxCxHxW, so This change fixes this bug and makes the code consistent with the rest of the diffusers, see for example
|
|
Hey @antoche, Thanks a lot for explaining further - you're 100% right! For future reference, in import numpy as np
import PIL.Image
height = 384
width = 512
image_np = np.ones(height, width, 3)
image = PIL.Image.fromarray(image_np)
image.sive
# gives (512, 384) => (width, height)cc @yiyixuxu (this might also be important for the VAE refactor PR) Thanks a lot for the PR @antoche ! |
huggingface#2558) Fixed incorrect width/height assignment in StableDiffusionDepth2ImgPipeline when passing in tensor
huggingface#2558) Fixed incorrect width/height assignment in StableDiffusionDepth2ImgPipeline when passing in tensor
huggingface#2558) Fixed incorrect width/height assignment in StableDiffusionDepth2ImgPipeline when passing in tensor
…peline when passing in tensor