Nodes/ComfyUI-Kie-API-Serverless/KIE Grid Slice [SL]
ComfyUI Node

KIE Grid Slice [SL]

Slice a KIE grid image like a pro

By v3devv·Created 7 months ago·Updated 4 months ago· 0
KIE Grid Slice [SL]
  • image
  • tiles
grid2x2
outer_crop_px0
gutter_px0
orderrow-major
process_batchfirst
logtrue

Here's the workflow that makes this whole pack make sense: instead of paying for four or nine separate Nano Banana Pro images, you generate one grid image in a single API call and then cut it up locally. That's exactly what this node is for - and it's the rare node in this pack that doesn't call any API and needs no key. It's a pure local tensor slicer.

If you've ever grid-batched a closed model to keep costs down, you already know the pain: the returned image is a 2x2 or 3x3 montage and your downstream nodes want individual images. GridSlice fixes that in one step. Feed it the montage, tell it the layout, and it returns a batch of tiles you can fan out into a Kling I2V node or a per-cell edit loop.

The inputs that matter

  • grid - 2x2, 2x3, or 3x3. This has to match what the model actually returned; the node doesn't auto-detect the layout.
  • outer_crop_px - pixels trimmed from each side before slicing. Grid images often arrive with a white border; this strips it.
  • gutter_px - pixels to remove between tiles. If your montage has spacing lines baked in, this carves them out.
  • order - row-major (left-to-right, top-to-bottom) or column-major (top-to-bottom, then across). Pick the one that matches how you'll feed the tiles downstream.
  • process_batch - first (only slice the first image in the batch) or all.

Output is a single tiles IMAGE batch - 4, 6, or 9 tiles per processed image, stacked on the batch dimension. Wire it into anything that takes a batch.

The traps

The node does not rescale tiles. It divides the cropped area into equal rectangles, and any remainder pixels are silently dropped by the integer division. If your montage isn't exactly divisible by the grid, tiles come out a pixel or two short - usually harmless for video nodes, annoying for pixel-perfect work. And if outer_crop_px or gutter_px is bigger than the image allows, you get an error telling you exactly that. Keep those numbers conservative.

Install

Same as its siblings: ComfyUI Manager search "Kie-API-Serverless", or

cd ComfyUI/custom_nodes
git clone https://github.com/v3devv/ComfyUI-Kie-API-Serverless

Restart, and you'll find it under the kie-sl/helpers category. No dependencies beyond what ComfyUI already has, no key required, no credits spent. If you grid-batch anything, this node pays for its install in about one workflow.

Categorykie-sl/helpers

Inputs (7)

NameTypeDefaultDescription
imageIMAGE
gridoptCOMBO2x23 options: 2x2, 2x3, 3x3
outer_crop_pxoptINT00–8192
gutter_pxoptINT00–8192
orderoptCOMBOrow-major2 options: row-major, column-major
process_batchoptCOMBOfirst2 options: first, all
logoptBOOLEANtrue

Outputs (1)

NameTypeDescription
tilesIMAGE