Nodes/comfyui-fvmtools/K2 Region Preview
ComfyUI Node

K2 Region Preview

See what your boxes actually do before you burn a generation

By ping1979ping·Created 6 months ago·Updated about a month ago· 0
K2 Region Preview
  • regions
  • preview
  • union_mask
  • info
width1024
height1024
modefield
falloff_pixels128
subject_competitiontrue
subject_filltrue

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 the falloff_pixels in your spatial tuning for field mode to show the real field, not a guessed one. If you changed tuning on K2 Spatial Tuning, change it here too.
  • subject_competition and subject_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.

CategoryFVM Tools/K2

Inputs (7)

NameTypeDefaultDescription
regionsK2_REGIONThe region chain to visualise.
widthINT102464–16384Preview width — use the render size so boxes match.
heightINT102464–16384Preview height — use the render size.
modeCOMBOfieldboxes: hard rasterized token masks. field: the soft attention field incl. subject competition. ownership: which subject owns each image token.
falloff_pixelsFLOAT1280–2048Must match the tuning value to preview the real field.
subject_competitionBOOLEANtruePreview overlapping-subject ownership sharing.
subject_fillBOOLEANtruePreview the stronger field towards box edges.

Outputs (3)

NameTypeDescription
previewIMAGE
union_maskMASK
infoSTRING