Feature Math β‘π ‘π π £π
Offset, scale, or clamp a feature against a plain number
- feature
- FEATURE
Sometimes you don't need another feature to combine against - you just need to nudge a curve by a fixed amount. Feature Math is the plainest node in the whole Feature Modulator family: it takes one feature and one constant, applies a math operation between them, and hands back the result. No thresholds, no windows, no easing curves - just arithmetic.
If you're new to the RyanOnTheInside pack (Ryan / u/ryanontheinside, also behind ComfyStream and Daydream's real-time reactive video work): a FEATURE is a per-frame value curve, extracted from a source and reshaped by nodes like this one before it drives a Flex node's parameter or an external target.
How it works
Every frame of feature gets the chosen operation applied against the constant y: add, subtract, multiply, divide, max, or min. Add and subtract shift the whole curve up or down. Multiply scales it - useful for boosting sensitivity on a feature that barely moves off zero, or dampening one that's too aggressive. max and min act as a floor or ceiling: max against a constant guarantees the output never drops below that value, min guarantees it never exceeds it.
Inputs and outputs that matter
feature(required) - the curve to be processed.y(default 0, range 0 to 10,000,000) - the constant value the operation is applied against.operation-add,subtract,multiply,divide,max, ormin.invert_output- flips the result.
Output is a single FEATURE, wired into a Flex node's optional feature input or into a further modulator downstream.
Installing it
Via ComfyUI Manager: search RyanOnTheInside. Manual install:
cd ComfyUI/custom_nodes
git clone https://github.com/ryanontheinside/ComfyUI_RyanOnTheInside
cd ComfyUI_RyanOnTheInside
pip install -r requirements.txt
Pure arithmetic on already-extracted feature data - no models, no GPU work - though it installs with the pack's full dependency set regardless, since custom node packs install as a unit.
Where people get tripped up
If a v1-to-v2 update leaves the pack broken, the README's fix is a clean uninstall and reinstall rather than a git pull on top of the old version.
The one thing worth knowing about this node specifically: y's range technically goes up to 10,000,000, but most feature values you'll actually be working with live in the 0β1 range extracted by the pack's Feature Extraction nodes. If you multiply by a large y without following it with something that re-clamps the range - Feature Rebase or Feature Renormalize - you'll blow the feature's values well outside what any downstream Flex node expects, and the effect will either clip hard or behave erratically. Use Feature Math for the small, deliberate nudges (double it, halve it, floor it at 0.1), and reach for the dedicated scaling/renormalizing nodes when you actually need to remap a feature into a different target range.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| feature | FEATURE | Input feature to be processed | |
| y | FLOAT | 0.0000β10000000 | Input value |
| operation | COMBO | Mathematical operation to perform ("add", "subtract", "multiply", "divide", "max", "min") | |
| invert_output | BOOLEAN | false | β |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| FEATURE | FEATURE | β |