Mask Math [DEPRECATED] β‘π ‘π π £π
Combine and time-window masks the old way
- masks
- mask_b
- MASK
Same story as this pack's Audio Latent Blend: the node's own display name says "Mask Math [DEPRECATED]", right there in the ComfyUI search list, so treat it as legacy rather than the tool you reach for on a new build. It still runs - the pack hasn't stripped the code - but everything it does now has a modern equivalent living in the newer "Flex" mask nodes in this same pack, which add the feature-reactive modulation this one never had.
What it actually does
Mask Math combines two masks and applies a time window to when that combination is active - which makes sense given its category is "TemporalMasks." It takes masks (your primary input, single mask or a batch/sequence), optionally mask_b (a second mask to combine against), a combination_method (add, subtract, multiply, minimum, maximum), and a set of post-processing knobs: invert flips black/white on the result, subtract_original peels a portion of the original mask back out after combination, and grow_with_blur softens/expands edges with a Gaussian blur.
The temporal side is the part that separates this from a plain mask-combine node: start_frame, end_frame, and effect_duration define when in a frame sequence the effect is active, temporal_easing (ease_in_out, linear, bounce, elastic, none) shapes how the effect ramps in and out rather than switching on like a hard cut, and palindrome makes the effect play forward then reverse within its duration - useful for a mask that should pulse rather than just appear once.
Inputs and outputs
masks(required,MASK) - the mask or mask sequence being processed.strength(0β1) - overall intensity of the effect.combination_methodandmask_b- how (and with what) to combine, if you're combining at all.start_frame/end_frame/effect_duration/temporal_easing/palindrome- the timing controls that give this node its "temporal" name.- Output - a single
MASK.
If you don't need the timing behavior at all, note that the strength, invert, subtract_original, and grow_with_blur options work as a general mask-touch-up toolkit even with the temporal window left at its defaults (start/end at 0, meaning full range).
Installing it
Install via ComfyUI Manager (search RyanOnTheInside) or manually:
cd ComfyUI/custom_nodes
git clone https://github.com/ryanontheinside/ComfyUI_RyanOnTheInside
Run pip install -r requirements.txt, then restart ComfyUI. This node has no unusual dependency of its own beyond the standard image/mask processing libraries the rest of the pack already needs.
Common issues
The practical trap is discoverability: because it's deprecated but not hidden, it still shows up in node search right alongside the newer Flex mask tools, and nothing stops a new workflow from using it by accident. If you're starting fresh, look at the pack's Flex-prefixed mask nodes first - they cover the same combine-and-shape territory with an opt_feature input this one lacks, meaning the blend strength or timing can react to audio or motion instead of being fixed per-run.
If you do use it: end_frame and effect_duration both default to 0, which the tooltips define as "until end" / "full range" rather than zero-length - so don't be surprised the effect spans your whole sequence by default even though the numeric field reads 0. And as with the rest of this pack, a totally unresponsive node on load points at a missing pip install -r requirements.txt, not a problem with this specific node's logic.
Inputs (12)
| Name | Type | Default | Description |
|---|---|---|---|
| masks | MASK | Input mask or sequence of masks to be processed (MASK type) | |
| strength | FLOAT | 1.000β1 | Overall strength of the mask effect (0.0 to 1.0) |
| 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) |
| start_frame | INT | 00β1000 | Frame number where the effect begins (0 to 1000) |
| end_frame | INT | 00β1000 | Frame number where the effect ends (0 to 1000, 0 means until end) |
| effect_duration | INT | 00β1000 | Number of frames over which the effect is applied (0 to 1000, 0 means full range) |
| temporal_easing | COMBO | Controls how the effect strength changes over time ('ease_in_out', 'linear', 'bounce', 'elastic', 'none') | |
| palindrome | BOOLEAN | false | When enabled, the effect plays forward then reverses within the specified duration |
| mask_b | MASK | Second mask to combine with the input mask (MASK type) | |
| combination_method | COMBO | Mathematical operation to apply ('add', 'subtract', 'multiply', 'minimum', 'maximum') |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| MASK | MASK | β |