ZOEYTextEncodeQwenImageEditPlus
Six pictures in, one edit instruction, conditioning out
- clip
- vae
- image1
- image2
- image3
- image4
- image5
- image6
- CONDITIONING
ZOEYTextEncodeQwenImageEditPlus is the conditioning node you need for the Qwen-Image-Edit line of models when one reference image isn't enough. Qwen-Image-Edit is the model family that made "here's a picture, change this with a sentence" a local, Apache-2.0 reality - no mask, no ControlNet, no IP-Adapter. The standard ComfyUI encoder handles the single-image case; this node is the "Plus" version: it takes up to six reference images, plus one plain-language instruction, and encodes the whole thing into a conditioning that the edit model can act on. If your edit needs "keep this person's face, swap in this outfit, and put them in this room" - three pictures and one sentence - this is the node.
It comes from comfyui-ZoeyTool, tucked under advanced/conditioning, and it mirrors the official ComfyUI Qwen image-edit encoding path almost exactly - with the reference-image count turned up.
How it works
Required inputs: a clip (the Qwen2-VL-based CLIP that ships with Qwen-Image-Edit models) and a prompt - your edit instruction in natural language. Optional: a vae (the edit model's VAE) and six image sockets image1…image6.
The encode pipeline is where the mechanism lives, and it's worth knowing because it explains why the VAE matters:
- Every connected reference image is downscaled to ~384×384 area and fed to the CLIP as a vision input, so the language model can literally see the pictures you're referencing.
- If a
vaeis connected, each image is also VAE-encoded at ~1024×1024 (padded to multiples of 8) and collected asreference_latents. - The node injects the same system prompt Qwen-Image-Edit uses ("describe the image, then explain how the instruction modifies it, keeping consistency…") and stitches each picture in as
Picture Nwith the<|image_pad|>vision tokens, then encodes the whole instruction. - The reference latents get attached to the conditioning via
conditioning_set_values(..., append=True)- that's the signal some edit checkpoints use to keep identity stable across the edit rather than drifting into whatever the prompt alone suggests.
Output is a single CONDITIONING, which you wire into your edit model's sampler just like any other positive conditioning.
Installing it
Part of comfyui-ZoeyTool:
cd ComfyUI/custom_nodes
git clone https://github.com/liangzoey/comfyui-ZoeyTool.git
cd comfyui-ZoeyTool
pip install -r requirements.txt
Restart ComfyUI (or ComfyUI Manager → comfyui-ZoeyTool). No model downloads from the node itself - but it's useless without the actual Qwen-Image-Edit model plus its Qwen2-VL CLIP and VAE on disk, which you source separately.
Where people get burned
The "it encoded but nothing followed my instruction" report is almost always a wiring/type problem: this node expects a Qwen2-VL image-edit CLIP (the special qwen_image_edit-type text encoder that ships with edit checkpoints), not a generic CLIP from an SD/SDXL checkpoint - grab the one that came with your edit model. Second, the reference_latents only mean something to models trained to use them; if your checkpoint ignores them, the extra images just become vision context and you'll see weaker identity locking than advertised. Third, resolution discipline: feeding huge reference images is pointless because the encoder downscales them anyway - and if you're low on VRAM, the 1024² VAE pass per image adds up fast with all six slots filled. Use only the images the edit actually needs.
Inputs (9)
| Name | Type | Default | Description |
|---|---|---|---|
| clip | CLIP | — | |
| prompt | STRING | — | |
| vaeopt | VAE | — | |
| image1opt | IMAGE | — | |
| image2opt | IMAGE | — | |
| image3opt | IMAGE | — | |
| image4opt | IMAGE | — | |
| image5opt | IMAGE | — | |
| image6opt | IMAGE | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| CONDITIONING | CONDITIONING | — |