Skip to content

[fix] VaeImageProcessor.resize method can take list as input #11863

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Net-Mist
Copy link

@Net-Mist Net-Mist commented Jul 4, 2025

What does this PR do?

Hello !

When working on Flux-Kontext, I discovered a silent bug regarding the resizing of the image, when calling the pipeline with several images.

  • The __call__ method of the FluxKontextPipeline class takes an image of type Optional[PipelineImageInput]. This variable can be a list in case of batch size > 1
  • then the resize method of the VaeImageProcessor class is called (image = self.image_processor.resize(image, image_height, image_width)). But this method does not support lists as input. Due to the way this method is written (overriding the image variable and then returning it), it doesn't resize the image and return it as-is.

In this fix, I corrected this by changing a minimal number of lines of code to handle lists. However, please let me know if you'd prefer that I also add additional input checks or safeguards.

Fixes # (issue)

Before submitting

Who can review?

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.

@Net-Mist
Copy link
Author

Net-Mist commented Jul 4, 2025

@yiyixuxu @asomoza
If I'm not mistaken, you are the 2 most relevant people for this PR. Else, sorry for the noise, and please redirect me to the right people

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.

1 participant