Nodes/RyanOnTheInside/Flex Mask Random Shapes βš‘πŸ…‘πŸ…žπŸ…£πŸ…˜
ComfyUI Node

Flex Mask Random Shapes βš‘πŸ…‘πŸ…žπŸ…£πŸ…˜

Scatter animated shapes across a mask over time

By ryanontheinsideΒ·Created 2 years agoΒ·Updated 5 months agoΒ· 852
Flex Mask Random Shapes βš‘πŸ…‘πŸ…žπŸ…£πŸ…˜
  • masks
  • opt_feature
  • MASK
β—„strength1.00β–Ί
β—„feature_threshold0.00β–Ί
β—„feature_paramβ–Ύβ–Ί
β—„feature_moderelativeβ–Ί
β—„invertfalseβ–Ί
β—„subtract_original0.00β–Ί
β—„grow_with_blur0.0β–Ί
β—„mask_strength1.00β–Ί
β—„max_num_shapes10β–Ί
β—„max_shape_size0.20β–Ί
β—„appearance_duration10β–Ί
β—„disappearance_duration10β–Ί
β—„appearance_methodβ–Ύβ–Ί
β—„easing_functionβ–Ύβ–Ί
β—„shape_typeβ–Ύβ–Ί

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) and max_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.

CategoryRyanOnTheInside/FlexFeatures/Targets/Masks

Inputs (17)

NameTypeDefaultDescription
strengthFLOAT1.000–1Overall strength of the feature modulation (0.0 to 1.0)
feature_thresholdFLOAT0.000–1Threshold for feature activation (0.0 to 1.0)
feature_paramCOMBOChoose 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_modeCOMBOrelativeHow to apply the feature modulation: - relative: Changes are centered around the original value - absolute: Changes scale directly from zero to the maximum
masksMASKInput mask or sequence of masks to be processed (MASK type)
invertBOOLEANfalseWhen enabled, inverts the mask output (black becomes white and vice versa)
subtract_originalFLOAT0.000–1Amount of the original mask to subtract from the result (0.0 to 1.0)
grow_with_blurFLOAT0.00–10Amount of Gaussian blur to apply for mask growth (0.0 to 10.0)
mask_strengthFLOAT1.000–1Overall strength of the mask effect (0.0 to 1.0)
max_num_shapesINT101–100Maximum number of shapes to generate (1 to 100)
max_shape_sizeFLOAT0.200.01–1Maximum size of each shape (0.01 to 1.0)
appearance_durationINT101–100Duration of shape appearance (1 to 100 frames)
disappearance_durationINT101–100Duration of shape disappearance (1 to 100 frames)
appearance_methodCOMBOMethod of shape appearance ('grow', 'pop', 'fade')
easing_functionCOMBOEasing function for shape animation ('linear', 'ease_in_out', 'bounce', 'elastic')
shape_typeCOMBOType of shape to generate
opt_featureoptFEATUREOptional 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)

NameTypeDescription
MASKMASKβ€”