-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
StableDiffusion3Img2ImgPipeline.__call__() is missing width and height parameters #9933
Comments
As far as I understand it, Adding any required resizing prior to sending the image to the pipeline should yield what you're looking for! |
@ghunkins I was hoping to be able to specify an output image size that differs from the input image size, but I'll do a bit more research into how to achieve this. |
Interestingly, FLUX has no such limitation in their FluxImg2ImgPipeline. |
Hi, what would be the use case of using a different If the others had it (img2img) and there's a genuine use case maybe we can add it. |
To your point, resizing the image for the best sizes that FLUX supports
would be the main reason taking into account aspect ratios.
Based on a post I saw on Reddit which made sense, these are the best sizes
to use for FLUX (divisible by 64 H X W):
aspect_ratio == '1:1 1024 x 1024':
aspect_ratio == '1:1 1408 x 1408':
aspect_ratio == '3:2 1728 x 1152':
aspect_ratio == '4:3 1664 x 1216':
aspect_ratio == '16:9 1920 x 1088':
aspect_ratio == '21:9 2176 x 960':
aspect_ratio == '2:3 1152 x 1728':
aspect_ratio == '3:4 1216 x 1664':
aspect_ratio == '9:16 1088 x 1920':
…On Fri, Nov 15, 2024 at 12:12 PM Álvaro Somoza ***@***.***> wrote:
Hi, what would be the use case of using a different width and height.
That only will result in a distorted image if they don't match the source
image, why people would want that?
If the others had it (img2img) and there's a genuine use case maybe we can
add it.
—
Reply to this email directly, view it on GitHub
<#9933 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AZTE5IBQUS3SZ3FZW6GMX232AYTRDAVCNFSM6AAAAABR2HUWS6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINZZGQ3DKNBVGA>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
@chie2727 Here is some documentation from https://pillow.readthedocs.io/en/stable/reference/ImageOps.html#resize-relative-to-a-given-size from PIL import ImageOps
required_size = (1024, 512)
resized_input_image = ImageOps.fit(input_image, required_size)
image = pipe(
prompt="Resize the input image",
image=resized_input_image,
strength=0.5,
).images[0] |
@ukaprch but this is for SD3 and not Flux, also I agree that there are some resolutions that works best for the models but that only make sense using the txt2img pipelines, with img2img as @ghunkins pointed out, people should resize the source image before feeding it to the pipeline, otherwise the generated image will be distorted. |
I agree with you, the sizes I showed are for Flux. |
Describe the bug
The docstring for the
StableDiffusion3Img2ImgPipeline.__call__()
function includeswidth
andheight
parameters, but the function itself does not include these parameters.Is this a typo or is width and height supposed to be handled by the function?
Source file:
diffusers/src/diffusers/pipelines/stable_diffusion_3/pipeline_stable_diffusion_3_img2img.py
Reproduction
Logs
System Info
Who can help?
@yiyixuxu @sayakpaul
The text was updated successfully, but these errors were encountered: