NS Refiner Text Encode
The SDXL refiner's text encoder, plus an aesthetic score dial
- clip
- CONDITIONING
If you still run the classic SDXL base → refiner two-stage pipeline, you've hit the wrinkle this node exists to fix: the refiner doesn't take text the way the base model does. SDXL's refiner is conditioned by only the OpenCLIP ViT-bigG text encoder, and it expects an aesthetic score baked into the conditioning, not just a prompt. ComfyUI's default text encoders don't hand you that on a plate. NS Refiner Text Encode is the missing step: give it a CLIP and a prompt, and it produces refiner-ready conditioning with an aesthetic score you can dial.
Worth being honest about the context, though. The SDXL refiner was designed to add fine detail like skin texture in a second denoising stage, and the community decided it was mostly theater once fine-tuned checkpoints matured - the standard joke is "shipped, then ignored." If you're on a fine-tuned SDXL checkpoint, you probably don't need a refiner at all. But the niche still exists (hires-fix-style detail passes, or people reproducing the original two-stage workflow), and when you're in it, this node is the right plumbing.
How it works
Mechanically it's simple and that's the appeal. It tokenizes your prompt, encodes it with whatever CLIP you hand it, and then - the key part - appends an aesthetic_score to every conditioning entry in the output. The tooltip on the prompt field tells you exactly what it's doing: "Refiner prompt → OpenCLIP ViT-bigG." The refiner's conditioning is a single 1280-dimensional bigG vector, and the aesthetic score is how the refiner knows how "polished" the image should be.
That score is what the refiner was trained against: it predicts aesthetics, so you're steering a knob the model actually understands, not inventing one.
The inputs that matter
- clip - the CLIP model. Use the refiner's own CLIP, not the base model's dual-encoder setup. The refiner needs that single ViT-bigG encoder.
- prompt - a multiline box. Keep it shorter than your base prompt; the refiner is a detail pass, not a second chance to write the scene.
- aesthetic_score - a float from 1 to 10, default 6, step 0.5. The tooltip is the whole story: "higher = more aesthetic." Start at 6 and nudge up for smoother, glossier, more "finished" detail; back it off if the refiner is over-polishing into plastic.
Output is a single CONDITIONING, which you wire into the refiner stage's KSampler (the positive input of the second sampler in the base→refiner graph).
Pairing it with the rest of the pack
NS-RefinerTextEncode is one corner of a small ecosystem this pack builds around the refiner. Feed its output into NS-RefinerGuidanceScale to manually scale the bigG component, or NS-RefinerSchedule to ramp that scale across the refiner's sampling range. If you're going all-in on the two-stage setup, these four nodes replace the stock text-encode + refiner wiring with something you can actually tune.
Installing it
This is part of ComfyUI-NS-Util, so install the pack once and every NS node appears. ComfyUI Manager → Install via Git URL:
https://github.com/NakamuraShippo/ComfyUI-NS-Util
or by hand:
cd ComfyUI/custom_nodes
git clone https://github.com/NakamuraShippo/ComfyUI-NS-Util
Restart ComfyUI afterward. There are no extra model downloads - you just need the SDXL refiner checkpoint (and its CLIP) which you almost certainly already have if you're reading this. Dependencies are the pack's usual light set (pyyaml, watchdog, opencv-python); no heavy installs.
Where people trip up
The classic mistake is feeding this node the base model's CLIP. The base encodes with both ViT-L and ViT-bigG into a 2048-dimensional vector; the refiner wants only the bigG half. Wire the wrong CLIP in and the conditioning dimensions won't match what the refiner expects, and you'll get silent weirdness rather than a clean error. And again - if you're on a modern fine-tune and don't have a refiner stage, you don't need this node. It's the tool for a specific, slightly retro pipeline, and it does that job cleanly.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| clip | CLIP | — | |
| prompt | STRING | Refiner prompt -> OpenCLIP ViT-bigG | |
| aesthetic_score | FLOAT | 6.01–10 | Aesthetic score for Refiner conditioning (higher = more aesthetic) |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| CONDITIONING | CONDITIONING | — |