Nodes/Multi-image-loader/Qwen Multi-Ref Picker
ComfyUI Node

Qwen Multi-Ref Picker

The Qwen 'encoder' that doesn't encode — a reference switcher in disguise

By balarooty·Created 5 months ago·Updated 5 months ago· 0
Qwen Multi-Ref Picker
  • clip
  • vae
  • image_batch
  • selected_image1
  • selected_image2
prompt
ref_index_10
ref_index_21

The name is a lie, and that's the most useful thing about this node. QwenMultiRefEncoder doesn't encode anything. Read its source and the function body never touches clip, vae, or prompt - it slices a batch of images at two indices and returns two frames. That's it. It's a batch-index picker wearing an encoder's clothes, and once you know that, it clicks.

What it actually does

The inputs, per the author's own tooltips: image_batch (IMAGE), ref_index_1 (INT, default 0 - "Batch index to use as image1"), and ref_index_2 (INT, default 1 - "Batch index to use as image2"). The outputs are selected_image1 and selected_image2, each a single-frame IMAGE tensor.

The prompt, clip, and vae inputs are declared but ignored by the code. They're compatibility scaffolding - probably copied from the shape of a real encoding node - and they don't do work. The actual encoding happens downstream, in ComfyUI's built-in TextEncodeQwenImageEditPlus, which turns your two reference images plus a prompt into Qwen-Image-Edit conditioning. This node just decides which two images from the batch those slots get.

So the real workflow is: build a batch of references (with this pack's Multi Image Loader (2–8) or by chaining ImageBatchBuilder), feed the batch here, and feed the two selected outputs into TextEncodeQwenImageEditPlus's image1 and image2 slots.

Why you'd reach for it

Qwen-Image-Edit is the open instruction-editing default - Apache 2.0, and its multi-image mode is what lets you edit with references: "take the hat from image2 and put it on the person in image1." In a story or scene workflow, your reference batch stays the same while the active pair changes every scene. Instead of rewiring nodes each time, you leave the batch wired in and just change two integers. That's the pattern the pack README explicitly recommends: build the batch once, then use this node to swap which two references are live per scene.

It's genuinely how people run Qwen edit workflows - the community threads about wiring multiple reference images into the Qwen text encoder's slots are everywhere, mostly for character and object consistency. This node is a thin, convenient slice of that pattern: batch in, two indices, two frames out.

Where you get burned

Two things, both from the clamping behavior. First, ref_index_2 defaults to 1. Feed this a batch with a single image and both indices clamp down to 0 - you get the same image twice, and nothing tells you. Check the batch size (the pack's ImageBatchBuilder outputs a batch_size INT) before you trust the defaults.

Second, out-of-range indices clamp silently to the last frame, same as the pack's ImageSelectFromBatch. Type 7 into a 3-image batch and you get frame 2, not an error. If your story depends on which reference is which, verify.

Also note the widgets cap at 7, which tells you the author imagined batches up to eight references. Fine for reference panels; don't point it at a 100-frame video batch and expect to reach the end.

Install

It ships in the balarooty/Multi-image-loader pack. ComfyUI Manager: search "Multi-image-loader" in the Install Custom Nodes tab. Or by hand:

cd ComfyUI/custom_nodes
git clone https://github.com/balarooty/Multi-image-loader

Restart ComfyUI. No pip dependencies - just torch, numpy and PIL, all standard in ComfyUI - and no model files to download. The Qwen-Image-Edit checkpoint and its encoder load through ComfyUI's normal loaders, and remember it's a 20B model, so plan on a quantized GGUF or fp8 unless you've got serious VRAM.

Pack-level caveat: it's brand new with no community footprint, and custom nodes run unsandboxed Python. The honest read is that this node is ~20 lines of slicing - the risk is low and the "encoder" branding is the most confusing thing about it. Now you know better.

Categoryimage/multi

Inputs (6)

NameTypeDefaultDescription
promptSTRING
clipCLIP
vaeVAE
image_batchIMAGE
ref_index_1INT00–7Batch index to use as image1
ref_index_2INT10–7Batch index to use as image2

Outputs (2)

NameTypeDescription
selected_image1IMAGE
selected_image2IMAGE