Nodes/ComfyUI-UtilsCollection/TextEncodeEditPlusAdvanced
ComfyUI Node

TextEncodeEditPlusAdvanced

Blend two reference images with math before the encoder sees them

By silveroxides·Created 2 months ago·Updated about 7 hours ago· 24
TextEncodeEditPlusAdvanced
  • clip
  • image_inputs
  • vae
  • CONDITIONING
prompt
vlm_resolutionFast (384)
vae_resolutionFast (1024)
ref_latent_modeoff
vae_dimension_multiple8

This is the heavyweight of the pack's encoder family, and the only one with a feature you won't find in any stock ComfyUI node: visual math blending. You can write |((image_input_1 * 1.075) + (image_input_2 * 1.025)) / 1.5| inside your prompt, and the node actually blends those two reference images at the pixel-tensor level - weighted, clamped, whatever the formula says - and feeds the result to the encoder as a single image token. Style interpolation, concept mixing, weighted references: done in arithmetic instead of in separate image-editing software.

How it works

Up to 16 reference images hang off the autogrow image_inputs sockets (image_input_1image_input_16). Each image goes down two paths:

  • VLM semantic path - resized to your vlm_resolution (Fast 384 → XX-Large 1536, or Original) and passed to the visual language model as soft image tokens so the model understands what it's looking at.
  • VAE structural path - optionally VAE-encoded as a reference latent (via vae + vae_resolution), appended or run in a parallel stream depending on ref_latent_mode, so the diffusion model gets composition geometry, not just semantics.

In the prompt, you control where the images land. Reference a socket by name - the subject is wearing the outfit from image_input_2 - and the node inserts a vision token at that position, building the image list in order of appearance. Wrap a formula in pipes - |(image_input_1 * 1.2) + (image_input_2 * 0.8)| - and the result becomes one blended vision token. Supported operators: + - * / clamp min max abs. If your prompt references nothing, all connected images get prepended automatically, so it degrades to "all references, in socket order."

Output is CONDITIONING, ready for the sampler.

What it's for and when it shines

This is the node for serious reference-driven editing - character/outfit swaps where one image has the pose and another has the clothes, or style transfers where you literally want "60% reference A, 40% reference B" without doing the blending in Photoshop first. The vlm_resolution/vae_resolution split is why it can do that cleanly: the semantic path keeps the model from misunderstanding the references, the structural path keeps the geometry, and the formula syntax lets you control the mix numerically.

Where people get burned

  • ref_latent_mode defaults to off - if you're not feeding a vae, leave it; the semantic path alone is plenty for many edits. Turning it on without a VAE does nothing.
  • Formula parsing is strict - pipe-delimited, valid math, socket names exactly as connected. A malformed formula stays literal text in the prompt.
  • Resolution is a real cost/quality dial. Fast (384) is a good starting point; Detailed (768)+ costs memory and time.
  • This node has no system_prompt input - for the version with one (Gemma template), see TextEncodeGemmaSystemEditPlusAdvanced.

Installing it

Ships in silveroxides/ComfyUI-UtilsCollection. ComfyUI Manager: search ComfyUI-UtilsCollection, install, restart. Or manually:

cd ComfyUI/custom_nodes
git clone https://github.com/silveroxides/ComfyUI-UtilsCollection
cd ComfyUI-UtilsCollection
pip install -r requirements.txt   # opencv-python, typing-extensions

Restart. No node-specific model downloads - the encoder is whatever CLIP/vision stack you feed in. This one isn't a legacy alias; it's a canonical node in its own right.

Categorymodel/conditioning

Inputs (8)

NameTypeDefaultDescription
clipCLIP
promptSTRINGMain text prompt. Supports visual math blending: |formula| to blend image inputs at pixel-tensor level before encoding. Example: |((image_input_1 * 1.075) + (image_input_2 * 1.025)) / 1.5| to blend styles/concepts. Supported math operations: +, -, *, /, clamp, min, max, abs, on variables image_input_1 to image_input_16.
vlm_resolutionCOMBOFast (384)Resolution of the image passed to the VLM (semantic path). 'Fast' = 384x384, 'Balanced' = 512x512, 'Detailed' = 768x768, 'Large' = 1024x1024, 'X-Large' = 1280x1280, 'XX-Large' = 1536x1536, 'Original' uses native resolution.
vae_resolutionCOMBOFast (1024)Resolution of the reference latent encoded by the VAE (structural path).
ref_latent_modeCOMBOoffReference latent encoding mode. 'single'/'multi' append latents; 'parallel-single'/'parallel-multi' run them in a separate conditioning stream to prevent semantic override.
vae_dimension_multipleINT84–256Pixel multiple used to align reference images before VAE encoding.
image_inputsCOMFY_AUTOGROW_V3
vaeoptVAE

Outputs (1)

NameTypeDescription
CONDITIONINGCONDITIONING