XY:PRE / Batch Collage Preview
See your whole batch at once — the contact sheet / XY-plot preview
- image
- image_out
- collage_image
- layout_json
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_countwins 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.
Inputs (24)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| columnsopt | INT | 00–64 | — |
| x_countopt | INT | 00–256 | — |
| layout_orderopt | COMBO | row_major | 2 options: row_major, column_major |
| tile_fit_modeopt | COMBO | contain | 3 options: contain, crop, stretch |
| Compact viewopt | BOOLEAN | false | — |
| tile_paddingopt | INT | 120–256 | — |
| outer_paddingopt | INT | 200–256 | — |
| label_heightopt | INT | 340–256 | — |
| label_alignopt | COMBO | left | 3 options: left, center, right |
| label_prefixopt | STRING | img | — |
| labelsopt | STRING | — | |
| start_indexopt | INT | 10–1000000 | — |
| index_paddingopt | INT | 21–8 | — |
| show_resolutionopt | BOOLEAN | true | — |
| show_xy_labelsopt | BOOLEAN | false | — |
| x_prefixopt | STRING | x | — |
| y_prefixopt | STRING | y | — |
| x_startopt | INT | 0-1000000–1000000 | — |
| y_startopt | INT | 0-1000000–1000000 | — |
| x_stepopt | INT | 1-100000–100000 | — |
| y_stepopt | INT | 1-100000–100000 | — |
| themeopt | COMBO | dark | 3 options: dark, light, studio |
| max_collage_sideopt | INT | 00–32768 | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| image_out | IMAGE | — |
| collage_image | IMAGE | — |
| layout_json | STRING | — |