Nodes/comfyui-AGSoft/🖼️AGSoft Image Stitch Plus
ComfyUI Node

🖼️AGSoft Image Stitch Plus

The contact sheet builder ComfyUI keeps not shipping

By Art-xmaster·Created about a year ago·Updated about 20 hours ago· 30
🖼️AGSoft Image Stitch Plus
  • input_images
  • IMAGE
  • WIDTH
  • HEIGHT
  • ORDER_JSON
◄stitch_modegrid_auto►
◄number_positionoff►
◄grid_cols2►
◄grid_rows2►
◄fill_orderrow_first►
◄cell_fitcontain►
◄cell_aspectauto►
◄cell_width0►
◄cell_height0►
◄match_image_sizetrue►
◄megapixels0.00►
◄max_width0►
◄max_height0►
◄upscale_methodlanczos►
◄spacing_x0►
◄spacing_y0►
◄outer_padding0►
◄background_color_presetwhite (#FFFFFF)►
◄multiple_of0►
◄custom_background_color►
◄image_list_json[]►

Core's ImageStitch does two inputs, one direction, and you chain it - fine for gluing a reference next to a target, annoying the moment you want a 3x3 turnaround grid or a strip of keyframes. Image Stitch Plus takes up to 50 panels and gives you grids, strips and chains, plus a couple of tricks that make it a tool rather than a concatenate node with extra steps.

Two ways images get in

First, the built-in panel. Drag files onto the node, they upload to ComfyUI/input/agsoft_stitch/, and you get mini previews with drag-to-reorder, ◀▶ buttons, per-item enable/disable, double-click to replace, and an N/50 counter. The ordered list lives in the hidden image_list_json widget, so it survives a workflow reload.

Second, the input_images socket - a single tensor, a batch, or the list that 🖼️AGSoft Add Images produces. That's the intended pairing: aggregate your branches with Add Images, stitch here. External images are appended after the panel ones.

The modes

stitch_mode is the required widget and it's the whole personality of the node:

  • right / down / left / up - linear chain, pairwise, with match_image_size scaling each next image proportionally to the first.
  • 2x2 - a four-cell grid. It is exactly four: extra images are dropped silently.
  • context_mode - everything except the last image stacked into a column on the left, the last image on the right. The "here's the context, here's the thing you're operating on" layout.
  • row / column - one strip, 1xN or Nx1.
  • grid_auto - nearest square: columns = ceil(√N), so 5 images become a 3x2 with one gap.
  • grid_custom - grid_cols x grid_rows, where overflow extends the grid instead of cropping it (fill_order decides which axis grows, and row-major vs column-major placement).

Grid modes unify every cell. cell_aspect defaults to auto, meaning the first image's aspect ratio governs; cell_width/cell_height at 0 also mean "auto from the first image", and setting just one derives the other. cell_fit is contain (pad), cover (center crop) or stretch (distort).

Then the cosmetics: spacing_x/spacing_y, outer_padding, and background_color_preset - white by default, with custom_background_color (#RRGGBB) overriding it. That white default catches people: contain padding on a dark sheet looks wrong until you change it.

Sizing, numbering, and the outputs

megapixels caps the final size (0 = off, and it takes precedence - max_width/max_height are ignored when it's set). multiple_of rounds the result up to a multiple and centers the content on the padded canvas: 8 for SD-era sizes, 64 for some video VAEs, 112/128 for the awkward architectures.

number_position is the fun one: off, or one of six corners/centers. It burns small cyan 1..N badges into the output in stitch order, so on a reference sheet you can point at "panel 3" in a prompt. Only the output gets badges - the in-node previews stay clean.

Four outputs come back: IMAGE, WIDTH, HEIGHT (INTs) and ORDER_JSON, a list of the sources actually used in stitch order, with external frames labelled external_1, external_2. WIDTH/HEIGHT are handy for driving an Empty Latent or aspect-ratio node; ORDER_JSON feeds a text node when you need to remember what went where.

Installing

ComfyUI Manager → search comfyui-AGSoft, or:

cd ComfyUI/custom_nodes
git clone https://github.com/Art-xmaster/comfyui-AGSoft.git

Restart, then hard-refresh the browser - the preview panel is a JS extension, and without it you just get the widgets. Dependencies come from the pack's requirements.txt: numpy, opencv-python, translators. No model files. The pack is large, actively updated, and documented mostly in the author's Telegram channel; there's close to zero Reddit discussion of it, so debugging means reading the source.

Where it bites

The empty-source error. Empty panel and nothing on input_images gives you a runtime No image sources error. That's by design - linked inputs aren't present at validation time, so the node deliberately won't reject itself earlier.

Panel files are filenames, not pixels. The list stores names inside ComfyUI/input, so a workflow you share carries the recipe but not the ingredients. Rename or move a file and validation starts complaining about missing files or paths outside the input folder.

Reruns. Staleness is tracked by file mtime, and a missing panel file makes the node return NaN to the cache comparison - the always-rerun trick - quietly forcing everything downstream to re-execute on every queue. If your workflow feels sluggish, look for a broken panel entry.

Don't confuse the final resize with upscaling. megapixels + upscale_method is resampling, and lanczos is an interpolator: it cannot add detail. Use it to cap a big contact sheet before it hits a video model, not to rescue a small one.

Where it earns its place is sheets: stitched turnarounds and character sheets are how people ground consistency in later generations, and the same idea runs through the pack's video side, which feeds guide frames to MiniMax H3. Build it once, reuse it everywhere.

CategoryAGSoft/Image

Inputs (22)

NameTypeDefaultDescription
stitch_modeCOMBOgrid_autoStitch mode: • right/down/left/up — linear chain from first image • 2x2 — grid 2x2 (cell logic) • context_mode — column of all but last on left, last on right • row — strip 1xN, column — strip Nx1 • grid_auto — nearest square grid • grid_custom — fixed grid_cols x grid_rows --- Режим сшивания: • right/down/left/up — линейная цепочка от первого изображения • 2x2 — сетка 2x2 (логика ячеек) • context_mode — колонка из всех кроме последнего слева, последний справа • row — лента 1xN, column — лента Nx1 • grid_auto — ближайшая квадратная сетка • grid_custom — фиксированные grid_cols x grid_rows
number_positionCOMBOoffSingle widget for output numbering: off or corner/center position of small panel-style badges with sequence numbers (1..N, stitch order). Output only, panel previews untouched. --- Единый виджет нумерации выхода: off или позиция в углу/центре маленьких бейджей в стиле панели с порядковыми номерами (1..N, порядок сшивания). Только выход, превью панели не затрагиваются.
grid_colsINT21–50Columns for grid_custom (rows extend if images overflow). --- Колонки для grid_custom (строки добавляются при переполнении).
grid_rowsINT21–50Rows for grid_custom (columns extend if fill_order=column_first overflows). --- Строки для grid_custom (колонки добавляются при переполнении fill_order=column_first).
fill_orderCOMBOrow_firstGrid fill order: by rows or by columns. --- Порядок заполнения сетки: по строкам или по столбцам.
cell_fitCOMBOcontainHow image fits uniform cell: contain (pad with bg), cover (center crop), stretch (distort). --- Как изображение вписывается в ячейку: contain (поля фоном), cover (центральный кроп), stretch (искажение).
cell_aspectCOMBOautoCell aspect ratio: auto = aspect of first image. --- Пропорции ячейки: auto = пропорции первого изображения.
cell_widthINT00–8192Cell width in px (0 = auto from first image). --- Ширина ячейки в px (0 = авто по первому изображению).
cell_heightINT00–8192Cell height in px (0 = auto from first image). --- Высота ячейки в px (0 = авто по первому изображению).
match_image_sizeBOOLEANtrueLinear/context modes only: scale next images proportionally to first. --- Только линейные/context режимы: пропорциональное масштабирование последующих к первому.
megapixelsFLOAT0.000–16Target final size in megapixels (0 = no limit). --- Целевой размер итога в мегапикселях (0 = без лимита).
max_widthINT00–8192Max final width (0 = no limit). Ignored if megapixels > 0. --- Макс. ширина итога (0 = без лимита). Игнорируется при megapixels > 0.
max_heightINT00–8192Max final height (0 = no limit). Ignored if megapixels > 0. --- Макс. высота итога (0 = без лимита). Игнорируется при megapixels > 0.
upscale_methodCOMBOlanczosInterpolation method for scaling. Lanczos = best quality. --- Метод интерполяции при масштабировании. Lanczos = лучшее качество.
spacing_xINT00–512Horizontal gap between cells/images in px (bg color). --- Горизонтальный промежуток между ячейками/изображениями в px (цвет фона).
spacing_yINT00–512Vertical gap between cells/images in px (bg color). --- Вертикальный промежуток между ячейками/изображениями в px (цвет фона).
outer_paddingINT00–512Outer frame around whole result in px (bg color). --- Внешняя рамка вокруг всего результата в px (цвет фона).
background_color_presetCOMBOwhite (#FFFFFF)Preset background color. Used if custom_background_color is empty. --- Предустановленный цвет фона. Используется, если custom_background_color пуст.
multiple_ofCOMBO0Round final sizes up to a multiple and center content on the padded canvas. • 0 = off, 8 = SD standard, 64 = some VAE/video models, 112/128 = special architectures --- Округлить итоговые размеры вверх до кратности и центрировать содержимое на холсте. • 0 = выкл, 8 = стандарт SD, 64 = некоторые VAE/видео-модели, 112/128 = особые архитектуры
input_imagesoptIMAGEExternal images: single tensor, batch or list from AGSoft Add Images. Appended after panel images. --- Внешние изображения: тензор, батч или список из AGSoft Add Images. Добавляются после изображений панели.
custom_background_coloroptSTRINGCustom background color #RRGGBB. Overrides preset. --- Произвольный цвет фона #RRGGBB. Переопределяет пресет.
image_list_jsonoptSTRING[]Service field: JSON list of panel images (managed by UI). --- Служебное поле: JSON-список изображений панели (управляется UI).

Outputs (4)

NameTypeDescription
IMAGEIMAGEStitched result image. --- Итоговое сшитое изображение.
WIDTHINTFinal width in pixels. --- Итоговая ширина в пикселях.
HEIGHTINTFinal height in pixels. --- Итоговая высота в пикселях.
ORDER_JSONSTRINGJSON list of used sources in stitch order. --- JSON-список использованных источников в порядке сшивания.