Flex Mask Random Shapes β‘π ‘π π £π
Scatter animated shapes across a mask over time
- masks
- opt_feature
- MASK
This one's a generator more than a modifier: it scatters shapes - circles, stars, hearts, hexagons, and roughly two dozen others - across your sequence, each one appearing and disappearing on its own timeline. It's a good pick for confetti-style overlays, glitchy noise-shape textures, or a mask you want to feel alive and busy rather than a single clean region, especially once you drive the shape count or size with an audio feature.
How it works
shape_type picks the geometry - the schema lists 29 options, from basic circle/square/triangle through star, heart, crescent, and well beyond. max_num_shapes caps how many can be on screen at once, and max_shape_size caps how big any one shape gets. Each shape has its own lifecycle: appearance_duration and disappearance_duration set how many frames it takes to fade in and out, appearance_method picks how it appears (grow scales up from nothing, pop snaps in instantly, fade opacity-ramps in), and easing_function shapes the motion curve of that appearance/disappearance (linear, ease_in_out, bounce, elastic). Five of these - max_num_shapes, max_shape_size, appearance_duration, disappearance_duration, or none at all - are available through feature_param, so a FEATURE signal can drive how busy or how large the shape field gets in real time.
Inputs and outputs that matter
masks(required,MASK) - the input mask; check the node's actual behavior in your version, since the schema doesn't clarify whether shapes are constrained to this mask's region or generated independently across the frame.shape_type- circle, star, heart, and roughly two dozen more.max_num_shapes(default 10, 1β100) andmax_shape_size(default 0.2, 0.01β1) - how many shapes and how big.appearance_method/easing_function- how shapes fade in/out and the curve they follow doing it.opt_feature(optional,FEATURE) - reactively drive shape count, size, or timing.- Output - a single
MASK.
Installing it
Via ComfyUI Manager: search "RyanOnTheInside," install, restart. Manually:
cd ComfyUI/custom_nodes
git clone https://github.com/ryanontheinside/ComfyUI_RyanOnTheInside.git
cd ComfyUI_RyanOnTheInside
pip install -r requirements.txt
then restart. Procedural generation, no model downloads.
Common issues & troubleshooting
Shapes look chaotic and hard to control. With random variation built into the node's own name, that's partly by design - if you need something more predictable, lower max_num_shapes and pick linear or ease_in_out easing over bounce/elastic, which overshoot on purpose and read as more energetic/chaotic.
Nothing seems to appear. Give the sequence enough frames - appearance_duration and disappearance_duration are measured in frames, so a very short clip may not have enough runway for a shape's full lifecycle to play out and become visible.
Reactive shape count/size doesn't seem to change anything. Confirm feature_param targets one of the four modulatable fields and isn't left on None, the same check that applies across the whole Flex mask family.
Inputs (17)
| Name | Type | Default | Description |
|---|---|---|---|
| strength | FLOAT | 1.000β1 | Overall strength of the feature modulation (0.0 to 1.0) |
| feature_threshold | FLOAT | 0.000β1 | Threshold for feature activation (0.0 to 1.0) |
| feature_param | COMBO | Choose which parameter to modulate: - max_num_shapes: Dynamically adjust shape count - max_shape_size: Dynamically adjust shape size - appearance_duration: Dynamically adjust fade-in time - disappearance_duration: Dynamically adjust fade-out time - None: No parameter modulation | |
| feature_mode | COMBO | relative | How to apply the feature modulation: - relative: Changes are centered around the original value - absolute: Changes scale directly from zero to the maximum |
| masks | MASK | Input mask or sequence of masks to be processed (MASK type) | |
| invert | BOOLEAN | false | When enabled, inverts the mask output (black becomes white and vice versa) |
| subtract_original | FLOAT | 0.000β1 | Amount of the original mask to subtract from the result (0.0 to 1.0) |
| grow_with_blur | FLOAT | 0.00β10 | Amount of Gaussian blur to apply for mask growth (0.0 to 10.0) |
| mask_strength | FLOAT | 1.000β1 | Overall strength of the mask effect (0.0 to 1.0) |
| max_num_shapes | INT | 101β100 | Maximum number of shapes to generate (1 to 100) |
| max_shape_size | FLOAT | 0.200.01β1 | Maximum size of each shape (0.01 to 1.0) |
| appearance_duration | INT | 101β100 | Duration of shape appearance (1 to 100 frames) |
| disappearance_duration | INT | 101β100 | Duration of shape disappearance (1 to 100 frames) |
| appearance_method | COMBO | Method of shape appearance ('grow', 'pop', 'fade') | |
| easing_function | COMBO | Easing function for shape animation ('linear', 'ease_in_out', 'bounce', 'elastic') | |
| shape_type | COMBO | Type of shape to generate | |
| opt_featureopt | FEATURE | Optional feature input for modulation Connect any feature node here to control the effect. Features can come from audio, motion, color, or other sources. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| MASK | MASK | β |