NS Dual Encoder Text Encode
Give SDXL's two encoders two different prompts
- clip
- CONDITIONING
SDXL doesn't have one prompt encoder, it has two, and NS Dual Encoder Text Encode is the rare node that lets you talk to them separately. One input feeds CLIP ViT-L (the "content" encoder - subject, composition, color), the other feeds OpenCLIP ViT-bigG (the "style" encoder - aesthetics, lighting, medium). Two text boxes, one conditioning output, and suddenly the prompt-vs-style tug-of-war becomes something you can split instead of negotiate.
This is the node the pack's other dual-encoder tools are built around. Pair it with NS-DualEncoderGuidanceScale and you're not just writing two prompts - you're also weighting the two halves independently. That combination is genuinely one of the more interesting things in this pack, and it works on the whole SDXL fine-tune family (Illustrious, NoobAI, Pony, the whole realism lineup), which still holds most of the LoRA library.
How it works
Under the hood it does two encodings and stitches them. First it encodes with the style prompt running through bigG and the content prompt through ViT-L, balancing the token batches so both encoders get matched lengths. Then it encodes again with content in both slots, so it can pull the pooled output from the content pass. The result: the conditioning's hidden states carry the style prompt, while the pooled vector - the part that drives a lot of the high-level feel - carries the content prompt. That's the whole trick: style in the details, content in the summary, each from the encoder that reads it best.
There's also a graceful fallback baked in. If the CLIP you feed it isn't SDXL's (no g token key in the tokenizer output), it prints a warning and encodes prompt_content only. So on a non-SDXL model you don't crash - you just silently lose the style split. Easy to miss if you're not reading the console.
Inputs and output
- clip - an SDXL-family CLIP.
- prompt_content (multiline) - subject, composition, color. Goes to ViT-L. The tooltip spells out the division of labor.
- prompt_style (multiline) - aesthetics, lighting, medium. Goes to ViT-bigG.
Output is a single CONDITIONING, wired into the KSampler's positive/negative like any other text encode.
How to actually use the split
The classic pattern: put the concrete scene in prompt_content ("a red fox, side profile, forest clearing, centered") and the look in prompt_style ("studio photography, golden hour, 85mm, film grain, warm tones"). Then - this is the key - keep the two boxes clean. The point is that you can swap one without touching the other: change the style box and keep the subject identical, or vice versa. That's the workflow superpower: style-consistent batches by locking prompt_content and varying prompt_style.
If you find the style half overpowering the composition, that's exactly what the GuidanceScale sibling is for - reach for it, don't edit the prompt.
Gotchas
It's SDXL-only, full stop. On newer architectures (the flow-matching family) it degrades to a plain content-only encode with a console warning. And it does two encoding passes per prompt, so it's slightly slower than a stock text encode - negligible for one image, mildly annoying for a batch. Also, dynamic prompt syntax is supported in both boxes, which is nice if you use wildcards.
Installing it
Part of ComfyUI-NS-Util:
cd ComfyUI/custom_nodes
git clone https://github.com/NakamuraShippo/ComfyUI-NS-Util
or ComfyUI Manager → Install via Git URL with the same URL, restart. No model downloads; the pack's dependencies (pyyaml, watchdog, opencv-python) are all unrelated to this node, so installs are painless.
The honest take
Of the twenty or so nodes in this pack, this is the one with the most real, surprising capability: separate content and style conditioning is a legitimate SDXL power move that most users never discover exists. If you've hit the wall where prompt engineering means one giant string that does both jobs at once, this node plus the guidance-scale sibling is the upgrade. If you're not on SDXL, it's a curiosity that politely degrades.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| clip | CLIP | — | |
| prompt_content | STRING | Content prompt (subject, composition, color) -> CLIP ViT-L | |
| prompt_style | STRING | Style prompt (aesthetics, lighting, medium) -> OpenCLIP ViT-bigG |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| CONDITIONING | CONDITIONING | — |