IAMCCS Storyboard Auto Crop Grid
Slice a storyboard grid sheet into individual panel images, in reading order
- image
- images
- count
- panel_width
- panel_height
- crop_manifest_json
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_majororrow_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.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| columns | INT | 21–12 | — |
| rows | INT | 31–12 | — |
| panel_order | COMBO | column_major | 2 options: column_major, row_major |
| output_width | INT | 00–8192 | — |
| output_height | INT | 00–8192 | — |
| crop_margin_px | INT | 00–512 | — |
Outputs (5)
| Name | Type | Description |
|---|---|---|
| images | IMAGE | — |
| count | INT | — |
| panel_width | INT | — |
| panel_height | INT | — |
| crop_manifest_json | STRING | — |