Area Feature Node β‘π ‘π π £π
Turn a growing or shrinking mask into a driveable curve
- masks
- FEATURE
This is a FEATURE source - the raw-material end of the FlexFeatures system rather than something that consumes a curve. Feed it a mask sequence and it tracks how much of the frame is masked over time, turning that into a number-per-frame curve you can feed into a modulator like AdvancedFeatureCombiner, preview with AnimatedFeaturePreview, or eventually use to drive some other parameter. The obvious use case: an object growing bigger as it approaches camera across an animation, and you want some effect (a ControlNet strength, an opacity, anything numeric) to scale along with it.
Built by ryanontheinside as one of several FlexFeature "source" nodes - this pack has others for audio, motion, and more, all producing the same FEATURE type so they're interchangeable downstream.
How it works
Given a mask per frame, extraction_method decides what "area" actually means, straight from the node's own tooltip: total_area is the whole masked region's size, good for tracking overall coverage; largest_contour is the size of the single biggest connected blob, useful when you only care about one main object even if the mask has stray bits elsewhere; bounding_box is the area of the rectangle containing the mask, which tracks a subject's footprint/size changes more than its literal pixel count.
The inputs and outputs that matter
masks- aMASKsequence from any segmentation source elsewhere in your graph.extraction_method- the real decision here. If your mask ever has multiple disconnected blobs (two objects, say),total_areasums everything whilelargest_contourtracks only the biggest - pick based on whether you want "everything visible" or "the main subject."threshold- default 0.5, what counts as "masked" at all.frame_rate,width,height- set the timeline/resolution context for the extraction; match these to your actual sequence.
Output is a FEATURE.
How to install it
Via ComfyUI Manager, search RyanOnTheInside. Manually:
cd ComfyUI/custom_nodes
git clone https://github.com/ryanontheinside/ComfyUI_RyanOnTheInside
then restart. No model downloads - this reads masks you've already generated elsewhere.
Common issues & troubleshooting
Curve looks noisy or jumps around. Multiple disconnected mask regions with total_area selected will sum them all, so if a segmentation node occasionally picks up a stray false-positive blob elsewhere in frame, it'll spike your curve. Switch to largest_contour if you only care about one main subject and want that noise ignored.
Curve doesn't reflect subject size the way you expect. total_area reports raw pixel coverage, which isn't the same as bounding_box's "how big a rectangle would contain this" - a thin, spread-out mask can have a large bounding box but low total area. Pick the method that actually matches what you're trying to measure.
Threshold picked up too little / too much of a soft mask. If your mask source produces soft edges rather than hard binary values, threshold decides the cutoff - lower it to catch more of the soft edge, raise it to only count confidently-masked pixels.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| extraction_method | COMBO | Choose how to analyze the masked area: - total_area: Total size of the masked region - good for tracking overall coverage - largest_contour: Size of the biggest connected region - useful for tracking main objects - bounding_box: Area of the rectangle containing the mask - great for object size changes | |
| frame_rate | FLOAT | 30.01β120 | Frame rate of the video (1.0 to 120.0 fps) |
| width | INT | 51264β4096 | Width of the output feature (64 to 4096) |
| height | INT | 51264β4096 | Height of the output feature (64 to 4096) |
| masks | MASK | Input mask sequence to analyze | |
| threshold | FLOAT | 0.500β1 | Threshold value for considering pixels as part of the area (0.0 to 1.0) |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| FEATURE | FEATURE | β |