Nodes/ComfyUi-TextEncodeEditAdvanced/TextEncodeEditAdvanced (Dual)
ComfyUI Node

TextEncodeEditAdvanced (Dual)

TextEncodeEditAdvanced (Dual) — positive and negative text encoding plus references, in one node

By BigStationW·Created 8 months ago·Updated 7 months ago· 59
TextEncodeEditAdvanced (Dual)
  • clip
  • vae
  • image1
  • image2
  • image3
  • positive
  • negative
positive
negative
vl_megapixels0.50
max_images_allowed3

TextEncodeEditAdvancedDual is what you get when the single version isn't enough because you actually run a negative prompt. It takes the Qwen-style VLM encoding of TextEncodeEditAdvanced and returns both a positive and a negative CONDITIONING out of one node - the refs shared, the text handled per side.

This is a niche of a niche. A lot of Qwen Edit and Klein workflows run CFG 1 with an empty negative, and the plain TextEncodeEditAdvanced is all they need. But the moment your model wants CFG above 1, or you're doing real negative-prompt steering, this collapses what would otherwise be two text-encode nodes and one reference-attach node into a single box. You type your positive and your negative, connect clip + vae + images, and both sampler inputs are wired.

How it works

The positive side gets the full treatment: images downscaled to vl_megapixels are fed to the Qwen2.5-VL encoder (with the "describe the image, then explain how the instruction alters it" system prompt), and the same images are VAE-encoded at full resolution into reference_latents.

The negative side is the interesting bit. It's encoded as plain text - no image tokens, no vision prompt, nothing. But the reference_latents are still attached to it. So the negative knows what image you started from and can steer away from it, without the VLM spending tokens describing a photo it's only going to fight against. It's a sensible design, and it's what the single node can't do for you.

Inputs and outputs

  • clip (required) - the Qwen 2.5-VL encoder via CLIPLoader type qwen_image.
  • positive / negative (required, multiline) - your edit instruction and what to avoid.
  • vl_megapixels - default 0.5, range 0–4, sweet spot 0.2–1.0 for Qwen2.5-VL. 0 for non-Qwen edit models (Kontext, Klein, Flux 2 have no VLM branch).
  • max_images_allowed - "0""3", default "3", processed in order.
  • vae + image1/2/3 (optional) - the reference side.

Outputs are positive and negative CONDITIONING, straight into your sampler.

Install and gotchas

Same as the rest of the pack: search ComfyUi-TextEncodeQwenImageEditAdvanced in ComfyUI Manager, or git clone https://github.com/BigStationW/ComfyUi-TextEncodeQwenImageEditAdvanced into ComfyUI/custom_nodes and restart. No extra dependencies.

The failure modes are the family ones: forget the VAE and the references silently vanish; leave vl_megapixels nonzero on a Klein/Kontext clip and you're feeding vision tokens to a model without a VLM; feed a huge image and the full-resolution reference encode gives you offset, distorted output - scale inputs to ~1 MP upstream with ImageScaleToTotalPixels. And if the node doesn't appear after install, update ComfyUI core first; that's the fix that actually works for this author's nodes.

Categoryconditioning/qwen_image_edit

Inputs (9)

NameTypeDefaultDescription
clipCLIP
positiveSTRING
negativeSTRING
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_allowedCOMBO3Maximum number of images to process. Images are processed in order: image1, image2, image3
vaeoptVAE
image1optIMAGE
image2optIMAGE
image3optIMAGE

Outputs (2)

NameTypeDescription
positiveCONDITIONING
negativeCONDITIONING