Nodes/comfyui-niutonian-smart-image/Smart Batch Processor
ComfyUI Node

Smart Batch Processor

One node that stitches, grids, borders, and splits — with a log string to prove it

By Niutonian·Created 7 months ago·Updated 7 months ago· 0
Smart Batch Processor
  • image_1
  • image_2
  • image_3
  • image_4
  • image_5
  • image_6
  • image_7
  • image_8
  • image_9
  • result_1
  • result_2
  • result_3
  • result_4
  • processing_log
operation_modestitch_horizontal
batch_size4
output_formatindividual
save_templatefalse
template_namemy_template
stitch_directionright
stitch_alignmentcenter
resize_modenone
spacing10
grid_rows2
grid_cols2
border_width20
border_colorwhite

Smart Batch Processor is the Swiss-army node of the Niutonian Smart Image Suite: one node that can stitch horizontally, stitch vertically, build a grid, add borders, or split an image - and it's the only node in the pack that hands you a text log of what it just did. If you're building a workflow where the operation changes between runs but the images don't, this is the node that keeps it in one box instead of four.

It's pure Pillow, no models, no API. And it has a couple of quirks worth knowing before you wire it into anything you'll rely on.

How it works

operation_mode picks the job:

  • stitch_horizontal / stitch_vertical - line up your connected images in a strip, using stitch_direction, stitch_alignment, resize_mode, and spacing.
  • create_grid - arrange images into a grid_rows × grid_cols grid with spacing.
  • add_borders - wrap every valid image in a border of border_width and border_color.
  • split_images - split the first connected image into a grid.

batch_size (1–9) is mostly a hint about how many inputs you're using - the node actually just reads whatever image_1image_9 are connected, so you can leave it at the default. output_format is individual or combined; like a couple of other controls in this suite it's currently accepted but doesn't change the behavior, so don't expect combined to fuse anything yet.

Results come out of result_1 through result_4, plus a processing_log output - a plain STRING you can wire into any Show Text node to see what ran. The catch: there are four result outputs, but some modes produce more work than that. add_borders with six images generates six bordered images and silently drops the extras past result_4. split_images is the reverse - it only ever operates on the first image and caps its output at four parts. Plan around four results per batch and you won't be surprised.

The template system - and its honest limit

save_template with a template_name writes your current settings (operation mode, spacing, grid rows, border width, etc.) as a JSON file into a templates/ folder inside the pack's own directory. That part works. What doesn't exist yet is a way to load a saved template back into the node - there's no load input. So think of it as a config export you can stash in version control, not a working preset system. The README pitches it as "save frequently used settings," and the save half is real.

Installing

cd ComfyUI/custom_nodes
git clone https://github.com/Niutonian/comfyui-niutonian-smart-image

Restart, find it under Niutonian/Image Processing. No extra dependencies (Pillow only), no model downloads. If you installed the pack via ComfyUI Manager, the requirements are handled automatically.

Honest verdict: this is the pack's "kitchen sink" node, and like most kitchen sinks it's convenient rather than deep. The individual dedicated nodes (Smart Image Stitch, Smart Grid Stitch, Smart Border & Frame) each do their one job better and expose more controls. Reach for Batch Processor when you want a single drop-in that can switch operations - or when you specifically want that processing_log string feeding a text node so your workflow tells you what it did.

CategoryNiutonian/Image Processing

Inputs (22)

NameTypeDefaultDescription
operation_modeCOMBOstitch_horizontal5 options: stitch_horizontal, stitch_vertical, create_grid, add_borders, split_images
batch_sizeINT41–9
output_formatCOMBOindividual2 options: individual, combined
save_templateBOOLEANfalse
template_nameSTRINGmy_template
stitch_directionoptCOMBOright4 options: left, right, top, bottom
stitch_alignmentoptCOMBOcenter3 options: start, center, end
resize_modeoptCOMBOnone3 options: none, largest, smallest
spacingoptINT100–100
grid_rowsoptINT21–4
grid_colsoptINT21–4
border_widthoptINT200–100
border_coloroptCOMBOwhite3 options: white, black, gray
image_1optIMAGE
image_2optIMAGE
image_3optIMAGE
image_4optIMAGE
image_5optIMAGE
image_6optIMAGE
image_7optIMAGE
image_8optIMAGE
image_9optIMAGE

Outputs (5)

NameTypeDescription
result_1IMAGE
result_2IMAGE
result_3IMAGE
result_4IMAGE
processing_logSTRING