Region Grid
Rectangle regions with no masks to draw, and cells that can group
- masks
- fusion_masks
- fusion_layout
Every regional workflow in ComfyUI assumes you've got masks. SAM3 finds them, or you paint them, or you feed one image to a detector and hope. But a lot of the compositions people actually want to generate are planned: left half this, right half that, or a 2×2 of four characters. There's no subject to segment, because the image hasn't been made yet. You need a grid.
Region Grid builds that grid at your output's size and emits it three ways - as LoRA regions, as fusion masks, and as a layout with per-cell mirroring. It's the front door to this pack's whole Regions group, and it's the cheapest way to try regional anything without touching a segmenter.
The inputs
width and height (1024×1024 by default, 16 to 16384, stepping in 8s). Only the aspect really matters - the masks get resampled to the model's latent grid anyway - so set them to your output's shape, not to a resolution you care about.
columns (2) and rows (1). Cells are numbered in reading order: left to right, then down.
Then the two string fields that carry all the cleverness:
regions - each gives one LoRA region per cell, which is the simple case. Groups let disconnected cells share a region: 1+4, 2+3 makes two regions covering the corners, so one character can own cells that aren't adjacent. That's the trick for a composition like two people at opposite sides with a third in the middle. Cells left out of every group belong to no region at all.
fusion - where copies of your fusion references land: all, none, or a list of copies like 1, 2~. A + stretches one copy over neighbouring cells (1+2), and a trailing ~ mirrors that copy. This is how you get two subjects facing each other without mirroring both references by hand.
gap (0 to 512, step 8) leaves unclaimed pixels between neighbouring cells so two regions don't meet on a hard seam - small values like 8 or 16 do a lot for avoiding visible seams at the boundary. column_sizes and row_sizes take comma-separated relative sizes: 2, 1, 1, 2 makes the outer columns twice as wide as the inner two, which is how you get four uneven panels instead of four equal ones.
The three outputs
masks is the LoRA regions - one mask per region - and goes into Regions from Masks. fusion_masks is the same idea for the reference copies. fusion_layout is the odd one out and the useful one: it carries the copy boxes and which copies are mirrored, which a mask batch can't express. Wire it into Fusion Regions' layout input, or into Region Sketch, and the ~ mirroring comes with it.
Region numbering is what Region LoRAs binds to, so a regions = each 2×2 gives you regions 1–4 in reading order, and grouped mode numbers the groups in the order you wrote them.
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.
Fair warning on scope: the consumer side of this pack's Regions group is Krea 2 only and experimental - the LoRA routing reads that DiT's attention hooks and fails loudly on anything else. The masks this node produces are ordinary MASK data and work with any regional approach, but if you were hoping to use Region LoRAs on an SDXL checkpoint, you'll get a refusal rather than a soft failure.
Troubleshooting
"regions must be …" - the string parser is strict. each, or comma-separated groups of cell numbers joined with +. Empty groups, ranges like 1-4, or a stray semicolon will raise.
"Cell 3 is in two fusion copies - each cell holds one." Fusion copies can't overlap. Each cell belongs to exactly one copy. The other geometry rule to know is that a copy has to fill its own bounding box: 1+2 across a 3-wide grid is fine because they're adjacent, but 1+3 on one row leaves cell 2 as a hole and is rejected - one copy is one rectangle.
Regions don't line up with the image. Check your aspect. A 1024×1024 grid driving a 1344×768 output gives you masks that are resampled from a different shape, so the split drifts from where you expected.
Only some cells do anything. In grouped mode, cells outside every group belong to no region. That's intentional - 1+4, 2+3 on a 2×3 grid leaves the middle row unowned, which is a legitimate composition but looks like a bug the first time.
Inputs (9)
| Name | Type | Default | Description |
|---|---|---|---|
| width | INT | 102416–16384 | Output width. Only the aspect matters — the masks are resampled to the model's grid. |
| height | INT | 102416–16384 | — |
| columns | INT | 21–16 | — |
| rows | INT | 11–16 | — |
| regions | STRING | each | How cells become LoRA regions: `each` (one per cell), or groups like `1+4, 2+3` — each comma-separated group is one region covering those cells. Cells left out of every group belong to no region. |
| fusion | STRING | all | Where copies of the fusion references go: `all`, `none`, or copies like `1, 2~` — `+` stretches one copy over neighbouring cells (`1+2`), a trailing `~` mirrors that copy. Cells left out get no fusion but are still LoRA regions. |
| gap | INT | 00–512 | Pixels left unclaimed between neighbouring cells, so two regions don't meet on a hard seam. |
| column_sizes | STRING | Relative column widths, one per column: `2, 1, 1, 2` makes the outer two twice as wide as the inner two. Empty = even. | |
| row_sizes | STRING | Relative row heights, one per row, like `column_sizes`. Empty = even. |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| masks | MASK | — |
| fusion_masks | MASK | — |
| fusion_layout | NYNXZ_FUSION_LAYOUT | Wire into Fusion Regions' `layout` — it carries which copies are mirrored, which the masks can't. |