Nodes/ComfyUI-Desert-Pixel-Nodes/DP Image Slice To Grid
ComfyUI Node

DP Image Slice To Grid

Chop one image into an NxN grid of tiles

By DesertPixelAi·Created 2 years ago·Updated about a year ago· 25
DP Image Slice To Grid
  • image
  • image
grid_size2

Take one image, cut it into an evenly-spaced grid of tiles, and get those tiles back as a batch you can process individually. That's the node. It's the kind of thing you want for tiled workflows - split an image into pieces, run each piece through a sampler or an effect, then stitch them back together - or just to break a big image into a grid for whatever comes next.

It's from DesertPixelAi's Desert-Pixel-Nodes, a large quality-of-life pack. Nothing in it generates images from scratch; this is an image-manipulation utility. It has a natural counterpart in the same pack, DP_Image_Grid_To_Image, which reassembles a grid back into one image - so the two together give you a slice-process-recombine loop.

How it works

You give it an image and a grid size N, and it slices the image into an N-by-N grid: grid size 2 gives you 4 tiles (a 2x2 grid), grid size 3 gives you 9, and so on. The tiles come out as a single IMAGE output, which in ComfyUI is a batch - so downstream nodes see the tiles as a set of images to iterate over.

Where this actually earns its keep is tiled processing. If you want to apply a per-tile operation - a detail pass, an effect, a filter - slicing lets you treat each region independently, then DP_Image_Grid_To_Image glues them back. It's a manual, transparent way to do grid work when you don't want a full tiled-upscaling framework.

The inputs and outputs that matter

There are only two inputs, which keeps it honest:

  • image - the IMAGE to slice.
  • grid_size - an integer from 1 to 10. It's the number of divisions per side, so the tile count is grid_size × grid_size. Start at 2 (a 2x2 grid) and go up as you need finer pieces.

The output is image (IMAGE) - the batch of tiles. Feed it into whatever processes the pieces, or straight into the grid-recombine node.

How to install it

  • ComfyUI Manager: search "Desert Pixel", install, restart. No models, no heavy deps.
  • Manual: cd ComfyUI/custom_nodes && git clone https://github.com/DesertPixelAi/ComfyUI-Desert-Pixel-Nodes, pip install -r requirements.txt if present, restart.

Find it under the DP category.

Common issues

The thing to keep in mind is that grid_size counts divisions per side, not total tiles. Set it to 3 expecting 3 pieces and you'll get 9. If you want a strip of N pieces rather than an N×N grid, this isn't the node for that - it's square grids only.

The other practical wrinkle: if your image dimensions don't divide evenly by the grid size, the tiles may not line up perfectly when you recombine, or edge tiles can differ slightly in size. For clean tiling, use an image whose width and height are both divisible by grid_size - resize first if needed. And remember the output is a batch: if a downstream node seems to only act on "one image," it's probably iterating over the whole batch of tiles, which is exactly what you want here.

CategoryDP/Image

Inputs (2)

NameTypeDefaultDescription
imageIMAGE
grid_sizeINT21–10

Outputs (1)

NameTypeDescription
imageIMAGE