Nodes/IAMCCS-nodes/IAMCCS Storyboard Auto Crop Grid
ComfyUI Node

IAMCCS Storyboard Auto Crop Grid

Slice a storyboard grid sheet into individual panel images, in reading order

By IAMCCS·Created 11 months ago·Updated 7 days ago· 113
IAMCCS Storyboard Auto Crop Grid
  • image
  • images
  • count
  • panel_width
  • panel_height
  • crop_manifest_json
columns2
rows3
panel_ordercolumn_major
output_width0
output_height0
crop_margin_px0

Storyboard pipelines love grids: Ideogram and friends generate a 2×3 or 3×3 contact sheet in one go, and then you need each panel as its own image for prompting, editing, or turning into video. IAMCCS_StoryboardAutoCropGrid is the slicer. You give it the sheet, tell it how many columns and rows the grid has, and it crops each cell into a separate image, in a deterministic order, with a manifest describing exactly what it did.

This is the node you reach for at the start of a storyboard-to-video workflow: sheet in, per-panel images out, ready for per-panel prompts, cropping into a video canvas, or feeding a contact sheet with captions downstream.

How it works

It divides the source image into columns × rows cells, computes the cell edges, and crops each cell. panel_order controls the slicing sequence: column_major walks down the first column then the next (the classic comic reading order), row_major walks across each row. If output_width / output_height are set (nonzero), each crop is resized to that size; otherwise the natural cell size is kept. crop_margin_px shrinks each crop by that many pixels on each side - handy for trimming the grid gutters the generator drew between panels. Because the source can be a batch of multiple sheets, every frame in the batch gets sliced, and all panels are concatenated into a single output batch.

The crop_manifest_json output records the source dimensions, grid, order, and each panel's crop box - which downstream nodes (like the caption sheet) can use to stay aligned with the actual panels.

Inputs and outputs

  • image (IMAGE) - the grid sheet (or batch of sheets).
  • columns, rows - the grid shape (defaults 2×3).
  • panel_order - column_major or row_major.
  • output_width, output_height - optional resize (0 = keep cell size).
  • crop_margin_px - gutter trimming.

Outputs: images (the per-panel batch), count, panel_width, panel_height, crop_manifest_json.

Installing

ComfyUI Manager → search "IAMCCS", or

cd ComfyUI/custom_nodes
git clone https://github.com/IAMCCS/IAMCCS-nodes.git

Restart. Pure image math with Pillow - no models, no pip deps.

Gotchas

The order trap is real: if your generator wrote the sheet in row-major order but you leave the default column_major, panel 1 ends up being the top-left of the first column, not the first row - every caption downstream is then one panel off. Match panel_order to how the generator actually laid the grid out. Also, grid detection is on you: if the generator's gutters aren't uniform, cell edges will cut through panels, which is exactly what crop_margin_px exists to fix - bump it when you see gridline artifacts bleeding into the crops.

CategoryIAMCCS/Cine/Ideogram

Inputs (7)

NameTypeDefaultDescription
imageIMAGE
columnsINT21–12
rowsINT31–12
panel_orderCOMBOcolumn_major2 options: column_major, row_major
output_widthINT00–8192
output_heightINT00–8192
crop_margin_pxINT00–512

Outputs (5)

NameTypeDescription
imagesIMAGE
countINT
panel_widthINT
panel_heightINT
crop_manifest_jsonSTRING