ComfyUI Node

Region Sketch

Give the sampler a blocking pass so four characters stay four

By Nynxz·Created 11 months ago·Updated about 12 hours ago· 4
Region Sketch
  • masks
  • layout
  • tile
  • image
◄background#ffffff►
◄fill#d7a589►
◄fitstretch►
◄padding-0.10►
◄blur24►

Ask an empty latent for four characters in four regions and you get two. Or one wide crowd. The mask says where each body should go, but an empty latent has nothing to hold on to - there's no structure anchoring a subject to a position, so the model does what a language model does with "four people": it draws the most likely arrangement, which is people standing together.

Region Sketch fixes that the way an artist does. Before any real detail, you block in a rough colour layout: one blob per subject, in the right place, at roughly the right scale. Then you encode that and sample it at denoise around 0.6–0.8. The blobs survive as placement, scale and colour; every detail gets repainted from the prompt.

What it produces

One image, at the size of your masks. Each region's box gets a copy of your tile - stretched by default, so a tall cell makes a tall oval - mirrored where Region Grid's layout says ~, and blurred so no hard edge survives into the result as a literal shape. Wire no tile and each region gets a soft oval of fill (a skin tone by default) over background (white).

That default pair is not arbitrary. A skin-coloured oval on white is exactly what an artist's rough blocking looks like, and it's enough for the model to infer "a person here". It also explains the one thing beginners get wrong: they expect a sketch that looks like something. It doesn't. It's three blurred blobs, and the whole design is that the sampler reads colour and placement rather than shape.

The inputs that matter: blur (24px default) is the softness - enough that no edge reads as a hard shape, not so much that two blobs merge. padding is negative by default (-0.1) and that's on purpose: shrinking each box leaves background between subjects, and background between subjects is the thing that stops them fusing into one figure. fit is stretch by default, which is right for an oval and wrong for a tile with a shape you want preserved - use contain then.

Regions in, and an important detail

masks (a MASK batch, e.g. Region Grid's) or layout (Region Grid's fusion_layout, which takes precedence and carries mirroring). No other source is expected.

One behaviour worth knowing: every separate piece of a region gets its own copy. Feed a region mask that covers two disconnected cells - a 1+4 group - and you get two blobs, not one oval stretched across the whole frame. That's the difference between a composition and a smear.

The pipeline

Region Grid ──> masks ──> Region Sketch ──> image ──> VAE Encode / Region Latent ──> KSampler

Denoise 0.6–0.8. Lower and you keep the blobs as blobs; higher and you've paid for a sketch the sampler will ignore. There's no noise to add here - the sampler's denoise already starts from this image plus noise, which is the mechanism in one sentence.

Install

Manager → search Nynxz → ComfyUI-NynxzNodes, or:

comfy node install comfyui-nynxz-nodes

From source:

cd ComfyUI/custom_nodes
git clone https://github.com/Nynxz/ComfyUI-NynxzNodes
cd ComfyUI-NynxzNodes
pnpm install && pnpm build

Restart. No models, no dependencies.

Troubleshooting

You got one blobby mass instead of four people. Either padding is positive (boxes overlap) or blur is high enough to bridge the gaps between them. Negative padding plus a 16–24px blur is the safe combination.

The sketch is visible in the output. Denoise too low, or blur too low so the oval's edge survived as an edge. Also check background - a coloured background that doesn't match your scene is a big colour block the sampler has to erase.

Subjects are in the right place but the wrong size. That's the region box, not this node. stretch fits the tile to the box, so a wide cell gives you a wide oval. Fix the grid's column_sizes/row_sizes, or use contain and accept the letterboxing.

Everything is skin-toned. You wired no tile and the default fill is doing what it says. A silhouette or a colour swatch as tile gives the sampler more to work with, especially for non-human subjects.

It's the least obvious node in the pack and possibly the most useful, because it addresses a failure that no amount of prompt engineering fixes: regional masks describe permission, not intent. The sketch supplies the intent.

CategoryNynxz/Regions

Inputs (8)

NameTypeDefaultDescription
backgroundSTRING#ffffffThe colour everywhere outside the copies.
fillSTRING#d7a589The oval's colour when no tile is wired.
fitCOMBOstretchHow the tile fills each region's box. stretch = to the box's shape; contain = keep the tile's aspect; cover = fill the box, cropping.
paddingFLOAT-0.10-0.45–0.5Grow (positive) or shrink (negative) each box by this fraction of its size. Shrinking leaves background between subjects so they don't merge.
blurINT240–256Soften every edge by this many pixels, so the sampler reads a blob of colour rather than a hard shape to reproduce.
masksoptMASKRegion masks, e.g. Region Grid's. Every separate piece of a region gets its own copy. Their size sets the image size.
layoutoptNYNXZ_FUSION_LAYOUTRegion Grid's fusion_layout: one copy per fusion cell, mirrored where it says `~`. Takes precedence over `masks`.
tileoptIMAGEWhat goes in each region, e.g. a skin-coloured oval on white. Transparent pixels show the background. Unwired = a soft oval of `fill`.

Outputs (1)

NameTypeDescription
imageIMAGE—