Nodes/ComfyUI Smart Helper Nodes/Smart TextEncodeEditAdvanced (6 images)
ComfyUI Node

Smart TextEncodeEditAdvanced (6 images)

Six-image vision-language conditioning for WAN image edits

By slvslvslv·Created 2 years ago·Updated 7 days ago· 3
Smart TextEncodeEditAdvanced (6 images)
  • clip
  • vae
  • image1
  • image2
  • image3
  • image4
  • image5
  • image6
  • CONDITIONING
prompt
use_vl_encodingtrue
vl_megapixels0.50
max_images_allowed6

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.

CategorySmartHelperNodes

Inputs (12)

NameTypeDefaultDescription
clipCLIP
promptSTRING
use_vl_encodingBOOLEANtrueEnable 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_megapixelsFLOAT0.500–4Target 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_allowedCOMBO6Maximum number of images to process. Images are processed in order: image1..image6
vaeoptVAE
image1optIMAGE
image2optIMAGE
image3optIMAGE
image4optIMAGE
image5optIMAGE
image6optIMAGE

Outputs (1)

NameTypeDescription
CONDITIONINGCONDITIONING