Smart TextEncodeEditAdvanced (6 images)
Six-image vision-language conditioning for WAN image edits
- clip
- vae
- image1
- image2
- image3
- image4
- image5
- image6
- CONDITIONING
Smart TextEncodeEditAdvanced is the node that turns "describe these images, then do what the instruction says" into actual conditioning for WAN. It's an edit-style encoder: up to six input images, one text instruction, and it produces the conditioning that makes the model edit the images according to the prompt while keeping them recognizable. It's the kind of node that shows up in WAN image-edit and multi-reference workflows, and the "(6 images)" in its display name is not decorative.
Here's the mechanism, because it's genuinely clever. This isn't a plain CLIPTextEncode that happens to have image inputs. It's built for vision-language CLIPs like Qwen2.5-VL, which is the model class WAN edit workflows actually use. When use_vl_encoding is on, each connected image gets downscaled to a target resolution (vl_megapixels, default 0.5 - the tooltip points at Qwen2.5-VL's 0.2–1.0 MP training range), the prompt is prefixed with Picture N: vision-token placeholders, and a special edit-style instruction template is applied that tells the model to describe the image's key features and then explain how the user's instruction should alter it. The downscaled images are passed into clip.tokenize alongside that prompt, so the CLIP actually sees them during encoding. That's the difference between this and a reference_latents-only approach: the model reads the pictures as part of the text encoding, not just as pixel anchors.
The second half of the pipeline handles the pixel path. If you connect vae, each image also gets VAE-encoded and appended to the conditioning's reference_latents. So you get both channels: semantic understanding through the vision-language tokens, and pixel-level anchoring through the reference latents. That combination is what makes an edit keep the subject's identity rather than producing an entirely new scene.
The inputs that matter: clip (needs to be a vision-language-capable CLIP - the Qwen2.5-VL loaders from the WAN edit pack ecosystem), prompt (the instruction, e.g. "turn day into night, keep the building"), and image1 through image6. max_images_allowed (0–6, default 6) caps how many images get processed - they're handled in order, so if you set it to 2 only image1 and image2 are used, which is a cheap way to force the model to focus. vl_megapixels set to 0 disables the vision-language path entirely; with use_vl_encoding off the node behaves like a plain text encode plus reference_latents, which is useful when you're debugging whether the VL path is helping or hurting.
The single output is CONDITIONING, ready to feed a sampler. This node encodes one prompt - if you need positive and negative in one node, grab the Dual variant (SmartTextEncodeEditAdvancedDual) from the same pack.
A note on where this fits: it's not a Wan-specific node class, but in practice it lives in WAN edit workflows because that's where Qwen2.5-VL CLIPs and reference_latents are common. The pack categorizes it under SmartHelperNodes, and it needs a CLIP model that supports the llama_template/vision-token tokenize path - the stock SD/SDXL CLIPs won't do anything useful with the VL flags.
Install via ComfyUI Manager (search "Smart Helper Nodes"), or:
cd ComfyUI/custom_nodes
git clone https://github.com/slvslvslv/ComfyUI-SmartHelperNodes
Restart ComfyUI. No extra pip dependencies and no bundled models - the heavy lifting is whatever CLIP you load into it.
Inputs (12)
| Name | Type | Default | Description |
|---|---|---|---|
| clip | CLIP | — | |
| prompt | STRING | — | |
| use_vl_encoding | BOOLEAN | true | Enable VL image feeding: prepend Picture N vision tokens, pass downscaled images to clip.tokenize, and apply the edit-style llama_template. Turn off to behave like plain text encode + reference_latents. |
| vl_megapixels | FLOAT | 0.500–4 | Target megapixels for Vision-Language model. Set to 0 to disable VL image feeding. Recommended: 0.2-1.0 MP. Qwen2.5-VL trained range: 0.2-1.0 MP |
| max_images_allowed | COMBO | 6 | Maximum number of images to process. Images are processed in order: image1..image6 |
| vaeopt | VAE | — | |
| image1opt | IMAGE | — | |
| image2opt | IMAGE | — | |
| image3opt | IMAGE | — | |
| image4opt | IMAGE | — | |
| image5opt | IMAGE | — | |
| image6opt | IMAGE | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| CONDITIONING | CONDITIONING | — |