Super Director Tools · Grid Split
Nine Images Hiding Inside One, Cut Out Without Cropping Drift
- image
- selected_image
- all_cells
- selected_index
You generated a 3×3 character reference sheet - nine views of the same character in one image - and now you want panel 5 on its own to feed an upscaler, or all nine as a batch to review. That's this node. Load Image in, grid out.
If you only install one node from this pack, make it this one. It's the one doing arithmetic you'd get wrong by hand.
Why you'd need it
Turnaround sheets are the workhorse of character consistency - the pack's own Asset Prompt node writes the prompt for exactly this, and the community route that survived 2025 intact (CharTurner, Multi-View Character Creator, then Kontext-era sheet LoRAs) all output a grid of views in a single image. That's fine for a human. It's useless for a pipeline: everything downstream wants one image, or a batch of them, not a sheet with gutters.
Grid Split cuts the grid back apart, pixel-exactly.
The mechanism, and why it's fiddly
Integer division is where these nodes usually go wrong. If 1024 doesn't divide by 3, naive splitting leaves one row 1 pixel short and every subsequent row drifts - by the bottom of the grid your crop is cutting through a head. This one partitions the content region first, so cell boundaries land at i * content_w // cols and never accumulate error, and then offsets by the accumulated separator width. Each cell can differ by at most one pixel.
separator_px handles grids that were generated with visible gutters. It's the width of the internal bands only - outer border excluded - and it's not auto-detected, so measure it. The node subtracts (cols-1) * separator_px before dividing, which is exactly right for clean gutters and exactly wrong if you guess. Too wide and it raises rather than silently producing one-pixel cells.
Inputs and outputs
rows and cols are 1–64 each, and can't exceed the source image's dimensions. shot_number is 1-based and row-major - left to right, then top to bottom, so panel 5 of a nine-grid is the middle:
1 2 3
4 5 6
7 8 9
It can be converted to an INT input, which is how you sweep all panels over a queue instead of re-running by hand. separator_px defaults to 0 and lives in the optional group.
Three outputs, and the difference between the first two matters.
selected_image is an exact crop of just that panel, original pixels, nothing padded. This is the one you send into img2img, an upscaler, or a video pipeline.
all_cells is every panel as an IMAGE batch, grouped by source image: all of source 0's cells, then all of source 1's, and so on. Wire it to Contact Sheet to review a whole sheet at once, or into a batch-capable node. The catch: a batch needs uniform cell dimensions, so when the grid doesn't divide evenly, smaller cells are padded on the right and bottom by repeating their edge pixels. No scaling, no content lost - but all_cells for that cell is not bit-identical to selected_image. If you need the exact pixels, use selected_image.
selected_index is shot_number - 1, the 0-based index inside each source grid. For batch source b, the corresponding all_cells index is b * rows * cols + selected_index. Handy when you're naming output files.
Where it bites
shot_number must be between 1 and rows*cols - you asked for panel 10 of a nine-grid. rows cannot exceed image height - usually a 2×2 request on a small image, or a widget you meant to leave at 3. And the real one: a generated grid is rarely at exactly one-third intervals. Models draw gutters where they feel like it, at slightly wrong widths. If panel 5 comes out with a sliver of panel 6 attached, that's the model's grid, not the node's maths - measure the actual gutter and put it in separator_px.
Same story for the last row of an uneven grid: the bottom cells may be a pixel or two shorter, and selected_image shows you that honestly rather than hiding it.
Install
Manager → search Super Director Tools, or:
cd ComfyUI/custom_nodes
git clone https://github.com/mch000534/ComfyUI-DirectorTools
Restart ComfyUI and refresh the page; the node shows up under image/Super Director Tools as "Super Director Tools · Grid Split". No models, no pip install - requirements.txt is a one-line comment saying no additional dependencies, and this node is pure tensor slicing and bounds arithmetic.
A workflow that actually works
Load Image → Grid Split (rows=3, cols=3) → Preview Image on selected_image to confirm you're grabbing the right panel. Then split again into an img2img or upscale pass for the panel you liked, and send all_cells to Contact Sheet when you want to compare all nine before committing.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| rows | INT | 31–64 | — |
| cols | INT | 31–64 | — |
| shot_number | INT | 11–4096 | 1-based shot: left to right, then top to bottom. Must be <= rows × cols. |
| separator_pxopt | INT | 00–4096 | Width of internal separator bands in pixels; excludes outer border. 0 for no separators. |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| selected_image | IMAGE | — |
| all_cells | IMAGE | — |
| selected_index | INT | — |