K2 Region Preview
See what your boxes actually do before you burn a generation
- regions
- preview
- union_mask
- info
K2 Region Preview is the "check your work before you spend GPU time" node of the K2 Lab suite in comfyui-FVMtools. Regional prompting on Krea 2 is attention gating, not a crop-and-stitch pipeline, so you can't literally see the regions on the output image - this node renders them so you can. It takes a region chain and draws it three different ways, and it's the cheapest way to catch a misplaced box, an overlap you didn't intend, or a region that never attached.
The three modes
boxes- the hard rasterized token masks, i.e. the literal rectangles converted into the image tokens they'll own. This is the geometry check.field- the soft attention field, including subject competition and subject fill. This is what actually determines how hard each region binds, with the falloff you get past the box edge. It's the mode most worth looking at, because it shows the real binding strength instead of the box outline.ownership- which subject owns each image token under strict isolation. Overlapping subjects that share tokens show up here as split ownership, which is how the router prevents two characters from fusing into one.
Set width and height to the render size so the boxes line up with what you'll generate.
The inputs that matter
regions- the chain you want to inspect.mode- boxes / field / ownership, above.falloff_pixels- must match thefalloff_pixelsin your spatial tuning forfieldmode to show the real field, not a guessed one. If you changed tuning on K2 Spatial Tuning, change it here too.subject_competitionandsubject_fill- toggle whether the preview reflects those two tuning behaviours. If you turned them off in tuning, mirror that here or the preview lies.
Outputs
preview- the annotated image.union_mask- the combined mask of all regions. This is genuinely useful downstream, not just for eyeballing: it's the same shape K2 Compose emits, so you can wire it into a compositing or inspection step.info- a text breakdown of the layout.
Install
Same as every node in this pack:
cd ComfyUI/custom_nodes
git clone https://github.com/ping1979ping/comfyui-FVMtools
Restart ComfyUI, look under FVM Tools/K2. The K2 suite needs no extra Python dependencies beyond numpy.
Honestly, this is a node you'll use a lot while you're learning the suite and barely touch once your layout is stable - that's fine, that's what a preview node is for. The one habit that saves real time: build the whole layout in K2 Region Builder, preview it in field mode, and only then connect Compose. A 5-second preview beats a 30-second render that shows you the same mistake, only more expensively.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| regions | K2_REGION | The region chain to visualise. | |
| width | INT | 102464–16384 | Preview width — use the render size so boxes match. |
| height | INT | 102464–16384 | Preview height — use the render size. |
| mode | COMBO | field | boxes: hard rasterized token masks. field: the soft attention field incl. subject competition. ownership: which subject owns each image token. |
| falloff_pixels | FLOAT | 1280–2048 | Must match the tuning value to preview the real field. |
| subject_competition | BOOLEAN | true | Preview overlapping-subject ownership sharing. |
| subject_fill | BOOLEAN | true | Preview the stronger field towards box edges. |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| preview | IMAGE | — |
| union_mask | MASK | — |
| info | STRING | — |