Nodes/ComfyUI-Seed-Nodes/Seed-Nodes: SLICPixelator
ComfyUI Node

Seed-Nodes: SLICPixelator

Superpixel mosaic done properly

By Aerse·Created 2 years ago·Updated about a year ago· 5
Seed-Nodes: SLICPixelator
  • image
  • image
step10
iters1
stride10
weight1

Regular pixelation is a brute: it drops a rigid grid over the image and smashes every block into one color, which is exactly why pixelated photos look like they were run over by a spreadsheet. SLICPixelator is the smarter cousin. Instead of a fixed grid it uses the SLIC superpixel algorithm to segment the image into irregular regions that follow the actual content - edges stay edges, flat areas group together - then fills blocks of those regions with representative colors. The result is a mosaic that still reads as the picture. It's from the same ComfyUI-Seed-Nodes pack as the plain ImagePixelator, and it's the one with actual opinions.

How it works

The node ships its own from-scratch SLIC implementation (not a skimage wrapper), so here's the honest mechanics. The image is converted to LAB color space, and clustering centers are seeded on a regular grid at step-pixel intervals, nudged to local gradient minima. Over iters iterations, pixels are assigned to the nearest center using a combined color-and-distance metric - weight controls how much color similarity matters relative to spatial proximity. After clustering, the image is divided into stride-sized blocks, and each block is filled with the color of the superpixel that's most common inside it.

What that gives you, practically: a chunky, painterly mosaic where the block boundaries respect the image instead of marching across it. Bigger step = bigger, coarser superpixels. Smaller stride = finer output blocks. Higher weight makes the algorithm prioritize color over distance.

The inputs that matter

  • image - the input (RGB or RGBA; alpha is set aside during processing).
  • step (1–100, default 10) - the SLIC grid spacing. This is your main coarseness dial.
  • stride (1–100, default 10) - the output block size. Lower it for a finer mosaic finish.
  • iters (1–50, default 1) - clustering iterations. One pass is fast and decent; raise it when regions look noisy. Each extra iteration costs real time.
  • weight (1–100, default 1) - color-distance weight. Raise it to let color dominate grouping.

Output is a single image.

Where it fits

Think stylized thumbnails, pixel-art from photos, abstract mosaic posters, or batch-processing a folder into a consistent art direction (LoadMultipleImages from the same pack feeds it nicely). It's also a fun middle ground between "full pixelation" and "keep it recognizable" when you want a strong stylization that isn't a blur.

How to install it

Part of ComfyUI-Seed-Nodes:

cd ComfyUI/custom_nodes
git clone https://github.com/Aerse/ComfyUI-Seed-Nodes
# restart ComfyUI

Or ComfyUI Manager → search "ComfyUI-Seed-Nodes". One real difference from the rest of the pack: the SLIC code imports OpenCV (opencv-contrib-python is in the pack's requirements). It's a chunky wheel, and if the pack ever fails to load after install, this dependency is the first suspect - pip install opencv-contrib-python in your ComfyUI environment.

Common issues

  • Slow on big images - this is a hand-rolled Python loop over every pixel, iterated. Keep iters at 1 and drop the resolution upstream if it crawls; the plain ImagePixelator is the fast option.
  • Blotchy or noisy regions - bump iters a little, or raise weight to make color grouping cleaner.
  • ImportError on cv2 - OpenCV not installed; see the install note above. It's the one dependency in this pack that isn't guaranteed by ComfyUI itself.

The plain ImagePixelator is the utility tool; this one is the craft tool. If you want your pixelation to have edges, this is the node to reach for.

CategoryComfyUI-Seed-Nodes

Inputs (5)

NameTypeDefaultDescription
imageIMAGE
stepoptINT101–100
itersoptINT11–50
strideoptINT101–100
weightoptFLOAT11–100

Outputs (1)

NameTypeDescription
imageIMAGE