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

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

Translate, rotate, or scale a mask, reactively

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

A straightforward geometric operation dressed up with the pack's reactivity layer: move a mask around, spin it, or resize it, and let an audio or motion signal drive how far. It's the node to reach for when you want a mask region to visibly pan, rotate, or breathe over a sequence instead of holding still in one spot.

How it works

transform_type picks the operation - translate (move), rotate (spin), or scale (resize) - and max_x_value/max_y_value set the ceiling for how far that transform can go, in either direction (both accept negative values, up to Β±1000). Which one actually matters depends on transform_type: for translate they're your horizontal/vertical movement range, for rotate and scale they likely map onto rotation angle and scale factor respectively rather than literal X/Y position - check which axis moves what once you've picked your transform type. feature_param exposes max_x_value and max_y_value individually, so a FEATURE signal can drive one axis of the transform without touching the other - useful if you want, say, horizontal pan driven by one audio band and vertical drift driven by something else entirely, wired through two chained Flex Mask Transform nodes.

Inputs and outputs that matter

  • masks (required, MASK) - the mask being transformed.
  • transform_type - translate, rotate, or scale.
  • max_x_value / max_y_value (default 10 each, βˆ’1000 to 1000) - the ceiling on how far the transform moves.
  • opt_feature (optional, FEATURE) - drive one axis 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. Straight geometric transform math, no model downloads.

Common issues & troubleshooting

Mask disappears off the edge of frame. With translate ranges up to Β±1000, it's easy to push a mask entirely out of the visible canvas, especially at your source resolution's smaller end. Start with a much lower max_x_value/max_y_value than the defaults suggest and dial up from there.

Rotate or scale doesn't behave like translate did. Since the same two fields (max_x_value/max_y_value) are reused across all three transform types, don't assume their meaning carries over when you switch transform_type - a value that gave you a modest pan under translate might read as a huge rotation angle or scale factor once you switch modes. Reset and re-tune after changing the transform type.

Reactive transform looks jittery. A raw, unsmoothed feature driving position or rotation will read as shaky rather than smooth motion. Smooth the feature signal upstream, or lower feature_threshold's gate, if you want gentler movement instead of an erratic one.

CategoryRyanOnTheInside/FlexFeatures/Targets/Masks

Inputs (13)

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: - x_value: Dynamically adjust horizontal transformation - y_value: Dynamically adjust vertical transformation - 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)
transform_typeCOMBOType of transformation ('translate', 'rotate', 'scale')
max_x_valueFLOAT10.0-1000–1000Maximum horizontal component of the transformation (-1000.0 to 1000.0)
max_y_valueFLOAT10.0-1000–1000Maximum vertical component of the transformation (-1000.0 to 1000.0)
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β€”