ai-toolkit icon indicating copy to clipboard operation
ai-toolkit copied to clipboard

Incorrect control image dimension calculation on qwen_image_edit_plus

Open pft-JoeyYang opened this issue 3 weeks ago • 0 comments

This is for bugs only

Did you already ask in the discord?

No

You verified that this is a bug and not a feature request or question by asking in the discord?

Yes

Describe the bug

on L177-180 of qwen_image_edit_plus.py, I think the dimension resizing operations here is a bit odd: https://github.com/ostris/ai-toolkit/blob/26f4f0245332feb9253c49b56c555777ed52a0e6/extensions_built_in/diffusion_models/qwen_image/qwen_image_edit_plus.py#L177-L180

L177-178 showed that the aspect ratio was calculated with height / width, hence we could obtain the rescaled height via math.sqrt(CONDITION_IMAGE_SIZE * ratio), but the code seemed to be incorrect with the width and height calculation. This also happened across all the control image related dimension calculation: https://github.com/ostris/ai-toolkit/blob/26f4f0245332feb9253c49b56c555777ed52a0e6/extensions_built_in/diffusion_models/qwen_image/qwen_image_edit_plus.py#L259-L261

I wonder is this intended or its a bug?

pft-JoeyYang avatar Dec 05 '25 02:12 pft-JoeyYang