Nodes/Nukun_ComfyUI_Nodes/Regional Sculpt Prompt Encoder (Nukun)
ComfyUI Node

Regional Sculpt Prompt Encoder (Nukun)

Regional prompting, with token-level embedding surgery

By OnekoSL·Created 3 months ago·Updated 11 days ago· 1
Regional Sculpt Prompt Encoder (Nukun)
  • clip
  • base_conditioning
  • conditioning_1
  • conditioning_2
  • conditioning_3
  • hiresfix_conditioning
  • base_text
  • text_1
  • text_2
  • text_3
  • hiresfix_text
  • report
base_prompt
region_1
region_2
region_3
region_count2
separator,
hiresfix_prompt
sculptor_intensity0.50
sculptor_methodforward
token_normalizationmean
top_k64

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": forward method, 0.5 intensity, mean token normalization.
  • sculptor_method - forward is the default (push embeddings in the direction of... the sculpt target); other options are in the combo.
  • token_normalization - how the edit is normalized; mean is 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.

CategoryNukun/Conditioning

Inputs (12)

NameTypeDefaultDescription
clipCLIP
base_promptSTRING
region_1STRING
region_2STRING
region_3STRING
region_countINT22–3
separatorSTRING,
hiresfix_promptSTRING
sculptor_intensityFLOAT0.500–5
sculptor_methodCOMBOforward4 options: forward, backward, maximum_absolute, add_minimum_absolute
token_normalizationCOMBOmean7 options: none, mean, set at 1, default * attention, mean * attention, set at attention, +1
top_kINT641–512Number of nearest token vectors used for sculpting.

Outputs (11)

NameTypeDescription
base_conditioningCONDITIONING
conditioning_1CONDITIONING
conditioning_2CONDITIONING
conditioning_3CONDITIONING
hiresfix_conditioningCONDITIONING
base_textSTRING
text_1STRING
text_2STRING
text_3STRING
hiresfix_textSTRING
reportSTRING