Advanced Stitcher
N labeled grids in one pass — Advanced Stitcher for batch comparisons
- images
- stitched_groups
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_Nvslength_N, above. Get this wrong and your "by seed" comparison silently becomes a "by prompt" one.shape- horizontal, vertical, square, or thesmart_*options that pick the grid closest to a target aspect ratio.labels/label_input- same multiline format as Image Array: one label per line,\ninside a line for a line break, semicolons also split. Connectlabel_inputfrom another node to feed labels dynamically.spacing,background,label_style- the styling knobs.label_stylegives 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.
Inputs (20)
| Name | Type | Default | Description |
|---|---|---|---|
| images | IMAGE | Images to group and stitch. Every image from every connected batch or list is used, in input order. | |
| N | INT | 11–256 | Meaning 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_mode | COMBO | every_N | every_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. |
| labels | STRING | Labels 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_end | COMBO | blank | What 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_location | COMBO | bottom | Where 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_size | INT | 320–200 | Label font size in pixels. 0 turns labels off completely (no label space is added). |
| font | COMBO | arial.ttf | Label 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_style | COMBO | white on black | Label colors. The first color is the text and the second is the label box (white on black is white text on a black box). |
| shape | COMBO | horizontal | Grid 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_ratio | STRING | Custom 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_N | INT | 11–256 | Only 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. |
| background | COMBO | black | Canvas color. Also used for blank filler slots, for padding added by size_method, and for the gaps from spacing. |
| resize_any | BOOLEAN | true | ON: 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_guide | COMBO | largest | Target 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_N | INT | 11–9999 | Only 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_method | COMBO | pad small dim | How 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_axis | COMBO | both | Only 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). |
| spacing | INT | 50–100 | Gap in pixels added around every image (after its label), filled with the background color. The gap between two neighbors is double this value. |
| label_inputopt | STRING | Optional 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)
| Name | Type | Description |
|---|---|---|
| stitched_groups | IMAGE | One stitched image per group, as a list. |