Sine
Smooth Motion for Animated Workflows
- angle
- result
UC_MathSin returns the sine of an angle as a float, with a dropdown for radians or degrees. Sine is the oscillator of the math world - it starts at 0, sweeps up to 1, back through 0, down to -1, and repeats. In ComfyUI that's a smooth, continuous wave you can drive almost anything with: camera motion, zoom pulses, strength curves, anything that should move like a pendulum rather than snap like a switch.
Why you'd reach for it
If your workflow does anything animated or parametric, sine is the natural waveform. Feed a frame counter or a time value into the angle and the output oscillates, which is exactly the shape you want for a pan that glides back and forth, a zoom that breathes in and out, or a LoRA strength that swells and relaxes over a sequence. It's also the starting point for easing: because sine starts at 0 and its derivative is gentle, a sine-derived curve gives "slow start, fast middle, slow end" motion without any easing library. Its sibling UC_MathCos is the same wave shifted by a quarter cycle, which is how you get two values out of phase.
How it works
A thin wrapper around math.sin, with one crucial detail: the unit dropdown defaults to Radians. If you feed it 90 expecting 1 (the sine of 90°), you'll get roughly 0.894 - because Python reads it as 90 radians. Select Degrees and 90 correctly returns 1. The node converts degrees to radians internally when you choose that option, so the dropdown is the only thing between you and the value you expect.
The inputs that matter
angle- the input angle, int or float.unit- Radians (default) or Degrees. Check this before you debug anything else.
The output is a float named result.
Installing it
Part of ComfyUI-UtilsCollection. ComfyUI Manager → search "ComfyUI-UtilsCollection" → Install → restart, or:
cd ComfyUI/custom_nodes
git clone https://github.com/silveroxides/ComfyUI-UtilsCollection
Restart. No models; requirements are just opencv-python and typing-extensions.
The honest note
Like its cosine sibling, sine is a specialist - you won't touch it in a plain txt2img workflow, but the moment you build anything that moves or cycles, it's the tool. The radians/degrees trap is the same one that bites in UC_MathCos, and the fix is identical: check the unit dropdown. If you're importing a ComfyUI-LogicMath workflow, this replaces its sine node - accept the swap and uninstall the old pack. And if you want a sine that only ever goes 0→1 instead of -1→1, that's this node's output run through an add and a multiply, which is exactly the kind of thing the pack's math nodes are there for.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| angle | COMFY_MATCHTYPE_V3 | — | |
| unit | COMBO | Radians | 2 options: Radians, Degrees |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| result | FLOAT | — |