⬡ S42 CutFlow Shape Mask
Animated shape masks straight from a keyframe string — no external assets
- mask
- frame_count
- info
Shape Mask is the primitive generator of the pack: it produces animated grayscale masks - rectangle, ellipse, star, or diamond - that you feed into anything with a mask input. Wire one into Mask Wipe for a custom transition, use it to drive a compositing matte, or keyframe its size and rotation for a growing/spinning reveal. Because the mask is generated procedurally from numbers, it's reproducible, resolution-independent, and needs no image assets or downloads.
The inputs that matter
The shape itself first: shape (rectangle / ellipse / star / diamond), center_x / center_y (0–1, both default 0.5), size (float, default 0.5 - relative to the frame, so 0.5 is a half-frame shape), feather (0–0.5, default 0.05 - edge softness), and invert (yes/no) to flip white↔black.
Then the canvas: width and height (64–8192, default 512×512) and frames (int, default 24) - how many mask frames to generate. Set frames to match your target clip's length, or to 1 for a static mask.
And then the animation, which is the part that makes this node more than a static-shape doodad:
- rotation_kf - a keyframe string animating rotation in degrees.
0:0, 24:360spins the shape one full turn over 24 frames. - size_kf - a keyframe string animating size.
0:0.2, 12:0.8, 24:0.2grows the shape in and shrinks it back out - a pulse.
The keyframe format is frame:value comma-separated pairs (same philosophy as the pack's Speed Ramp curve strings, just simpler - no easing suffix here).
How it works
Procedural generation, plain and simple: for each frame it evaluates the size and rotation keyframes at that time, draws the shape into a mask tensor at the requested resolution with the feather applied as a soft edge, and stacks the frames into a batch. The output mask is a standard MASK type, so it plugs directly into Mask Wipe's custom_mask, a Layer Composer layer mask, or any ComfyUI node that accepts masks. You also get frame_count and info outputs. It's CPU-only and instant - no models, no VRAM, nothing to download.
Installing it
The whole S42 CutFlow suite installs together:
cd ComfyUI/custom_nodes/
git clone https://github.com/GeekyGhost/S42-CutFlow.git
pip install -r S42-CutFlow/requirements.txt # Windows portable: python_embeded\python.exe -m pip
Or ComfyUI Manager, search S42 CutFlow, install, restart. It's under S42 CutFlow/Composition.
Gotchas
A few practical notes. First, width/height are the mask's own canvas, not automatically your clip's - if you generate a 512×512 mask and your clip is 1920×1080, you'll either need to resize the mask or set the dimensions to match. Most compositing nodes handle a size mismatch, but you'll get a softer, aliased edge if you do. Second, the default 24 frames is not a hint - if you want an animated mask over a 121-frame clip, set frames to 121 or your mask animation ends at frame 23 and holds. Third, keyframes past the frame count are ignored; keep them inside your range. And one nice-to-know: because feather is in normalized units, small values (0.05) give a clean hard-ish edge at any resolution while 0.3+ starts looking like a soft gradient blob - tune it to taste, since there's no "correct" setting. For a star or diamond, expect the classic stylized look rather than organic edges - that's the point.
Inputs (11)
| Name | Type | Default | Description |
|---|---|---|---|
| width | INT | 51264–8192 | Mask width. |
| height | INT | 51264–8192 | Mask height. |
| frames | INT | 241–9999 | Number of mask frames to generate. |
| shape | COMBO | ellipse | Mask shape type. |
| center_x | FLOAT | 0.500–1 | Shape center X (0-1). |
| center_y | FLOAT | 0.500–1 | Shape center Y (0-1). |
| size | FLOAT | 0.500.01–2 | Shape size relative to frame. 0.5 = half frame. |
| feather | FLOAT | 0.050–0.5 | Edge feathering/softness. |
| rotation_kf | STRING | Keyframe string for rotation animation. E.g. '0:0, 24:360'. Degrees. | |
| size_kf | STRING | Keyframe string for size animation. E.g. '0:0.2, 12:0.8, 24:0.2'. | |
| invert | COMBO | no | Invert the mask (white↔black). |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| mask | MASK | — |
| frame_count | INT | — |
| info | STRING | — |