Nodes/Img Label Tools/Advanced Stitcher
ComfyUI Node

Advanced Stitcher

N labeled grids in one pass — Advanced Stitcher for batch comparisons

By rjgoif·Created 12 months ago·Updated 13 days ago· 6
Advanced Stitcher
  • images
  • stitched_groups
◄N1►
◄group_modeevery_N►
◄labels►
◄label_endblank►
◄label_locationbottom►
◄label_size32►
◄fontarial.ttf►
◄label_stylewhite on black►
◄shapehorizontal►
◄smart_ratio►
◄forced_N1►
◄backgroundblack►
◄resize_anytrue►
◄size_guidelargest►
◄match_N1►
◄size_methodpad small dim►
◄pad_axisboth►
◄spacing5►
◄label_input—►

Advanced Stitcher is what you reach for when one comparison grid isn't enough. It's the batch version of the pack's Image Array node: instead of stitching your whole image list into a single grid, it splits the list into N groups and makes you N separate labeled grids, all in one pass. The result is a list of images you can save, flip through, or feed straight into a Reddit or Discord post.

The scenario that actually motivates this: you ran a batch sweep - say 4 seeds across 8 prompts, or a LoRA at 6 weights - and now you have 32 images sitting in one batch. What you want for the post is one tidy labeled grid per seed (or per weight), not a single 32-cell monster nobody can read. That's exactly what this node does.

How it works

Everything here is built on the same machinery as Image Array - equalize, label, arrange - the difference is only the grouping step up front. group_mode decides how your input list is carved up:

  • every_N (default) - interleaved. Group 0 takes images 0, N, 2N…, group 1 takes 1, N+1, … and so on. When the total isn't divisible by N, leftovers go front-to-back: group 0 gets the first extra, group 1 the next. This is the mode for "one grid per seed," because your seeds are interleaved in the batch.
  • length_N - chunked. Group 0 is the first N images, group 1 the next N, and so on. The last group is padded with blank filler if it comes up short.

Each group is then labeled and stitched into whatever shape you picked, and the label list restarts independently per group - if you have 3 labels and a group holds 5 images, label_end: blank leaves the trailing cells empty while repeat_last reuses the final label.

The inputs that matter

  • images - your batch or list. Feed it a normal IMAGE tensor and it splits by frames.
  • N - how many groups, which is also how many output grids you get. 1–256.
  • group_mode - every_N vs length_N, above. Get this wrong and your "by seed" comparison silently becomes a "by prompt" one.
  • shape - horizontal, vertical, square, or the smart_* options that pick the grid closest to a target aspect ratio.
  • labels / label_input - same multiline format as Image Array: one label per line, \n inside a line for a line break, semicolons also split. Connect label_input from another node to feed labels dynamically.
  • spacing, background, label_style - the styling knobs. label_style gives you white-on-black, black-on-white, or gray variants.

The single output is stitched_groups, a list of IMAGE tensors - one grid per group.

Install

ComfyUI Manager, search "Img Label Tools", install, restart. Or by hand:

cd ComfyUI/custom_nodes
git clone https://github.com/rjgoif/ComfyUI-Img-Label-Tools

Restart ComfyUI after either route. No models to download; Pillow and PyTorch ship with ComfyUI. Want a non-Arial font? Drop a .ttf into a fonts folder at your ComfyUI root and it appears in the dropdown.

Gotchas

This is the newest node in the pack (the repo is essentially one commit), so it's less battle-tested than Image Array. The per-group label restart trips people up - if labels look wrong, remember they're not global. And because every_N distributes leftovers front-to-back, groups can differ in size by one image, which makes grids slightly asymmetric. Not a bug, just something to expect.

CategoryImage Label Tools

Inputs (20)

