TextEncodeEditAdvanced (Dual)
TextEncodeEditAdvanced (Dual) — positive and negative text encoding plus references, in one node
- clip
- vae
- image1
- image2
- image3
- positive
- negative
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
CLIPLoadertypeqwen_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.
Inputs (9)
| Name | Type | Default | Description |
|---|---|---|---|
| clip | CLIP | — | |
| positive | STRING | — | |
| negative | STRING | — | |
| 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 | 3 | Maximum number of images to process. Images are processed in order: image1, image2, image3 |
| vaeopt | VAE | — | |
| image1opt | IMAGE | — | |
| image2opt | IMAGE | — | |
| image3opt | IMAGE | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| positive | CONDITIONING | — |
| negative | CONDITIONING | — |