sin
Smooth waves without leaving degrees behind
- angle
- FLOAT
Sine is the shape behind every smooth oscillation in a workflow: camera bobbing, breathing light, easing pulses, any value that should glide up and down instead of jumping. The sin node from Basic data handling computes it, and it's smarter about units than most math nodes - it gives you a unit dropdown so you can feed it degrees directly, which is a small quality-of-life win you only appreciate after fighting a radians-conversion chain.
If you've ever watched a hand-rolled animation counter jerk between keyframes, sine is the fix, and this is the cheapest way to get it.
How it works
The node wraps Python's math.sin(). Inputs:
angle- FLOAT or INT, default0.unit- a dropdown withradiansordegrees(defaultdegrees).
When you pick degrees, the node converts your angle to radians internally before calling sin, so sin(90) with unit degrees returns 1 exactly as your intuition expects. Pick radians and it takes the raw value.
Output is a single FLOAT in the range [-1, 1] - the classic sine wave range.
Building a wave from a step counter
The canonical use: wire an increasing value (a frame counter, a step index) into angle, and the output oscillates smoothly between -1 and 1. From there:
- Scale and offset to get any range:
(sin(angle) + 1) / 2gives a 0→1 pulse. The pack'sMathFormulanode can do that transform inline. - Speed control - multiply the counter before it hits
angle:sin(counter * 10)waves ten times faster thansin(counter). - Seed/resolution/weight modulation - any numeric input that should drift rhythmically rather than sit still.
The gotchas
- Type mismatch on
unit: the dropdown is a string, andangleis a number - don't try to wire the unit as a number. It's a UI picker, not a wire. - Domain isn't an issue here - sine accepts any real angle, positive or negative, no errors. That's the nice part.
sin(0)=0,sin(90°)=1,sin(180°)=0,sin(270°)=-1. - If your wave looks like a sawtooth, check the input - sine is only smooth if the angle increments in small steps, not in big chunks.
Installing it
Basic data handling is dependency-free with no model downloads. ComfyUI Manager → search "Basic data handling" → install → restart. Or:
cd ComfyUI/custom_nodes
git clone https://github.com/StableLlama/ComfyUI-basic_data_handling
Restart, and sin is under Basic/maths with cos and tan beside it.
The take
Most math nodes in this space are raw library functions that assume you speak radians. sin being degree-aware by default is a small sign that this pack was built by someone who actually uses the tool - and for animation work, it's the one you'll reach for first.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| angle | FLOAT,INT | 0 | — |
| unit | COMBO | degrees | 2 options: radians, degrees |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| FLOAT | FLOAT | — |