NameTypeDefaultDescription
imagesIMAGEImages to group and stitch. Every image from every connected batch or list is used, in input order.
NINT11–256Meaning depends on group_mode. every_N: the number of groups (one stitched image per group). length_N: the number of images in each group.
group_modeCOMBOevery_Nevery_N: interleaved groups. Group k holds images k, k+N, k+2N and so on (12 images with N=3 gives [0,3,6,9], [1,4,7,10], [2,5,8,11]). length_N: consecutive chunks of N images ([0,1,2], [3,4,5], ...). In both modes a short group is filled out with blank slots.
labelsSTRINGLabels for the slots in each group, in order. One per line (press Enter) or separated by semicolons; type \n inside a label for a line break. The list restarts for every group. Ignored if label_input is connected.
label_endCOMBOblankWhat happens when a group has more slots than labels. blank: the extra slots get empty labels. repeat_last: the extra slots repeat the final label.
label_locationCOMBObottomWhere each label goes relative to its image. top, bottom: text above or below. left_hor, right_hor: horizontal text beside the image. left_vert, right_vert: rotated text beside the image. Every image gets the same amount of label space (sized for the longest label), so cells stay aligned.
label_sizeINT320–200Label font size in pixels. 0 turns labels off completely (no label space is added).
fontCOMBOarial.ttfLabel font. Lists the files in the fonts folder of your ComfyUI install. Without that folder, Arial is used. If the font cannot be loaded, a small built-in font is used and label_size has no effect.
label_styleCOMBOwhite on blackLabel colors. The first color is the text and the second is the label box (white on black is white text on a black box).
shapeCOMBOhorizontalGrid layout for each stitched group. horizontal: 1 row. vertical: 1 column. square: closest to square. smart_square / smart_landscape (3:2) / smart_portrait (2:3): pick the grid whose overall canvas shape is closest to the target. force_rows: output has forced_N rows. force_cols: output has forced_N columns. Images always fill left to right, then top to bottom.
smart_ratioSTRINGCustom W:H target for smart layout. Accepts 16:9, 16/9, 1.78, 3Wx1H, etc. Overrides the shape picklist when filled, except force_rows / force_cols, which take priority.
forced_NINT11–256Only used when shape is force_rows or force_cols. force_rows: number of rows in each stitched group (columns are worked out from it). force_cols: number of columns in each stitched group (rows are worked out from it). Fill order stays left to right, then top to bottom, so 14 images with 3 rows or 5 columns give the same 3x5 grid. Capped at the image count. With force_rows, if the exact row count would leave an empty row, the closest row count without one is used.
backgroundCOMBOblackCanvas color. Also used for blank filler slots, for padding added by size_method, and for the gaps from spacing.
resize_anyBOOLEANtrueON: resize the images in each group to one common size (see size_guide, size_method and pad_axis) before stitching. OFF: keep native sizes.
size_guideCOMBOlargestTarget size when resize_any is ON. largest / smallest: match the largest or smallest image in each group. match: match the size of image number match_N in each group. Ignored when resize_any is OFF.
match_NINT11–9999Only used when size_guide is match. Which image in each group (counting from 1, in group order) sets the target size. If a group has fewer images than this number, the last image in that group is used, so a large value such as 9999 always means the last image.
size_methodCOMBOpad small dimHow each image is fitted to the target size when resize_any is ON. pad small dim: scale to fit inside the target and fill the rest with the background color. stretch: resize to the exact target size, ignoring aspect ratio. crop_center: scale to fill the target, then cut the overflow equally from both sides. crop large dim: scale to fit inside the target with no padding and no cropping (one side matches the target and the other is smaller, so image sizes can differ).
pad_axisCOMBObothOnly used when resize_any is ON. Which dimension is made equal across each group. both: same width and height. height_only: same height, each image keeps its own width (good for horizontal rows). width_only: same width, each image keeps its own height (good for vertical columns).
spacingINT50–100Gap in pixels added around every image (after its label), filled with the background color. The gap between two neighbors is double this value.
label_inputoptSTRINGOptional text input. When connected, it replaces the labels box. Accepts a string or a list of them (one label per slot in each group).

Outputs (1)

NameTypeDescription
stitched_groupsIMAGEOne stitched image per group, as a list.