Nodes/Comfyui-QwenEditUtils/TextEncodeQwenImageEditPlusPro lrzjason
ComfyUI Node

TextEncodeQwenImageEditPlusPro lrzjason

5 reference images and a main-image dial

By lrzjason·Created 11 months ago·Updated 6 months ago· 834
TextEncodeQwenImageEditPlusPro lrzjason
  • clip
  • vae
  • image1
  • image2
  • image3
  • image4
  • image5
  • conditioning_with_full_ref
  • latent
  • image1
  • image2
  • image3
  • image4
  • image5
  • conditioning_with_main_ref
  • pad_info
prompt
vl_resize_indexs1,2,3
main_image_index1
target_size1024
target_vl_size384
upscale_method
crop_method
instructionDescribe 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.

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; pad keeps 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), image1image5 (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.

Categoryadvanced/conditioning

Inputs (15)

NameTypeDefaultDescription
clipCLIP
promptSTRING
vaeoptVAE
image1optIMAGE
image2optIMAGE
image3optIMAGE
image4optIMAGE
image5optIMAGE
vl_resize_indexsoptSTRING1,2,3
main_image_indexoptINT11–5
target_sizeoptCOMBO10246 options: 1024, 1344, 1536, 2048, 768, 512
target_vl_sizeoptCOMBO3842 options: 392, 384
upscale_methodoptCOMBO3 options: lanczos, bicubic, area
crop_methodoptCOMBO3 options: pad, center, disabled
instructionoptSTRINGDescribe 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)

NameTypeDescription
conditioning_with_full_refCONDITIONING
latentLATENT
image1IMAGE
image2IMAGE
image3IMAGE
image4IMAGE
image5IMAGE
conditioning_with_main_refCONDITIONING
pad_infoANY