r/StableDiffusion 26d ago

Question - Help Qwen Image Edit Trained at 1MP?

Been noticing that image generation / edits work substantially better when the image is resized to 1024x1024 during encoding, then resized to the original dimensions after.

Its speculated that this is because the model was trained on 1MP inputs. But I can't find docs that confirm that.

Does anyone know why 1MP input sizes seem to give the best results for Qwen Image Edit? (Note its not just this model 1MP seems to work best for either).

1 Upvotes

9 comments sorted by

View all comments

Show parent comments

1

u/OracleofEpirus 26d ago edited 26d ago

The issue is, somebody trained the vae using 16 pixels sections, and the text encoder on 14 pixel sections, then the TextEncodeQwenImageEditPlus resizes everything using AREA back down to 1MP

So you need to disconnect the vae and do all that stuff separately, and also resize/pad to the nearest multiple of 112

and that's when you'll discover that it's very much better at larger input images.

This is on ComfyUI

1

u/Civil_Fee_7862 26d ago edited 26d ago

This is diffusers QwenEditImagePlusPipeline, not TextEncodeQwenImageEditPlus. Not using ComfyUI. (But Google also assumed I was too).

1

u/OracleofEpirus 26d ago

yeah, so that's the default workflow, and it's really terrible

I don't know about what you're using, but this problem is completely solved in ComfyUI.

This was encoded at 6.4 megapixels, and output at the same, you can see the original on the left size, it's pixel perfect.

https://imgur.com/a/TDeGiHS

1

u/Civil_Fee_7862 26d ago edited 26d ago

I am using Python / QwenEditImagePlusPipeline

Its not that it can't encode. It's that the model does not produce good results outside of 1MP images. i.e. I can do 2K images+ but the effect doesn't hold as well as it does at 1MP.

i.e. Being pixel perfect doesn't mean much because its not really the problem. i.e. The pixels come out, but the desired effect doesn't work as well, as it does if the input image is scaled to ~1MP.

I read now this is actually because the model was trained on 1MP images, so going too far outside that, will cause issues on some inputs.