ComfyUI Node

XYImage

Turn a flat batch into a labeled grid

By M1kep·Created 3 years ago·Updated 2 years ago· 56
XYImage
  • images
  • x_labels
  • y_labels
  • z_labels
  • Image
splits
flip_axisFalse
batch_stack_modehorizontal
z_enabledFalse
x_main_label
y_main_label
z_main_label

XYAny builds the sweep, your sampler runs it, and XYImage is the payoff: it takes the flat list of generated images and reassembles them into a labeled grid. Checkpoints along the top, seeds down the side, labels on both axes, one clean image out. It's the second half of the XY workflow people actually run with this pack, and the answer to "how do I make a grid in ComfyUI without opaque nodes?"

The core inputs: images (the flat list), splits (how many images per column), batch_stack_mode (horizontal/vertical), flip_axis (False/True), and z_enabled (False/True). Then a stack of optional labels: x_main_label, y_main_label, z_main_label (strings for axis titles) and x_labels, y_labels, z_labels (lists for per-cell labels). The output is Image - a list, because with Z enabled it produces one grid image per Z slice.

The split math is the thing to understand first, because it's where errors happen. Give splits a single value and it's repeated to fill the image count - 12 images with splits 4 becomes [4, 4, 4], i.e. four columns of three rows. Give a full list and sum(splits) must equal the number of images exactly, or the node throws. The Sizes output from Join Image Lists feeds this directly: join two folders, wire the sizes in, and the grid splits exactly where you merged.

Labels have their own rules. Per-axis labels must match the split structure - the node checks counts and raises if they don't, which is your friend. flip_axis swaps which list becomes rows versus columns, and it swaps the x/y labels along with it so nothing gets mislabeled. x_main_label and y_main_label add proper axis titles (drawn sideways for the y-axis), which turns a grid into a figure.

Where it gets genuinely impressive is Z. Set z_enabled to True and the node treats your flat list as multiple grids stacked in Z - it needs x_labels and y_labels in this mode, and it outputs one labeled grid per Z value. That's how you get the third axis: three LoRAs, each rendered across the same checkpoint × seed grid, three grids out. It's the mechanism behind "XYZ plot for Flux" answers that name this pack.

Two honest caveats. First, it requires matplotlib for fonts - which ComfyUI ships, so it's a non-issue in practice; if you're on a stripped environment, that's the dependency that could bite. Second, label errors and split mismatches fail loudly rather than silently, so a broken grid usually announces itself as an exception before it wastes a batch - which, honestly, is the good kind of failure.

Install is the pack standard:

cd ComfyUI/custom_nodes
git clone https://github.com/M1kep/Comfy_KepListStuff

Restart ComfyUI or install Comfy_KepListStuff via Manager, and find it under List Stuff. Pair it with XYAny, feed it matching labels and splits, and you've got the transparent grid rig the community keeps pointing people to.

CategoryList Stuff

Inputs (11)

NameTypeDefaultDescription
imagesIMAGE
splitsINT
flip_axisCOMBOFalse2 options: False, True
batch_stack_modeCOMBOhorizontal2 options: horizontal, vertical
z_enabledCOMBOFalse2 options: False, True
x_main_labeloptSTRING
y_main_labeloptSTRING
z_main_labeloptSTRING
x_labelsopt*
y_labelsopt*
z_labelsopt*

Outputs (1)

NameTypeDescription
ImageIMAGE