Nodes/LoRA Helpers/XY Grid Assembler
ComfyUI Node

XY Grid Assembler

Your LoRA grid, labelled without typing a single header

By shommey·Created 3 months ago·Updated 3 months ago· 1
XY Grid Assembler
  • images
  • grid
columns1
x_labels
y_labels
jpeg_compressfalse
jpeg_quality85

This is the finishing move of the comfyui-lora-helpers pack. Its sibling, KleinLoRAXYSampler, does the actual work - sampling every LoRA checkpoint × prompt combination and handing you a flat stack of images. This node turns that stack into the grid you actually wanted to look at: prompt labels across the top, LoRA checkpoint names down the left, cells neatly padded on a dark canvas with two thin accent lines. Column headers auto-size to the tallest label, and prompts word-wrap while checkpoint names - which usually have no spaces at all - wrap on underscores and hyphens instead.

It's the boring half of the pair, and that's a compliment. No sampling, no inference, no text encoders: about two hundred lines of plain PIL layout. It does exactly one thing and reads cleanly.

Why it earns its place

Because the sampler emits the labels as its own outputs, you never retype an axis. The x_labels, y_labels and columns outputs from KleinLoRAXYSampler plug straight in, and the grid is drawn with your prompts as headers and your checkpoint filenames as row labels. Generic XY-plot nodes in other packs make you fill both axes by hand; here the metadata travels with the images. That's the whole point of splitting this into two nodes instead of one giant one.

It isn't welded to the sampler, though. It accepts any IMAGE batch plus label strings, so you can feed it a batch from elsewhere if you like - just keep the ordering row-major.

The inputs that matter

  • images - the flat batch, row-major: cell at index i lands in row i // columns, column i % columns.
  • columns - the number of prompts per row. Wire the sampler's columns output here and forget it; there's no real reason to set it by hand.
  • x_labels / y_labels - the headers, one per line. Blank lines are ignored, and it's tolerant if a grid is short a label or two (it falls back to col 3, row 2).
  • jpeg_compress - the one worth touching. A full-res grid holds every decoded cell in memory, and a big checkpoint sweep at 1024² can get genuinely heavy. Compressing each cell and the final canvas to JPEG slashes memory and file size at a modest quality cost; resolution is unchanged, only quality drops. The bundled example workflow ships with it on and quality at 85.
  • jpeg_quality - 1–100, default 85. Good balance of size vs quality; only read when jpeg_compress is on.

The single output is grid - one ordinary IMAGE. Wire it to SaveImage or PreviewImage and you're done.

Install and gotchas

Same as its sibling: ComfyUI Manager (search comfyui-lora-helpers) or:

cd ComfyUI/custom_nodes
git clone https://github.com/shommey/comfyui-lora-helpers

then restart. Dependencies are Pillow, torch and numpy - already present in any working ComfyUI, and the pack downloads nothing. The real-world failure mode here is feeding it a batch that isn't row-major, which silently misplaces your row labels; the fix is to let the sampler produce the batch and labels together, the way the pack intends. This is a small, single-author pack, so if you hit anything weirder than that there's no big community to ask - but the layout code is short, MIT-licensed, and easy to read if you need to understand exactly what it drew.

Categorylora-helpers/klein

Inputs (6)

NameTypeDefaultDescription
imagesIMAGE
columnsINT11–50
x_labelsSTRING
y_labelsSTRING
jpeg_compressBOOLEANfalseCompress each cell and the final grid to JPEG before output. Significantly reduces memory and file size for large grids. Resolution stays the same; only quality is reduced.
jpeg_qualityINT851–100JPEG quality (1–100). 85 is a good balance of size vs quality. Only used when JPEG compress is enabled.

Outputs (1)

NameTypeDescription
gridIMAGE