Nodes/Sage Utils/Dual CLIP Text Encode Qwen
ComfyUI Node

Dual CLIP Text Encode Qwen

Pos, neg, and reference images in one node for Qwen image-edit models

By arcum42·Created 2 years ago·Updated 28 days ago· 33
Dual CLIP Text Encode Qwen
  • clip
  • vae
  • pos_image
  • neg_image
  • positive
  • negative
  • pos_text
  • neg_text
cleantrue
pos
neg

This is the Dual CLIP Text Encode from earlier, upgraded for the image-edit model family. Where the plain version takes a CLIP and two prompts, Dual CLIP Text Encode Qwen additionally takes reference images - the Qwen-style image-edit encoders that power models like FLUX Kontext and similar edit-in-prompt checkpoints want to see a source image alongside your instruction. This node bundles the whole thing: positive prompt + positive reference image, negative prompt + negative reference image, all encoded in one place.

The inputs are clip (required), the clean toggle (default on, same whitespace hygiene as the standard dual encoder), and a set of optionals: vae (needed to encode the reference images), pos and neg (the prompts), and pos_image / neg_image (the reference images for each side). The outputs mirror the standard dual node - positive, negative, pos_text, neg_text - so the pattern stays the same: conditionings to the sampler, prompt strings to your metadata constructor.

The mechanism is where this differs from the plain node, and it's worth understanding. Rather than calling the encoder directly, it builds a small subgraph using ComfyUI's GraphBuilder, instantiating the core TextEncodeQwenImageEdit node for the positive side and another for the negative side, each fed its prompt and reference image (via the VAE). If you leave a side's prompt and image unhooked, it zeroes that conditioning instead of erroring - the same "zeros any input not hooked up" safety as the rest of the family. The clean toggle pre-processes both prompts before they hit the encoder, and the pack's clean_text utility is doing that work.

Real talk on the practical side: this node only makes sense if you're running a Qwen-image-edit-style model, and those are a specific (if growing) corner of the 2026 ecosystem - the LLM-encoder family where your prompt is read like an instruction rather than a bag of CLIP tags. Don't hook this into a regular SDXL or Illustrious checkpoint; it won't have the TextEncodeQwenImageEdit machinery to use. If your model doesn't need reference images, the standard Dual CLIP Text Encode is the one to reach for.

The inputs worth setting

  • clip - required, from your image-edit model's loader.
  • vae - required if you're passing reference images; it encodes them.
  • pos / neg - your instructions, multiline.
  • pos_image / neg_image - the reference images.

Install

ComfyUI Manager → search Sage Utils → install → restart. Manual:

cd ComfyUI/custom_nodes
git clone https://github.com/arcum42/ComfyUI_SageUtils.git
cd ComfyUI_SageUtils && pip install -r requirements.txt

Restart ComfyUI. No extra deps beyond the pack's dynamicprompts; the Qwen image-edit encoder nodes come from your model's own loader/architecture, not from this pack.

CategorySage Utils/clip/encode/image

Inputs (7)

NameTypeDefaultDescription
clipCLIPThe CLIP model used for encoding the text.
cleanBOOLEANtrueClean up the text, getting rid of extra spaces, commas, etc.
vaeoptVAEThe VAE model used for encoding the reference image.
posoptSTRINGThe positive prompt's text.
negoptSTRINGThe negative prompt's text.
pos_imageoptIMAGEThe positive prompt's image.
neg_imageoptIMAGEThe negative prompt's image.

Outputs (4)

NameTypeDescription
positiveCONDITIONINGA conditioning containing the embedded text used to guide the diffusion model.
negativeCONDITIONINGA conditioning containing the embedded text used to guide the diffusion model.
pos_textSTRINGThe positive prompt's text.
neg_textSTRINGThe negative prompt's text.