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

Regional Prompt Encoder (Nukun)

One node where regional workflows used to be five

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

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's base + separator + region_n, for wiring into the pack's regional mask/conditioning nodes.
  • hiresfix_conditioning - all active text plus hiresfix_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.

CategoryNukun/Conditioning

Inputs (8)

NameTypeDefaultDescription
clipCLIP
base_promptSTRING
region_1STRING
region_2STRING
region_3STRING
region_countINT22–3
separatorSTRING,
hiresfix_promptSTRING

Outputs (10)

NameTypeDescription
base_conditioningCONDITIONING
conditioning_1CONDITIONING
conditioning_2CONDITIONING
conditioning_3CONDITIONING
hiresfix_conditioningCONDITIONING
base_textSTRING
text_1STRING
text_2STRING
text_3STRING
hiresfix_textSTRING