Nodes/MKRShift_Nodes/XY:PRE / Batch Collage Preview
ComfyUI Node

XY:PRE / Batch Collage Preview

See your whole batch at once — the contact sheet / XY-plot preview

By criskb·Created 7 months ago·Updated 6 months ago· 0
XY:PRE / Batch Collage Preview
  • image
  • image_out
  • collage_image
  • layout_json
◄columns0►
◄x_count0►
◄layout_orderrow_major►
◄tile_fit_modecontain►
◄Compact viewfalse►
◄tile_padding12►
◄outer_padding20►
◄label_height34►
◄label_alignleft►
◄label_prefiximg►
◄labels►
◄start_index1►
◄index_padding2►
◄show_resolutiontrue►
◄show_xy_labelsfalse►
◄x_prefixx►
◄y_prefixy►
◄x_start0►
◄y_start0►
◄x_step1►
◄y_step1►
◄themedark►
◄max_collage_side0►

Running a batch of 36 seeds and clicking through previews one at a time is how you lose your mind. MKRBatchCollagePreview puts the whole batch on one labeled sheet - a contact sheet that lays every image in a grid with its index, resolution, and (optionally) the XY values that produced it, in a single output image you can actually look at. The search alias in the source is "XY:PRE", which tells you exactly what it's for: it's the preview half of an XY-plot-style sweep, without the plot machinery.

It's the flagship of the Inspect/Preview branch of MKRShift_Nodes, and it's the node people discover this pack for - the moment you've got a grid of variations to eyeball, this replaces four other habits.

How it works

The node takes an IMAGE input - and here's the trick: it's declared INPUT_IS_LIST, so it also accepts multiple image batches fed into the same socket, which it flattens into one list of tiles. It then lays them out on a labeled grid: every tile gets a label (index by default, custom text if you supply labels), with padding, a label strip, and a themed background (dark/light/studio). Columns are chosen automatically (sqrt of the count) unless you set columns or x_count.

The XY mode is the part that makes it a plot preview: flip show_xy_labels on and set x_start/x_step/y_start/y_step, and each tile's label gains its computed xN yM position based on its grid location - so a seed sweep or a prompt-vs-CFG sweep reads like a real XY grid instead of a mystery mosaic. Compact view switches to a masonry-style layout where each row keeps its natural widths instead of forcing a uniform cell.

Three outputs: image_out (your original batch, unchanged - handy for passing through), collage_image (the sheet, wire it to Preview Image), and layout_json (a schema + count, for anything programmatic).

Inputs that matter

  • image - the batch (or batches) to sheet.
  • columns / x_count - force a column count; x_count wins if set.
  • show_xy_labels + x_start/x_step/y_start/y_step - the XY-plot label mode.
  • labels - a multiline list of custom labels, one per image, overriding the auto-index.
  • label_height, tile_padding, outer_padding, theme - how the sheet looks.
  • max_collage_side - cap the sheet's longest side (0 = no cap); set it if you're sheet-ing 200+ tiles and don't want a 60-megapixel PNG.

Install

ComfyUI Manager (search "MKRShift Nodes"), or:

cd ComfyUI/custom_nodes
git clone https://github.com/criskb/MKRShift_Nodes

Restart. No dependencies beyond what ComfyUI already ships; no models. This one is pure preview.

Common issues

Feeding one giant batch and leaving columns at 0 usually works (it picks sqrt), but a batch of 1 gives you a one-tile sheet - that's expected, not a bug. If labels wrap or clip, raise label_height (default 34) - short labels at 46+ read better. And if you're using x_count for XY sweeps, remember it overrides columns silently; change one at a time or you'll be confused about which is winning. Otherwise: this node is the easy one. Plug a batch in, look at the sheet, move on with your life.

CategoryMKRShift Nodes/Inspect/Preview

Inputs (24)

NameTypeDefaultDescription
imageIMAGE—
columnsoptINT00–64—
x_countoptINT00–256—
layout_orderoptCOMBOrow_major2 options: row_major, column_major
tile_fit_modeoptCOMBOcontain3 options: contain, crop, stretch
Compact viewoptBOOLEANfalse—
tile_paddingoptINT120–256—
outer_paddingoptINT200–256—
label_heightoptINT340–256—
label_alignoptCOMBOleft3 options: left, center, right
label_prefixoptSTRINGimg—
labelsoptSTRING—
start_indexoptINT10–1000000—
index_paddingoptINT21–8—
show_resolutionoptBOOLEANtrue—
show_xy_labelsoptBOOLEANfalse—
x_prefixoptSTRINGx—
y_prefixoptSTRINGy—
x_startoptINT0-1000000–1000000—
y_startoptINT0-1000000–1000000—
x_stepoptINT1-100000–100000—
y_stepoptINT1-100000–100000—
themeoptCOMBOdark3 options: dark, light, studio
max_collage_sideoptINT00–32768—

Outputs (3)

NameTypeDescription
image_outIMAGE—
collage_imageIMAGE—
layout_jsonSTRING—