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

Flex Mask Warp βš‘πŸ…‘πŸ…žπŸ…£πŸ…˜

Distort a mask's edges with Perlin, radial, or swirl noise

By ryanontheinsideΒ·Created 2 years agoΒ·Updated 5 months agoΒ· 852
Flex Mask Warp βš‘πŸ…‘πŸ…žπŸ…£πŸ…˜
  • masks
  • opt_feature
  • MASK
β—„strength1.00β–Ί
β—„feature_threshold0.00β–Ί
β—„feature_paramβ–Ύβ–Ί
β—„feature_moderelativeβ–Ί
β—„invertfalseβ–Ί
β—„subtract_original0.00β–Ί
β—„grow_with_blur0.0β–Ί
β—„mask_strength1.00β–Ί
β—„warp_typeβ–Ύβ–Ί
β—„frequency0.10β–Ί
β—„max_amplitude30.0β–Ί
β—„octaves3β–Ί

If you want a mask's edges to look organic and liquid rather than clean and geometric - melting, rippling, distorted glass - this is the node. It pushes your mask's boundary around using classic noise-based warping, the same family of technique behind a lot of procedural texture and displacement effects, then layers the pack's reactive controls on top so the amount of distortion can move with an audio or motion signal.

How it works

warp_type picks the distortion pattern: perlin uses Perlin noise for an organic, cloud-like warp; radial distorts outward/inward from a center point; swirl twists the mask around a center, like a whirlpool. frequency controls the scale of the noise pattern - low frequency gives large, sweeping distortions, high frequency gives fine, busy ripples. max_amplitude caps how far any given point gets pushed. octaves is a Perlin-noise-specific concept: it layers multiple noise passes at different scales on top of each other, adding fractal detail - more octaves means finer texture riding on top of the broad distortion, at the cost of more compute per frame. feature_param can target max_amplitude, frequency, or octaves, so the intensity, scale, or detail level of the warp can all be driven reactively.

Inputs and outputs that matter

  • masks (required, MASK) - the mask to distort.
  • warp_type - perlin, radial, or swirl.
  • frequency (default 0.1, 0.01–1) - scale of the distortion pattern.
  • max_amplitude (default 30, 0.1–500) - how far points get pushed.
  • octaves (default 3, 1–8) - layered noise detail, for noise-based warps.
  • opt_feature (optional, FEATURE) - drive amplitude, frequency, or octaves reactively.
  • 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 noise math, no model downloads.

Common issues & troubleshooting

Warp is barely visible. max_amplitude's range goes up to 500, but the visible effect depends heavily on your mask's resolution - a small amplitude on a high-res mask can look like nothing at all. Push it well above the default before concluding the effect isn't working.

Distortion looks harsh or blocky instead of smooth. Raise octaves for finer, more organic detail layered into the warp - a single octave at high amplitude can look chunky rather than fluid, especially with perlin.

Performance drops on long sequences. More octaves means more noise layers computed per frame; if you're processing a long clip and it's crawling, dropping octaves back down is the first thing to try before assuming something else is wrong.

CategoryRyanOnTheInside/FlexFeatures/Targets/Masks

Inputs (14)

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: - amplitude: Dynamically adjust the strength of warping - frequency: Dynamically adjust the scale of warping - octaves: Dynamically adjust the detail level of noise - 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)
warp_typeCOMBOType of warping effect ('perlin', 'radial', 'swirl')
frequencyFLOAT0.100.01–1Controls the scale of the warping effect (0.01 to 1.0)
max_amplitudeFLOAT30.00.1–500Maximum amplitude of the warping effect (0.1 to 500.0)
octavesINT31–8For noise-based warps, adds detail at different scales (1 to 8)
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β€”