TextEncodeQwenImageEditPlusPro lrzjason
5 reference images and a main-image dial
- clip
- vae
- image1
- image2
- image3
- image4
- image5
- conditioning_with_full_ref
- latent
- image1
- image2
- image3
- image4
- image5
- conditioning_with_main_ref
- pad_info
The headline reason to use this node is simple: it takes five reference images, and stock ComfyUI's TextEncodeQwenImageEditPlus only takes three. If you're doing person + product + scene compositions, or a garment swap that needs the person, the clean plate, and two angles of the outfit, three slots run out fast. This is the one that doesn't.
The other reason is the main_image_index. When you feed a model several references, it helps to tell it which one is the subject and which are supporting context. Pro lets you nominate the main reference, and then hands you two conditioning outputs - one that carries all the references, one that carries only the main one - so you can pick how focused the edit is without rebuilding the graph.
How it works
Qwen-Image-Edit reads each input image through both a Qwen2.5-VL semantic pass and the VAE appearance pass, and 2509 onward is explicitly built for multi-image editing (one to three inputs officially; this node stretches the plumbing to five). Pro encodes your prompt against whichever images you plug in, resizes the ones you list for the VL pass, and encodes the main image into the reference latent. The two conditioning outputs are the payoff: "full ref" gives the model everything, "main ref" narrows it to the subject so the supporting images inform without dominating.
The inputs and outputs that matter
Required: clip and prompt. Then:
- image1 through image5 - your references. Fill as many as you need.
- main_image_index - which image is the subject. It's 1-indexed, range 1-5, default 1 (the README's talk of a 0 default is wrong; trust the node). Point it at the picture you're actually editing.
- vl_resize_indexs - a comma-separated list of which images get VL-resized, default
"1,2,3". Again 1-indexed. This is how you say "resize the first three for the semantic pass, leave 4 and 5 alone." - target_size - VAE resolution: 1024 / 1344 / 1536 / 2048 / 768 / 512. Your quality/VRAM lever.
- crop_method -
pad/center/disabled;padkeeps the full frame and populates pad_info. - target_vl_size (384/392), upscale_method (lanczos/bicubic/area), instruction - leave at defaults unless you have a reason.
Outputs: conditioning_with_full_ref and conditioning_with_main_ref (pick your focus for the KSampler positive), latent (into latent_image), image1–image5 (the processed references), and pad_info (the ANY scale/pad dict for CropWithPadInfo).
Installing it
ComfyUI Manager, search Comfyui-QwenEditUtils, install, restart - or cd ComfyUI/custom_nodes && git clone https://github.com/lrzjason/Comfyui-QwenEditUtils and restart. No pip deps, no bundled models. You bring the Qwen-Image-Edit-2509/2511 checkpoint, the Qwen2.5-VL text encoder, and the VAE (GGUF/fp8 + a Lightning LoRA for consumer cards).
Common issues
Two indexing gotchas, both because the widgets are 1-indexed: point main_image_index at an empty slot and you'll condition on nothing useful; get vl_resize_indexs off by one and the wrong images get shrunk. There's also a known error people hit with the multi-image Qwen encoders - split_with_sizes expects split_sizes have only non-negative entries - which generally means your image and latent counts don't line up; make sure every image slot you reference actually has an image, and that main/vl indexes are within the set you plugged in. And the usual pack caveat: more reference images is more VRAM and more time (community reports run ~77s for one input, ~178s for three on a 16GB card before Lightning), and image scaling has shifted across pack versions, so pin one once your composition works.
Inputs (15)
| Name | Type | Default | Description |
|---|---|---|---|
| clip | CLIP | — | |
| prompt | STRING | — | |
| vaeopt | VAE | — | |
| image1opt | IMAGE | — | |
| image2opt | IMAGE | — | |
| image3opt | IMAGE | — | |
| image4opt | IMAGE | — | |
| image5opt | IMAGE | — | |
| vl_resize_indexsopt | STRING | 1,2,3 | — |
| main_image_indexopt | INT | 11–5 | — |
| target_sizeopt | COMBO | 1024 | 6 options: 1024, 1344, 1536, 2048, 768, 512 |
| target_vl_sizeopt | COMBO | 384 | 2 options: 392, 384 |
| upscale_methodopt | COMBO | 3 options: lanczos, bicubic, area | |
| crop_methodopt | COMBO | 3 options: pad, center, disabled | |
| instructionopt | STRING | Describe the key features of the input image (color, shape, size, texture, objects, background), then explain how the user's text instruction should alter or modify the image. Generate a new image that meets the user's requirements while maintaining consistency with the original input where appropriate. | — |
Outputs (9)
| Name | Type | Description |
|---|---|---|
| conditioning_with_full_ref | CONDITIONING | — |
| latent | LATENT | — |
| image1 | IMAGE | — |
| image2 | IMAGE | — |
| image3 | IMAGE | — |
| image4 | IMAGE | — |
| image5 | IMAGE | — |
| conditioning_with_main_ref | CONDITIONING | — |
| pad_info | ANY | — |