βοΈ CR Math Operation
Sin, cos, sqrt and friends for one float value
- a
- show_help
A one-input, one-output math node: feed it a float, pick an operation (sin, cos, tan, sqrt, exp, log, neg, abs), and it hands back the result rounded to however many decimal places you want. No expression parser, no multi-variable formulas - just the eight functions you'd otherwise need Python for, wired straight into the graph.
How it works
Set a to your input value, pick operation from the dropdown, and decimal_places controls rounding on the output (0β10 places). The output is a single float also named a - same name as the input, which is worth noting so you don't confuse the two when reading a busy graph; it's the result, not a passthrough of what you typed in.
The obvious use is driving some value with an oscillating or scaled function instead of a straight line - feed a frame counter through sin to get a value that rises and falls smoothly across an animation, or run a raw pixel count through sqrt to get something proportional to a linear dimension instead of an area. It's a small building block, useful wherever you need one specific math function rather than a general expression evaluator.
Inputs and outputs that matter
a- the input float (default 1).operation- one of sin, cos, tan, sqrt, exp, log, neg, abs.decimal_places- rounding on the output, 0β10.- Output:
a(the computed float) plusshow_help.
How to install it
ComfyUI Manager: search "Comfyroll Studio", install, restart. Manual: cd ComfyUI/custom_nodes && git clone https://github.com/Suzie1/ComfyUI_Comfyroll_CustomNodes.git, restart. Nothing to download beyond the pack - it's a pure arithmetic node, no models involved at all.
Common issues
The usual math-domain gotchas apply, and this node doesn't guard against them for you: sqrt of a negative number, or log of zero or a negative number, are both undefined - feed it a value outside the valid domain for whichever operation you picked and expect either an error or a nonsense result rather than a helpful message. Sanity-check your input range before wiring this into something that runs unattended, like a scheduled animation loop.
tan is the other one to watch - it shoots toward infinity near 90Β°/270Β° (in whatever units your upstream value represents), so if you're driving an angle through it, know where those blow-up points fall relative to your input range before you build a whole schedule on top of it.
Beyond that, it's about as low-risk as nodes in this pack get. If it's missing from your search menu, that's the standard Comfyroll pack-wide caveat - a broken import elsewhere in the roughly 200-node pack can hide unrelated nodes too, so check your ComfyUI console log before troubleshooting this node specifically.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| a | FLOAT | 1.00 | β |
| operation | COMBO | 8 options: sin, cos, tan, sqrt, exp, log, +2 | |
| decimal_places | INT | 20β10 | β |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| a | FLOAT | β |
| show_help | STRING | β |