Nodes/ComfyUI Impact Pack/RegionalPrompt
ComfyUI Node Runs on cloud

RegionalPrompt

Bind a mask to a sampler so RegionalSampler knows where each prompt goes

By ltdrdata·Created 3 years ago·Updated 4 months ago· 3,242
RegionalPrompt
  • mask
  • advanced_sampler
  • REGIONAL_PROMPTS
variation_seed0
variation_strength0.00
variation_method

This is the little building block that makes regional generation work in Impact Pack. On its own it does almost nothing dramatic: it takes a mask (where) and an advanced sampler (what to generate there, with which prompt), and glues them into a single REGIONAL_PROMPTS bundle. That bundle is the thing RegionalSampler actually consumes. So if you're trying to get "different prompt in different area of the frame" going, this is the node you'll make one of per region.

Think of it as tagging a slice of the canvas with a job. The mask says this part of the image, the advanced sampler carries the prompt and settings for make it look like this. One RegionalPrompt per subject.

How it works

The magic isn't really here - it's in RegionalSampler, which runs each region's sampler every diffusion step so the areas co-develop and blend. RegionalPrompt just packages the pair. The advanced sampler you feed in comes from KSamplerAdvancedProvider, which is where the actual model, prompt (conditioning), CFG and scheduler live. This node is the wiring that says "apply that sampler, but only inside this mask."

If you have several regions, you don't chain them into one another. You make a RegionalPrompt for each, then merge them all with CombineRegionalPrompts before handing the result to RegionalSampler.

The inputs and outputs that matter

  • mask (MASK) - the region this prompt applies to. Any mask source works: a hand-painted mask, a rectangle, output from a segmentation node. This is where the region lives.
  • advanced_sampler (KSAMPLER_ADVANCED) - the prompt-and-settings package for this region, built with KSamplerAdvancedProvider. This is what gets generated inside the mask.

Those two are the whole required surface. There are three optional knobs for adding controlled variation to the region:

  • variation_seed and variation_strength - mix a second seed's noise into the region at a strength you set (0 means off). Handy when you want the same region to come out slightly different across runs without changing the main seed.
  • variation_method - linear or slerp for how that variation noise gets blended. slerp (spherical) tends to be the gentler of the two.

The single output is REGIONAL_PROMPTS. Wire it straight into RegionalSampler's regional_prompts input, or into CombineRegionalPrompts first if you're stacking regions.

How to install it

Grab the whole pack - this node ships as part of it. ComfyUI Manager is the easy way: search ComfyUI Impact Pack, Install, restart.

Manual:

cd ComfyUI/custom_nodes
git clone https://github.com/ltdrdata/ComfyUI-Impact-Pack
cd ComfyUI-Impact-Pack
pip install -r requirements.txt

Use ComfyUI's own Python for that pip step, then restart. First run downloads a small SAM model into ComfyUI/models/sams; that's for the pack's detector features, not this node.

Common issues & troubleshooting

The traps here are conceptual, not crashes. Two to know:

RegionalPrompt does nothing by itself. It has no image or latent output - it only produces a REGIONAL_PROMPTS object. If you're staring at it wondering why nothing happens, that's expected; the work is downstream in RegionalSampler.

Your masks decide everything. Overlapping masks blend, gaps between masks fall to the base sampler, and a mask that's mostly the wrong shape will put your subject in the wrong place. Get the masks right before blaming the prompts.

And the general regional-sampling caution applies: this path is one of the more finicky corners of Impact Pack, and version drift between the pack and ComfyUI core has historically caused the whole regional chain to error out. If a RegionalPrompt→RegionalSampler graph throws on execution, update Impact Pack and ComfyUI to current before debugging anything else.

CategoryImpactPack/Regional

Inputs (5)

NameTypeDefaultDescription
maskMASKregion mask
advanced_samplerKSAMPLER_ADVANCEDsampler for specified region
variation_seedoptINT00–18446744073709550000Sets the extra seed to be used for noise variation.
variation_strengthoptFLOAT0.000–1Sets the strength of the noise variation.
variation_methodoptCOMBOSets how the original noise and extra noise are blended together.

Outputs (1)

NameTypeDescription
REGIONAL_PROMPTSREGIONAL_PROMPTSregional prompts. (Can be used in the RegionalSampler.)