CLIP Sculpt Text Encode (Nukun)
Vector-sculpting for SD1/SDXL prompts, without the dead extension
- clip
- conditioning
- report
Somewhere between prompt text and the image there's a layer of token vectors, and a small but determined community of people like to edit that layer directly. The tool that made this popular was CLIP Vector Sculptor - an external package that let you push token embeddings toward or away from each other ("sculpt" the prompt in embedding space). It's also the kind of personal project that ages: unmaintained, finicky with newer ComfyUI, a workflow liability.
NukunCLIPSculptTextEncode is a from-scratch, SD1/SDXL-native replacement for that old vector sculptor, folded into a single text-encode node. Same idea, no external package to babysit.
How it works
It's a CLIPTextEncode-style node (clip + multiline text in, conditioning out, plus a report) with a sculpting pass on top. The flow: tokenize your text, skip special and precomputed-embedding tokens (things like <lora:...> handles that shouldn't be nudged), then for each eligible token find its top_k nearest neighbor vectors in the CLIP embedding space and push the token toward or away from that neighborhood. The README's mechanism notes matter here:
- The nearest-vector search runs in bounded chunks with a CPU fallback - it doesn't clone the whole embedding table into VRAM, so it won't OOM your card the way the old package could.
- The "mean of all tokens" normalization is computed as a streaming chunk reduction rather than materializing a full FP32 copy.
That chunked/CPU-fallback design is the real upgrade. The old sculptor was notorious for memory pressure; this one is written to survive.
The inputs that matter
sculptor_intensity- how hard to push (default 0.5, up to 5).sculptor_method-forward,backward,maximum_absolute,add_minimum_absolute. Forward pushes toward the neighbors; backward pushes away; the other two are variations on magnitude-based pushing.token_normalization- seven options includingnone,mean, and the defaultmean... actually the default ismean, andmean of all tokensis the streaming-chunk option mentioned above.top_k- how many nearest vectors to use per token (default 64).
The defaults (forward, 0.5, mean) are mildly active by design - the author's other sculpting nodes follow the same "mildly on" philosophy so you compare against a plain encode before turning anything up.
Why you'd reach for it
If you never touched vector sculptor, you probably don't need this - plain CLIPTextEncode is fine for most work. But if you've got a workflow that leaned on sculpting to push concepts together or apart (separating two similar subjects, sharpening a concept that keeps bleeding), this is the maintained, dependency-free way to keep that trick alive. The old Vector_Sculptor_ComfyUI package isn't patched or touched - so old workflows still load, and new ones can migrate here.
Installing it
cd ComfyUI/custom_nodes
git clone https://github.com/OnekoSL/Nukun_ComfyUI_Nodes.git
Restart ComfyUI or install via ComfyUI Manager ("Nukun").
The honest caveat
Sculpting is a rabbit hole. It's easy to spend an afternoon pushing top_k and intensity around chasing a marginal effect, and the results are model- and prompt-sensitive. Treat this node the way the pack does: keep the defaults mild, verify the report shows the sculpt ran (and on which device), and don't expect magic - expect a tool for people who already know what "push this token away from its neighbors" means for their image.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| clip | CLIP | — | |
| text | STRING | — | |
| sculptor_intensity | FLOAT | 0.500–5 | — |
| sculptor_method | COMBO | forward | 4 options: forward, backward, maximum_absolute, add_minimum_absolute |
| token_normalization | COMBO | mean | 7 options: none, mean, set at 1, default * attention, mean * attention, set at attention, +1 |
| top_k | INT | 641–512 | Number of nearest token vectors used for sculpting. |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| conditioning | CONDITIONING | — |
| report | STRING | — |