Nodes/ComfyUI WPX Nodes/SplitStickers
ComfyUI Node

SplitStickers

Cut a sticker sheet into individual stickers, automatically

By WangPengxing·Created 2 years ago·Updated 2 years ago· 0
SplitStickers
  • image_path
  • image

SplitStickers is the front-end of the WPX pack: it takes one image containing many stickers - a scanned sheet, a pre-made sticker collage, a row of icons - and returns each sticker as its own image. It's the node you run first, because its list output is exactly what the pack's arrangement nodes (AnimalContour, CircleContour, RectangleContour) want as their stickers input. One sheet in, a batch of clean sticker crops out, no model involved.

How it works

It's an OpenCV pipeline, and knowing the steps tells you when it'll struggle:

  1. Preprocess - a levels-style contrast stretch, grayscale, Gaussian blur, then Canny edge detection with dilation to thicken the boundaries.
  2. Find contours - findContours with a minimum-area filter to skip specks.
  3. Merge related pieces - the clever part. Small contours that heavily overlap a bigger one's bounding box get merged into it via convex hull. This is what keeps a sticker with separate internal details (a face on a body, text on a badge) from being chopped into fragments.
  4. Crop - each merged group's bounding box, plus a 20px margin, becomes the extracted sticker.

Output is a list of images (OUTPUT_IS_LIST), so the socket is a little different from the pack's single-image nodes - you'll typically feed it into a batch-aware node or an iterator to use the crops.

The inputs

Just one: image_path - the IMAGE containing multiple stickers. No knobs, no tuning. That's the whole input schema.

Installing

ComfyUI Manager → search "ComfyUI WPX Nodes" → install → restart. Manual:

cd ComfyUI/custom_nodes
git clone https://github.com/WangPengxing/ComfyUI_WPX_Node
# restart ComfyUI

No models, no requirements file. The pack-wide trap applies: rtree and scipy are imported at startup, so missing either kills the whole WPX_Node menu, not just this node. pip install rtree scipy and restart.

Troubleshooting

  • Stickers get chopped into pieces. Contour merging handles overlapping pieces, but stickers that are separate islands on the sheet (a sticker made of two disconnected blobs) will still split. That's a limitation of edge-based segmentation, not a bug.
  • Small stickers are dropped entirely. There's a hard filter dropping any contour under 128×128 pixels. Tiny stickers on a dense sheet won't survive; scan/photograph at higher resolution so they clear the bar.
  • Viewer windows pop open. The code calls .show() on every crop - on a headless box it just errors into the console. Harmless, noisy, consistent with the pack's general [DEBUG] enthusiasm.

A caveat to set expectations: this is the same pipeline the author uses to prepare sticker sheets by hand, and it's tuned for clean, separated stickers on a plain background. Hand-drawn clutter, shadows, or overlapping stickers will confuse it. For clean sheets it works well - and it's a genuinely useful companion to the pack's arrangement nodes.

CategoryWPX_Node/main_image

Inputs (1)

NameTypeDefaultDescription
image_pathIMAGE

Outputs (1)

NameTypeDescription
imageIMAGE