Nodes/comfyui_qwen_image_edit_adv/TextEncodeQwenImageEditInfAdv
ComfyUI Node

TextEncodeQwenImageEditInfAdv

More than three references? TextEncodeQwenImageEditInfAdv doesn't care

By lenML·Created 12 months ago·Updated 9 months ago· 38
TextEncodeQwenImageEditInfAdv
  • clip
  • vae
  • images
  • CONDITIONING
  • LATENT
prompt

The "Inf" in the name is a promise: however many reference images you need. Where the Plus node gives you exactly three sockets, TextEncodeQwenImageEditInfAdv takes a single image batch and splits it into as many references as the batch holds - three, six, twelve, whatever. If your edit needs more context than three pictures, this is the node.

The mechanism is dead simple and it's all in the shape. An IMAGE batch in ComfyUI is a tensor of [B, C, H, W] - B images stacked. This node slices that batch into B separate single-image tensors and feeds them through the same multi-image encoder as the Plus node: each becomes a "Picture N" with its own vision tokens, each gets VAE-encoded and attached as a reference latent, and the LATENT output is the full concatenated batch. Same rule as Plus applies: this is multi-image context, not multi-image generation.

Inputs and outputs

  • clip (required) - from the CLIPLoader (qwen_image type).
  • prompt (required) - the edit instruction.
  • vae (optional) - wire it; the LATENT output is empty without it.
  • images (one IMAGE socket) - the batch of references.

Outputs: CONDITIONING and LATENT, both into the KSampler.

How you build the batch

Feed it from a node that stacks images - a "Batch Images" or image-list-to-batch node that merges several Load Images into one IMAGE. The practical gotcha: ComfyUI image batches require every frame to share dimensions, so run each image through QwenImageEditSimpleScale (or any resize) before it goes into the batch. The README recommends this node for lists and for anything beyond three images; it's also the natural target for image sequences.

Install

Standard custom-node install: ComfyUI Manager → Install Custom Nodes → search "comfyui_qwen_image_edit_adv", or clone manually:

cd ComfyUI/custom_nodes
git clone https://github.com/lenML/comfyui_qwen_image_edit_adv

Restart ComfyUI - no dependency dance, the requirements.txt is empty, and the pack ships no weights. The 20B Qwen-Image-Edit model (practically a Q4 GGUF on consumer hardware), the Qwen2.5-VL CLIP, and the VAE load through ComfyUI's normal Qwen loaders.

When to reach for it - and when not to

Use it over Plus for dynamic counts, programmatic sources, or more than three references. The catch is that memory cost scales with the batch, and every extra reference is more vision tokens the model has to attend to - beyond a handful it stops using them well and your VRAM bill climbs. Qwen's own multi-image sweet spot is 1–3 inputs even when the plumbing allows more. If you know it's exactly three, Plus is tidier; if it's ever more, this is the one. If output comes back wrong, check that the batch was built from uniform sizes, and keep CFG low (1.0–2.5) as always with this model.

CategoryQwenImageEditAdv/conditioning

Inputs (4)

NameTypeDefaultDescription
clipCLIP
promptSTRING
vaeoptVAE
imagesoptIMAGE

Outputs (2)

NameTypeDescription
CONDITIONINGCONDITIONING
LATENTLATENT