Nodes/ComfyUI-PromptChain/Prompt Chain Regional Conditioning
ComfyUI Node

Prompt Chain Regional Conditioning

The tile-safe way to keep characters separate

By mobcat40·Created 9 months ago·Updated about a month ago· 15
Prompt Chain Regional Conditioning
  • clip
  • masks
  • positive
  • negative
regions
mask_dilation22
pose

Attention Couple - the node right next to this one in the pack - fixes bleeding between characters by patching the model's attention, but that's a whole-canvas operation, and it falls apart the moment you cut the image into tiles for an upscale pass, because each tile only sees a fragment of the mask. Regional Conditioning solves the same bleeding problem a different way: instead of patching the model, it bakes each character's region straight into the CONDITIONING objects themselves, using ComfyUI's native masked conditioning. A conditioning object carries its region with it, tile or no tile - so an upscale tile landing squarely on one character's face still samples with that character's own prompt.

How it works

Same source data as Attention Couple - per-figure masks and the regions JSON from Prompt Chain - but a different mechanism. There's no model input or output here at all, because nothing about the model is being patched; this node only produces positive/negative CONDITIONING, built by masking each region's encoded text onto its own area. That's also why it needs clip directly rather than taking a pre-patched model: it's doing the CLIP encoding and masking itself.

The inputs and outputs that matter

clip and regions are required - regions again being Prompt Chain's 4th output, carrying the $name{} blocks. mask_dilation (default 22px) is the one number worth adjusting: it grows each region's mask before conditioning is applied, so hair, ribbons, and props that spill past a tight silhouette still get conditioned by someone's prompt instead of falling into the gap between two masks.

Optional masks (per-figure masks, typically the 3D Poser's MASKS output) and pose (the matching POSE_JSON, for name-based binding after a rename) work exactly like they do on Attention Couple. Outputs are just positive and negative - feed them into your sampler's conditioning inputs alongside your normal, unpatched model.

How to install it

Manager: search ComfyUI-PromptChain. Manual:

cd ComfyUI/custom_nodes
git clone https://github.com/mobcat40/ComfyUI-PromptChain.git

Restart, and place this node between your CLIP loader and your sampler, fed by Prompt Chain's regions output and either the 3D Poser's or Region Boxes' mask data.

Common issues & troubleshooting

Which regional node do I actually want? If you're doing a straightforward render with no tiled upscale downstream, Attention Couple's attention-level masking is the more direct approach and is what the pack names after the classic technique. Reach for Regional Conditioning specifically when a tiled upscaler sits later in the pipeline - that's the case attention masking can't survive and conditioning-space masking can.

Region edges are visibly cutting off hair or props. Raise mask_dilation past the 22px default; the tooltip calls this out directly - it exists because silhouette masks are tighter than what people actually wear or hold.

A block isn't finding its region after a rename. Wire pose in from whichever source produced your masks. Without it, the node has no name data to reconcile a renamed $name{} block against its region.

No MODEL output confused you. That's correct, not missing - this node only touches conditioning. Your model stays whatever it already was going into your sampler.

Categorypromptchain

Inputs (5)

NameTypeDefaultDescription
clipCLIP
regionsSTRINGWire to Prompt Chain's 'regions' output (4th).
mask_dilationINT220–128Grow each region mask so ribbons/hair/props aren't clipped.
masksoptMASKPer-figure masks from the 3D Poser MASKS output.
poseoptSTRINGWire to the 3D Poser's POSE_JSON output — carries the figure names so renamed $blocks bind to the right mask.

Outputs (2)

NameTypeDescription
positiveCONDITIONING
negativeCONDITIONING