Grid Slice
Sprite sheet to frames in one node
- image
- IMAGE
People have been generating sprite sheets with diffusion models for years - pixel-art checkpoints that output whole sheets of character frames, ready for a game. The catch is that ComfyUI has never had a good built-in "now split that sheet" step. Grid Slice (class grid slice) is that step: one sprite sheet or texture atlas in, a batch of equally sized frames out. It's the simplest node in the ComfyUI-GameDev pack, and it's the one that saves you from doing the geometry by hand.
How it works
You tell it how your sheet is laid out and it does the math: frame_w = width // columns, frame_h = height // rows, then it slices each cell and concatenates everything into a single image batch. Frames come out in row-major order - top-left to bottom-right - so the batch order matches how you'd read the sheet.
The one subtlety is ignore_last_column. Flip it to true and the last column is skipped entirely. That's for sheets where the final column isn't part of the grid - a padding strip, a placeholder, or a different animation you don't want mixed into the batch.
The inputs that matter
image- the sprite sheet. Required, and it's a single image input, so feed it one sheet at a time.columns/rows- the grid layout, defaults 8×4, capped at 64 each. Set them to match your sheet, not your screen.ignore_last_column- boolean, default off. Flip it when the last column should be dropped.- Output: an
IMAGEbatch of frames. Wire it into a batch-to-file node to dump individual PNGs, or into an img2img pipeline to process every frame with identical settings.
Install
ComfyUI Manager, search "ComfyUI-GameDev". Or:
cd ComfyUI/custom_nodes
git clone https://github.com/ecalot/ComfyUI-GameDev
cd ComfyUI-GameDev
pip install .
Then restart ComfyUI. Same story as the rest of the pack: no model downloads, and the deps are torch>=2.6, numpy, and pillow - all already present.
Common issues
- Frames look misaligned or shifted - this node assumes a clean, gapless grid with no padding. If your sheet has spacing or uneven cells, the floor division quietly drops leftover edge pixels and your frames come out off. Trim or crop the sheet to a tight grid first.
- A column is missing - check
ignore_last_column. It's off by default, so if anything this is usually the opposite: you left it on and forgot. - It's a pure math node - no JS canvas, no UI magic - so unlike the other two nodes in this pack, it works fine on the newer Nodes 2.0 frontend.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| columns | INT | 81–64 | — |
| rows | INT | 41–64 | — |
| ignore_last_column | BOOLEAN | false | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |