Shape Mask Generator
Clean stamps for your collage, no image editor required
- MASK
You need a heart-shaped mask, right now, and you do not want to open an image editor or hand-draw it pixel by pixel. That's the entire job of Shape Mask Generator (part of the TJ_PolkaDot pack): it stamps one clean shape onto a fixed 1024×1024 canvas and hands you a standard ComfyUI MASK in the time it takes to double-click. It's the starting stamp of every polka-dot collage workflow - the thing you feed into the pack's placement node so you're never sculpting masks by hand.
It ships ten shapes: circle, heart, star, diamond, square, hexagon, triangle, cross, moon, and flower. Procedurally drawn, so there are no model files, no downloads, nothing to cache - it runs instantly on CPU. That's the whole pack's character, honestly: TJ16th's three-node collection, MIT-licensed, v0.1.0, and the README itself admits it was built with generative-AI help and has rough edges. The masks themselves are solid, though.
How it works
The node builds the shape directly onto a 1024×1024 float canvas, rotates it if you asked for rotation, then places it centered on whatever position_x / position_y you set. Nothing fancy under the hood - numpy and PIL, which is exactly why it's instant and why it works on any machine. Output is a single MASK in the usual 0–1 float range.
The inputs that matter
shape_type- your pick of the ten shapes. This is a dropdown; there are no custom shape options.scale- shape size relative to the canvas, 0.1 to 1.0 (default 0.8). At 1.0 the shape nearly fills the frame; at 0.1 it's a small stamp.position_x/position_y- where the shape's center lands, 0–1024 (default 512/512, dead center).rotation- degrees, −180 to 180. Set this per-stamp; the placement node has its own random rotation range later.feather- edge blur in pixels, 0–50. 0 gives a hard-edged stamp; a few pixels softens the edge so shapes blend instead of cutting in.
Where the MASK goes
Its natural destination is AdvancedShapePlacement in the same pack - that's the node that scatters copies of this stamp. But a mask is a mask in ComfyUI, so it also works anywhere a mask does: feed it to a Color to Mask→Image pair to preview it as a shape, invert it, or composite it. Just remember the fixed 1024×1024 canvas - if your workflow runs at another resolution, resize the mask (or let the pack's compositor auto-fit it, which it does).
One honest quirk: the README still talks about a size in pixels and a blur_radius, but the shipped node uses scale plus position_x/y and feather. The README is stale; trust the node.
Install
Standard custom-node install, and it's lightweight - dependencies are torch, numpy, and pillow, all of which ComfyUI already ships, so there's no pip dance and no model to download.
ComfyUI Manager → Custom Nodes Manager → search "TJ_PolkaDot" → Install → restart
# or by hand:
cd ComfyUI/custom_nodes
git clone https://github.com/TJ16th/ComfyUI-TJ-PolkaDot
# then restart ComfyUI
Troubleshooting
- Node doesn't show up after install. The pack is written against ComfyUI's newer plugin API (the
comfy_apiextension system) rather than the classicNODE_CLASS_MAPPINGSconvention, so it needs a recent ComfyUI. Update ComfyUI before blaming the pack. - Shape looks too soft. That's
featherdoing its job - set it to 0 for a crisp edge. - Shape is off-center. Check
position_x/position_y, not the canvas. At scale 0.1 a tiny stamp in the middle is expected, not a bug.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| shape_type | COMBO | circle | 10 options: circle, heart, star, diamond, square, hexagon, +4 |
| scale | FLOAT | 0.800.1–1 | Size of the shape relative to canvas |
| position_x | INT | 5120–1024 | X position of shape center |
| position_y | INT | 5120–1024 | Y position of shape center |
| rotation | FLOAT | 0-180–180 | Rotation angle in degrees |
| feather | INT | 00–50 | Edge blur amount in pixels |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| MASK | MASK | — |