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

KSampler (Prompt by Tiled Region)

Regional Prompts on Canvases Too Big to Sample Whole

By Artificial-Sweetener·Created 3 months ago·Updated 12 days ago· 2
KSampler (Prompt by Tiled 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
diffusion_modemultidiffusion
latent_tile_width128
latent_tile_height128
latent_tile_overlap16
latent_tile_batch_size4

Regional prompting has a scaling problem. Masked conditioning on a 1024×1024 canvas is one thing; do it on a 3072×3072 canvas and the sampler is evaluating a latent so far outside its training resolution that regions stop cooperating and detail goes mushy. KSampler (Prompt by Tiled Region) is the answer to that second problem: it denoises the large latent in overlapping tiles while still honoring the global prompt plus ordered, mask-bound regional prompts. In other words, it's KSampler (Prompt by Region) with tiled diffusion bolted in, and it's the only sensible way to do regional prompting on big canvases without a monster GPU.

How it works

Every denoising step, the latent is divided into overlapping tile contexts, evaluated in batches, and the tile predictions are blended back together. The regional structure rides along because the per-region masks are applied inside each tile's conditioning. Two mechanisms are available via diffusion_mode:

  • multidiffusion (default): averages the overlapping predictions. Steady, predictable, the safe default.
  • Mixture of Diffusers: weights tile centers more heavily. Softer blending, which some people prefer when seams are the complaint.

The tile knobs are the same set as the pack's other tiled samplers:

  • latent_tile_width / latent_tile_height (default 128×128): tile size in latent pixels. Bigger tiles see more context but cost more VRAM.
  • latent_tile_overlap (default 16): overlap between tiles. More overlap kills seams but adds compute.
  • latent_tile_batch_size (default 4): tiles sampled per batch. Higher is faster but thirstier.

Plus the regional controls you already know from KSampler (Prompt by Region): regional_prompt_weight (0.5), region_mask_feather (0), and the global-first positive/negative batches pairing with region_masks. Sampling settings (steps 20, cfg 8, denoise 1) are standard KSampler fare. Output is a single latent.

When it's the right tool

The honest line from the pack README: tiled diffusion keeps each evaluation small, but tiles don't automatically understand the whole image - that's what Contextual Diffusion exists for. So this node is for when your regions are the point and the canvas is large: big-character scenes, full-body plus face on a tall canvas, that kind of thing. If the canvas is only moderately over budget, plain regional sampling might be fine and a lot faster. If you need the whole-image composition to stay coherent at extreme sizes, look at KSampler (Contextual Diffusion) instead - it doesn't do per-region prompts, but it does solve the "tiles lost the plot" problem.

Install

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

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 afterward. Needs a current ComfyUI build (v3 extension API).

Common issues

  • Tile seams - raise latent_tile_overlap, or switch diffusion_mode to Mixture of Diffusers.
  • Region prompts map wrong - ordering: batch entry 1 pairs with mask 0.
  • Out of VRAM - drop tile size or latent_tile_batch_size before touching anything else.
  • Nodes missing - update ComfyUI first; the pack won't register on an old build.

It's the regional sampler for when "just sample it whole" stopped being an option.

CategorySimpleSyrup/Sampling

Inputs (18)

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.
diffusion_modeCOMBOmultidiffusionTiled blend method; MultiDiffusion is steady while Mixture of Diffusers weights tile centers more strongly.
latent_tile_widthINT12816–512Width of each latent tile. Larger tiles see more context but use more memory.
latent_tile_heightINT12816–512Height of each latent tile. Larger tiles see more context but use more memory.
latent_tile_overlapINT160–256Overlap between latent tiles. Larger overlaps reduce seams but increase sampling work.
latent_tile_batch_sizeINT41–8Number of latent tiles sampled together. Higher values can be faster but use more memory.

Outputs (1)

NameTypeDescription
latentLATENTDenoised latent for VAE decode or more latent processing.