Regional Sculpt Prompt Encoder (Nukun)
Regional prompting, with token-level embedding surgery
- clip
- base_conditioning
- conditioning_1
- conditioning_2
- conditioning_3
- hiresfix_conditioning
- base_text
- text_1
- text_2
- text_3
- hiresfix_text
- report
This is the experimental, "more, please" version of Regional Prompt Encoder (Nukun). Same text assembly - base prompt plus up to three region prompts, encoded with one CLIP - but before encoding, it nudges the token embeddings themselves using a Vector-Sculptor-style edit. If you've seen people talk about "sculpting" CLIP embeddings to sharpen subject/detail adherence on SDXL models, this is that, folded into a regional encoder.
The honest framing, from the README: it's experimental, and it's meant for the niche case where your regional workflow already has separate CLIP Vector Sculptor text encode chains after prompt composition. This node replaces those chains. If that sentence doesn't describe you, use the plain Regional Prompt Encoder - the sculpting is a flavor, not the base recipe.
How it works
Mechanically it's the sibling encoder plus a sculpting pass. Each unique token in your active regional and HiRes texts is searched once per CLIP stream (with top_k nearest-vector lookup, default 64) and its embedding is adjusted before scheduled encoding. The dedup across regions is the memory-conscious part - one search per unique token instead of one per region, which is what keeps bounded memory on SDXL. base_conditioning stays unsculpted as a stable global reference, and when region_count is 2, conditioning_3 becomes the unsculpted base fallback.
The controls:
sculptor_intensity(default 0.5) - how strongly the embedding edit applies. The defaults are deliberately "mildly active":forwardmethod, 0.5 intensity,meantoken normalization.sculptor_method-forwardis the default (push embeddings in the direction of... the sculpt target); other options are in the combo.token_normalization- how the edit is normalized;meanis the default.top_k- how many nearest neighbors the vector search considers (64 default).
Outputs mirror the plain encoder - base_conditioning, conditioning_1..3, hiresfix_conditioning, the five text mirrors - plus a report string that tells you what the sculpting pass did. That report is your friend; this is a node where "what did it actually change" is a real question.
Installing it
Standard pack install:
cd ComfyUI/custom_nodes
git clone https://github.com/OnekoSL/Nukun_ComfyUI_Nodes.git
Restart ComfyUI, or use Manager (search "Nukun"). Self-contained - no external Vector Sculptor package required, and importantly the old package isn't patched, so older workflows keep loading while you can use this for new ones.
Common issues
This is where "experimental" bites. The sculpting edits embeddings, and embedding edits are prompt- and seed-sensitive - a setting that sharpens one subject can muddy another. Workflow: A/B against the plain encoder on the same seed first (the README recommends exactly this), then raise sculptor_intensity in small steps. If output gets worse, that's the sculpt fighting the model, not a bug. Also note the defaults leave base_conditioning and the region-3 fallback unsculpted on purpose - if you expected the whole graph sculpted, check which outputs you actually wired, because only the regional and HiRes conditionings get the treatment.
Inputs (12)
| Name | Type | Default | Description |
|---|---|---|---|
| clip | CLIP | — | |
| base_prompt | STRING | — | |
| region_1 | STRING | — | |
| region_2 | STRING | — | |
| region_3 | STRING | — | |
| region_count | INT | 22–3 | — |
| separator | STRING | , | — |
| hiresfix_prompt | 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 (11)
| Name | Type | Description |
|---|---|---|
| base_conditioning | CONDITIONING | — |
| conditioning_1 | CONDITIONING | — |
| conditioning_2 | CONDITIONING | — |
| conditioning_3 | CONDITIONING | — |
| hiresfix_conditioning | CONDITIONING | — |
| base_text | STRING | — |
| text_1 | STRING | — |
| text_2 | STRING | — |
| text_3 | STRING | — |
| hiresfix_text | STRING | — |
| report | STRING | — |