Nodes/ComfyUI-SmartGridCutter/Smart Grid Cutter ✂️
ComfyUI Node

Smart Grid Cutter ✂️

Cut that 3×3 grid into real frames without counting pixels

By veoreg·Created 4 months ago·Updated 4 months ago· 0
Smart Grid Cutter ✂️
  • image
  • frame_0
  • frame_1
  • frame_2
  • frame_3
  • frame_4
  • frame_5
  • frame_6
  • frame_7
  • frame_8
  • cols
  • rows
  • total_frames
  • grid_info
mode
custom_cols3
custom_rows3
divider_threshold0.15
min_divider_width2
padding2
align_to16

You know the workflow: you generate one big 3×3 storyboard, or a 4×2 character turnaround sheet, and then you need each cell as its own image to feed into video, animation, or a LoRA dataset. Doing that with ComfyUI's built-in crop node means hand-counting pixels nine times, and the grid lines are never exactly where you think they are. Smart Grid Cutter is the node that looks at the image, finds the divider lines itself, and hands you back individual frames.

It's a small utility from iMind Studio, and it's honest about being one: it splits a grid image into up to nine cells, automatically if you let it. Zero model files, zero API calls, nothing to download beyond the node itself. If you've been manually cropping character sheets from the KB's turnaround-sheet playbook (generate a 2×2 or 3×3 grid, then use it as the ground truth for IP-Adapter or LoRA training), this is the step that stops being annoying.

How it works

The detection is pure image analysis, no ML involved. The node converts your image to grayscale, then scans rows and columns looking for uniform bands - divider lines are low-variance strips whose brightness contrasts with the cells on either side. When it finds enough of them, it knows where the grid is.

In auto mode it runs that detection and, if the result looks wrong (no dividers found at all), falls back to an aspect-ratio guess: square goes 3×3, wide goes 4×2, portrait-ish goes 3×2. In a preset mode like 3x3 it still tries smart detection first and only uses the preset as a sanity check - so it'll ride the actual divider positions when they're detectable and fall back to simple equal division when they're not.

One honest gotcha from reading the source: the divider_threshold input is effectively vestigial in the current version. The code accepts it, the tooltip says lower = more sensitive, but the detection no longer uses it - that's the reality of how the divider scan is written now. Don't go turning it down expecting different behavior; the one that actually matters is min_divider_width, which filters out speckle that's too thin to be a real grid line.

The inputs that matter

  • mode - auto is the selling point. Pick a preset (3x3, 4x2, 3x2, 2x2) when you already know the layout and want the fallback to be deterministic, or custom with custom_cols / custom_rows for something the presets don't cover.
  • padding - pixels trimmed from each cell edge after cutting. Divider lines are rarely clean single pixels; the default of 2 clears the fuzzy edge artifacts.
  • align_to - snaps each cell's dimensions down to a multiple of this (default 16). That's the setting for video pipelines, which want frame dimensions that divide cleanly. Set it to 1 if you want every pixel preserved.

What you get back

Nine frame_0 through frame_8 IMAGE outputs, plus cols, rows, total_frames, and a grid_info string that tells you which detection path ran. Wire any frame into your video, upscale, or detailing chain.

Watch the placeholder trap: the node always returns nine outputs, so a 2×2 grid pads the remaining five with tiny 16×16 black images. total_frames is the real count, and grid_info will say 4 frames - check it before you batch-save, or you'll silently write black tiles to disk.

Install

ComfyUI Manager is the easy path - search "SmartGridCutter". Or the manual way:

cd ComfyUI/custom_nodes/
git clone https://github.com/veoreg/ComfyUI-SmartGridCutter.git

Then restart ComfyUI. That's the whole install: no requirements, no models, nothing. (The README's clone URL still points at an old imind-studio org - the repo actually lives at veoreg, and Manager resolves either way.) You'll find it under image/transform.

Fair warning: this is a brand-new, barely-adopted node (it shipped as a single v1.0.0 commit), so you're getting a useful tool, not a battle-tested one. For a fixed layout you could always hand-crop instead - but for auto-detecting grids that change, it earns its keep.

Categoryimage/transform

Inputs (8)

NameTypeDefaultDescription
imageIMAGE
modeCOMBO6 options: auto, 3x3, 4x2, 3x2, 2x2, custom
custom_colsoptINT31–10
custom_rowsoptINT31–10
divider_thresholdoptFLOAT0.150.01–0.5Brightness difference threshold for detecting divider lines. Lower = more sensitive.
min_divider_widthoptINT21–20Minimum width in pixels for a line to be considered a divider.
paddingoptINT20–20Pixels to trim from each cell edge after cutting.
align_tooptINT161–64Align cell dimensions to this value (16 for video compatibility).

Outputs (13)

NameTypeDescription
frame_0IMAGE
frame_1IMAGE
frame_2IMAGE
frame_3IMAGE
frame_4IMAGE
frame_5IMAGE
frame_6IMAGE
frame_7IMAGE
frame_8IMAGE
colsINT
rowsINT
total_framesINT
grid_infoSTRING