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

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

Blend two masks with real easing curves

By ryanontheinsideΒ·Created 2 years agoΒ·Updated 5 months agoΒ· 852
Flex Mask Interpolate βš‘πŸ…‘πŸ…žπŸ…£πŸ…˜
  • masks
  • mask_b
  • opt_feature
  • MASK
β—„strength1.00β–Ί
β—„feature_threshold0.00β–Ί
β—„feature_paramβ–Ύβ–Ί
β—„feature_moderelativeβ–Ί
β—„invertfalseβ–Ί
β—„subtract_original0.00β–Ί
β—„grow_with_blur0.0β–Ί
β—„mask_strength1.00β–Ί
β—„interpolation_methodβ–Ύβ–Ί
β—„max_blend1.00β–Ί
β—„invert_mask_bfalseβ–Ί
β—„blend_modeβ–Ύβ–Ί

A linear crossfade between two masks is fine until it isn't - a hard edge that eases in feels more natural than one that snaps or ramps at a constant rate, and a radial reveal reads completely differently from a straight blend. Flex Mask Interpolate gives you both: a real set of interpolation curves to blend masks toward mask_b, plus (like the rest of this pack's Flex family) an optional FEATURE input so the blend amount itself can move with audio or motion instead of sitting at a fixed value.

How it works

interpolation_method is the core choice - nine options ranging from the expected (linear, ease_in, ease_out, ease_in_out, cubic, sigmoid) to the more visually distinct (radial, which interpolates outward from a center point rather than uniformly; distance_transform, which blends based on distance from the mask's edges rather than a flat time curve; and random_noise, which breaks the transition up with noise instead of a clean gradient). max_blend caps how far the interpolation can go - 1.0 lets it fully reach mask_b, lower values hold back some of the original. blend_mode (normal, add, multiply, overlay, soft_light) then determines how the two masks actually combine once the interpolation weight is computed, and invert_mask_b flips the second mask before any of that happens.

Layered underneath is the same general mask toolkit you'll see across this pack's Flex mask nodes: invert flips the final output, subtract_original peels back a portion of the source mask after blending, and grow_with_blur softens or expands edges. mask_strength scales the overall effect independently of max_blend.

Inputs and outputs

  • masks (required, MASK) - the base mask or sequence.
  • mask_b (required, MASK) - the second mask to interpolate toward.
  • interpolation_method - the curve shape, the setting that actually defines the character of the transition.
  • opt_feature (optional, FEATURE) - drives the blend reactively if connected; otherwise the transition is fixed.
  • Output - a single MASK.

One thing worth knowing before you rely on the feature input

The feature_param dropdown on this node - the setting that's supposed to pick which parameter the feature modulates - currently only exposes a placeholder value in its schema rather than a real option like max_blend. In practice, that means feature-driven modulation on this specific node isn't fully wired up the way it is on its sibling Flex nodes. The deterministic side (everything not touching opt_feature) works exactly as described above; if you were counting on this one to react to audio the same way Flex Image Posterize or Flex Mask Morph do, test it before building a workflow around that assumption.

Installing it

Install via ComfyUI Manager (search RyanOnTheInside) or manually:

cd ComfyUI/custom_nodes
git clone https://github.com/ryanontheinside/ComfyUI_RyanOnTheInside

Then pip install -r requirements.txt and restart ComfyUI. No unusual dependency for this specific node beyond the pack's standard image/mask stack.

Common issues

Beyond the feature_param gap above, the most common surprise is interpolation_method mattering far more than max_blend - people dial in max_blend expecting to control the look, when it's actually interpolation_method that decides whether the transition looks like a fade, a radial wipe, or a noisy dissolve. If the blend looks flat or unremarkable, try radial or distance_transform before assuming the node isn't doing anything interesting.

CategoryRyanOnTheInside/FlexFeatures/Targets/Masks

Inputs (15)

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_blend: Dynamically adjust blend amount - 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)
mask_bMASKSecond mask to interpolate with (MASK type)
interpolation_methodCOMBOMethod of interpolation ('linear', 'ease_in', 'ease_out', 'ease_in_out', 'cubic', 'sigmoid', 'radial', 'distance_transform', 'random_noise')
max_blendFLOAT1.000–1Maximum blend factor between masks (0.0 to 1.0)
invert_mask_bBOOLEANfalseWhether to invert the second mask before interpolation
blend_modeCOMBOMethod for blending masks ('normal', 'add', 'multiply', 'overlay', 'soft_light')
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β€”