-
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
FluxPipeline silently rounds the generated image shape #9904
Comments
For the record, on the
This happens for all sizes which are not multiple of 16. Checking out the recent PRs I found this one which seems to change what I was pointing out in the comment above. |
Hi @albertochimentiinbibo thanks for catching this. You're right the FluxPipeline is meant to work with images that are multiples of 16. The I'll open a PR to fix. We'll also raise a warning that the image will be resized to a compatible height, width. |
Thank you for the feedback @DN6 will be waiting on the fix! |
Describe the bug
When prompting the FluxPipeline class to generate an image with shape
(1920, 1080)
, the output image shape is rounded to(1920, 1072)
which to me seems like the nearest multiple of 16 instead of 8.As the FluxPipeline class accepts input sizes divisible by 8 I would expect them to remain consistent throught the generation process.
By giving a quick look at the code it seems that in the
FluxPipeline._unpack_latents
method, the height and width are floor divided (//
) by thevae_scale_factor
which is 16.I would love to understand why the scale factor is set like the following:
https://github.com/huggingface/diffusers/blob/89e4d6219805975bd7d253a267e1951badc9f1c0/src/diffusers/pipelines/flux/pipeline_flux.py#L197C9-L199C10
Reproduction
Here is the minimal code to reproduce the bug, feel free to change the number of inference steps as it should not influence the scope of the test.
Logs
System Info
Who can help?
@sayakpaul @DN6
The text was updated successfully, but these errors were encountered: