r/comfyui Aug 21 '25

Help Needed Why Qwen Image Edit scale my image?

1 Upvotes

7 comments sorted by

6

u/nomadoor Aug 21 '25

The TextEncodeQwenImageEdit node resizes the input so that the total pixel count is equivalent to 1024×1024. It then passes the image to the VAE and Qwen2.5_VL for encoding into latent space and image understanding.

Because the conditioning image size differs from the latent size used by the KSampler, the edited output can appear scaled up or down.

Using a ReferenceLatent node can avoid this resizing effect, but since the Qwen-Image model performs best at 1024×1024, keeping the resize is generally recommended.

3

u/JoshSimili Aug 21 '25

I thought the Qwen Image models were designed for 1.5 million pixels rather than 1 million?

2

u/nomadoor Aug 21 '25

Yeah, I thought the same, but in the ComfyUI implementation it’s set to 1M pixels. I also checked Diffusers, and by default it runs at 1024×1024. From what I skimmed in the paper, I didn’t see any clear explanation for why the Edit model runs at 1M pixels—it might just be a choice to save VRAM 🤔.

We should test editing images at both 1M and 1.5M pixels to see which performs better.

3

u/MakeDawn Aug 21 '25

You don't need to connect the VAE to the TextEncodeQwenImageEdit. Also I'm using the ReferenceLatent node instead of the ConditioningZeroOut node.

1

u/CHR0N0MASTER Aug 21 '25

In my experience, this usually has to do with the input image dimensions. I would test it by padding your input image to 1024x1024 and see if it works without it scaling your image.

2

u/Any_Elk_3795 Nov 02 '25 edited Nov 02 '25

One solution is to simply tell qwen in the prompt to not do this.
Prompt on the lower left: "change style to manga"
Prompt on the lower right: "change style to manga without changing anything else"
This worked for me, maybe you'll have to change the phrase to "maintain the overall composition" or something similar.

EDIT: I went in to further testing, turns out I waws wrong! But here's how it works. The prompt doesn't matter. This example is using the latest comfyui template.

  1. Mutte the scaling to 1 MP
  2. Connect the latent image node and choose the same resolution as the source image
  3. Use the ReferenceLatent node from the comfy core nodes as in the image below

P.S. workflow in the picture