Nodes/SimpleSyrup/KSampler (Prompt by Region)
ComfyUI Node

KSampler (Prompt by Region)

One Global Prompt, Per-Region Prompts, Zero Extra Nodes

By Artificial-Sweetener·Created 3 months ago·Updated 12 days ago· 2
KSampler (Prompt by Region)
  • model
  • positive
  • negative
  • region_masks
  • latent_image
  • latent
seed0
steps20
cfg8.0
sampler_name
scheduler
regional_prompt_weight0.50
region_mask_feather0
denoise1.00

Most regional prompting setups in ComfyUI are a small ceremony: build a batch, build masks, compose them into masked conditioning, then hand that to a sampler. KSampler (Prompt by Region) collapses the ceremony into one node. It denoises the full latent with a global prompt while ordered, mask-bound regional prompts do their thing - you wire in the model, the latent, a positive and negative batch, the region masks, and the sampler settings, and it does the rest. Same idea as Compose Regional Conditioning + a KSampler, but in a single drop-in that can't mis-wire the two halves.

How it works

The positive and negative inputs follow the global-first convention: batch entry 0 is the whole-canvas prompt, and entries 1..n pair with region_masks in order (mask 0 ↔ entry 1). Inside each mask area, the sampler blends the regional prompt against the global prompt according to two controls:

  • regional_prompt_weight (default 0.5): 0 = global only, 1 = regional only inside solid masks. This is the "how hard does the region prompt fight the global one" dial. It defaults to the middle because that's usually where you want it.
  • region_mask_feather (default 0): softens mask edges by that many pixels. Raise it when you get visible seams at region boundaries - the classic collaged look that gives regional prompting its bad reputation.

The rest is a normal KSampler: model, seed, steps (default 20), cfg (default 8), sampler_name, scheduler, latent_image, denoise (default 1). Output is a single latent, ready for a VAE decode or more latent processing.

When to use it vs. the alternatives

If you only ever use SimpleSyrup's samplers, this node is the convenient path. But here's the honest comparison: Compose Regional Conditioning + a native KSampler does the same job with output you can also feed into ControlNet stacks or KSamplerAdvanced. This node's edge is workflow ergonomics - one node, one seed control, regional prompts inline - at the cost of being locked to this pack's sampler. For most people that trade is fine; the regional controls are identical to the compose node, and you're already running the pack.

The underlying technique is worth remembering: masked conditioning fixes attribute bleeding between subjects, and it works best when regions don't stay hard-masked for the whole sample. If you're seeing seams, feather up and/or pull regional_prompt_weight below 1 - don't blame the node.

Install

Part of the SimpleSyrup pack. ComfyUI Manager → search SimpleSyrup → Install → restart. Manual:

Set-Location ComfyUI\custom_nodes
git clone https://github.com/Artificial-Sweetener/SimpleSyrup.git
Set-Location SimpleSyrup
..\..\venv\Scripts\python.exe -m pip install -r requirements.txt

Restart ComfyUI; the pack needs a current build (v3 extension API).

Common issues

  • Wrong prompt on a region - ordering, as always. Batch entry 1 pairs with mask 0.
  • Seams / collaged look - raise region_mask_feather, lower regional_prompt_weight.
  • Region prompt has no effect - regional_prompt_weight near 0 does that on purpose.

It's the one-node version of a two-node workflow, and it's the version you'll reach for when the workflow doesn't need the extra flexibility.

CategorySimpleSyrup/Sampling

Inputs (13)

NameTypeDefaultDescription
modelMODELDiffusion model used to denoise the input latent.
seedINT00–18446744073709550000Seed used to create sampling noise. Reusing it with matching settings makes results repeatable.
stepsINT201–10000Number of denoising steps. More steps can add refinement but take longer.
cfgFLOAT8.00–100Prompt guidance strength. Higher values follow the positive prompt more strongly but can look overcooked.
sampler_nameCOMBOSampling algorithm. It affects the image's look, speed, and stability.
schedulerCOMBONoise schedule used during sampling. It changes how quickly structure and detail form.
positiveCONDITIONING,CONDITIONING_BATCHPositive conditioning whose first batch entry is global and later entries pair with masks in order.
negativeCONDITIONING,CONDITIONING_BATCHNegative conditioning whose first batch entry is global and later entries pair with masks in order.
region_masksMASKOrdered authored masks; mask 0 pairs with conditioning batch entry 1.
regional_prompt_weightFLOAT0.500–1Balances regional prompts against the global prompt; 0 uses only global prompting, 1 uses only regional prompting inside solid masks, and overlaps reduce the global share further.
region_mask_featherINT00–512Softens regional mask edges by this many image pixels; 0 preserves authored mask values.
latent_imageLATENTLatent input whose samples will be denoised.
denoiseFLOAT1.000–1Sampling strength. Lower values preserve the input more; higher values allow larger changes.

Outputs (1)

NameTypeDescription
latentLATENTDenoised latent for VAE decode or more latent processing.