Regional Prompt Encoder (Nukun)
One node where regional workflows used to be five
- clip
- base_conditioning
- conditioning_1
- conditioning_2
- conditioning_3
- hiresfix_conditioning
- base_text
- text_1
- text_2
- text_3
- hiresfix_text
Regional prompting needs two halves: masks (which pixels belong to which region) and conditioning (what each region says). This node is the conditioning half, and it exists to kill the ugliest pattern in regional workflows - the four-deep chain of "BetterString → text concatenate → CLIPTextEncode" that you had to build once per region and maintain forever. It takes a base prompt plus up to three region prompts, assembles each one, and encodes them all with a single CLIP.
The design philosophy is deliberately boring in a good way: no hidden position text, no cast, no magic. Each regional conditioning is encoded from exactly base_prompt + separator + region_n. You get predictable text and predictable conditioning, which is what you want when you're debugging why region 2 is bleeding into region 1.
How it works
Inputs: clip, base_prompt, region_1/region_2 (and region_3 when region_count is 3), separator (default , ), and hiresfix_prompt. It encodes:
base_conditioning- just the base prompt, for when you need a full-scene conditioning separately.conditioning_1..3- each region'sbase + separator + region_n, for wiring into the pack's regional mask/conditioning nodes.hiresfix_conditioning- all active text plushiresfix_prompt, so the upscale/detail pass sees the whole scene plus an explicit polish line.
The text outputs (base_text, text_1..3, hiresfix_text) mirror exactly what got encoded - a genuinely useful debugging feature, because if you ever wonder "what string did this conditioning actually contain," the answer is right there.
The intended chain: this node → Native Regional Split/Rect Conditioning (or the mask nodes + core ConditioningSetMask) → sampler. Or for DenseDiffusion fans, the pack's NukunDenseDiffusionSplitApply / RectApply pair wraps the whole mask-and-apply side.
Installing it
Standard:
cd ComfyUI/custom_nodes
git clone https://github.com/OnekoSL/Nukun_ComfyUI_Nodes.git
Restart ComfyUI, or use Manager (search "Nukun"). No extra dependencies. Works with any CLIP - SDXL, Pony v6, Illustrious all fine.
Common issues
The separator default is , - a comma-space. On booru-trained models that's usually right (it reads as a tag break), but if your base prompt ends mid-sentence and you want a period or nothing, change it; it applies to every region, so one separator for all. If region_3 is left unconnected while region_count is 3, the third region encodes as just base + separator with empty region text - it won't error, it'll silently be weak. Set region_count to 2 if you're only doing two regions. And the hiresfix_prompt is appended to every active region text, so don't put region-specific instructions in it - keep it to global polish ("detailed face, sharp focus") or your regions will all inherit it.
Inputs (8)
| 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 | — |
Outputs (10)
| 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 | — |