ComfyUI Node

Sticker Compositer

Paste a whole sticker sheet in one node — and dodge its two crash traps

By sweetndata·Created 2 years ago·Updated 2 years ago· 1
Sticker Compositer
  • destination
  • source
  • mask
  • IMAGE
x194
y1700
x2614
y2700
x31134
y3700
x494
y41420
x5614
y51420
x61134
y61420
resize_sourcefalse

Sticker Compositer is the finishing step for the most tedious part of any sticker-pipe: taking six generated stickers and actually laying them out on a themed background. You feed it a frame, a batch of six cut-out stickers, and their masks, and it pastes each one at its own position with soft, mask-driven edges. One node, one output, done. If you've ever chained five ImageCompositeMasked nodes just to build a 3×2 sheet, you know exactly who this is for.

The one-line README ("background frame + sticker") undersells it about as much as a README can - but it also hides two traps that will crash on you the first time. More on those below; they're the reason most people bounce off this thing.

How it actually works

The mechanism is ComfyUI's own masked-composite math, so it's battle-tested - this pack basically forks the composite() function from core and wraps a loop around it. For each of the six (x, y) pairs it does the classic blend:

output = mask * sticker + (1 - mask) * frame

with clamping so a sticker that hangs off the edge of the frame gets clipped instead of erroring. The loop shuffles the batch/channel dims around (movedim(-1, 1)), repeats the source batch to match the destination, and if you hand it a mask it interpolates that mask to the sticker's size before blending. Soft mask edges = soft sticker edges, which is what keeps a pasted sticker from looking like a cutout pasted on top (the same principle the KB's background-removal notes lean on: a hard segmentation mask on a coloured frame falls apart; a soft alpha looks composited).

The defaults aren't random - they're a 3×2 grid tuned for a tall portrait frame: three columns at x=94/614/1134, two rows at y=700/1420. If your background is square or landscape, those defaults will silently paste nothing in the bottom row (y=1420 clips off a 1024-tall canvas), so set the coordinates for your frame.

The inputs that matter

Most of the schema is self-explanatory, so here's the short list:

  • destination (IMAGE) - the background frame. Can be a batch; the source gets repeated across all frames.
  • source (IMAGE) - must be a batch of at least 6 images, one sticker per grid slot. A single image won't work.
  • x1–x6 / y1–y6 (INT, 0–16384) - the top-left corner of each sticker. Six pairs, one per sticker.
  • mask (MASK) - declared optional, but in practice required. See the trap below.
  • resize_source (BOOLEAN, default false) - resizes each sticker to the full destination size via bilinear interpolation. For a sheet you want this off; turn it on only if you're pasting one full-bleed image.

Output is a single IMAGE: the finished frame. Wire it straight into Save Image / Preview Image.

Installing it

No models, no weights, no GPU download - the pack is a single Python file. Easiest route is ComfyUI Manager (search "ComfyUI_Sticker_Compositer" or "Sticker Compositer"), or the manual way:

cd ComfyUI/custom_nodes
git clone https://github.com/sweetndata/ComfyUI_Sticker_Compositer

Then restart ComfyUI. You'll find Sticker Compositer under the "image" category.

Ignore the pack's requirements.txt - it's a copy-paste of the author's other project's deps (googletrans, httpx, anyio - none of which this node touches). Same for pyproject.toml, which still calls itself "ComfyUI-Image-Harmonizer". The node only needs torch/PIL/numpy/scipy/torchvision, all already bundled with ComfyUI. This is one of those packs where the metadata rotted and the code is all that's real.

Where people get burned

  • The mask is a trap. It's marked optional, but the code indexes mask[i] directly inside its loop - leave the input unconnected and you get TypeError: 'NoneType' object is not subscriptable. Practically speaking, always wire in the same cutout masks you used to isolate your stickers (BiRefNet output works great).
  • Source must be a batch of 6. Feed it a single sticker and it crashes on the second iteration with an index error. If you only have five, make your workflow produce six or pad the batch.
  • Debug spam. Every run prints source_portion:/destination_portion: shapes to the console. Harmless, just noisy - a sign this is a hobbyist utility, not a polished product.
  • Coordinates are canvas-specific. As noted, the defaults assume a tall frame. On anything square, adjust y2–y6 or you'll get empty rows.

Honest take: this is a thin convenience node. If you already have a compositing setup you love, six ImageCompositeMasked nodes reproduce it exactly. But if you're running a Discord/Telegram/WhatsApp sticker pipeline and want "generate six, drop them on a frame" in one shot, Sticker Compositer is the closest thing to a one-click finisher - once you know its two quirks.

Categoryimage

Inputs (16)

NameTypeDefaultDescription
destinationIMAGE
sourceIMAGE
x1INT940–16384
y1INT7000–16384
x2INT6140–16384
y2INT7000–16384
x3INT11340–16384
y3INT7000–16384
x4INT940–16384
y4INT14200–16384
x5INT6140–16384
y5INT14200–16384
x6INT11340–16384
y6INT14200–16384
resize_sourceBOOLEANfalse
maskoptMASK

Outputs (1)

NameTypeDescription
IMAGEIMAGE