ComfyUI Node

Sine

The boring math node that gives animation its pulse

By silveroxides·Created 7 months ago·Updated 3 months ago· 3
Sine
  • angle
  • result
unitRadians

If you've ever watched a ComfyUI animation where the camera drifts, the zoom breathes, or the strength of an effect swells and fades on its own - something is computing a sine wave. Sine is the heartbeat behind "motion that feels alive" in procedural animation, and MathSin is the node that puts it in your graph without you writing a line of Python.

It's part of silveroxides/ComfyUI-LogicMath, the pack whose one-line README is "Logic operators and Math nodes based on a PR that never got merged." Same author runs Chroma-GGUF. Like everything in the pack, MathSin is V3-native: it registers through ComfyUI's newer extension API (comfy_api.latest) rather than legacy NODE_CLASS_MAPPINGS, so it's simple, modern, and requires a reasonably current ComfyUI to exist at all.

How it works

MathSin is a thin wrapper around Python's math.sin(). Give it an angle, get back its sine as a FLOAT, always between -1 and 1. The only logic the node adds is the unit dropdown:

  • Radians (default) - raw math.sin() behavior. Feed frame numbers or loop counters straight in.
  • Degrees - converts your angle to radians first, so sin(90) returns 1 like your high school teacher promised.

The classic animation recipe is dead simple: sin(frame / 60) oscillates between -1 and 1 once per 60 frames. Stretch the denominator to slow the pulse, then map it into the 0-to-1 range by multiplying by 0.5 with the MathMultiply sibling and adding 0.5 with the pack's Add node - and you've got a strength envelope you can plug straight into denoise, CFG, or any other parameter.

Inputs and outputs that matter

  • angle - an int or float. The thing you animate against: a frame counter, a progress value, anything linear.
  • unit - Radians or Degrees. Set it once; forgetting it's on Radians is the classic stumble.
  • result (FLOAT) - the sine of your angle, between -1 and 1.

Sine starts at 0 at angle 0 and rises to 1 - which is exactly what you want when an effect should start calm and build. If you need the opposite phase, where the value starts at full strength and eases down, reach for MathCos instead; it's the same wave, shifted a quarter turn.

Installing it

ComfyUI Manager is easiest: Manager → Install Custom Nodes → search "ComfyUI-LogicMath". Or the manual route:

cd ComfyUI/custom_nodes
git clone https://github.com/silveroxides/ComfyUI-LogicMath

Restart ComfyUI. No models to download, no requirements.txt headaches - the only dependency is comfy_api, which ships with ComfyUI.

Common gotchas

  • Radians vs Degrees - the default is Radians. If your sine looks wrong at "90 degrees," that's why.
  • Output is always FLOAT. Sine returns a float no matter what you feed in, so an INT-only input downstream needs MathNumberConvert or MathRound between them.
  • V3-only. On an outdated ComfyUI the node won't register at all. Update ComfyUI, then reload, before you blame the pack.
  • Don't expect randomness. Sine is periodic and perfectly predictable. If your "random wobble" looks suspiciously regular, that's not a bug - it's a sine wave. Add a second wave at a different speed and sum them for richer motion.

Sine won't generate a single pixel, and it doesn't need to. It's the tool that turns a monotonous counter into motion with a pulse, and once you've felt that, static workflows start to feel flat.

Categoryutils/math/trigonometry

Inputs (2)

NameTypeDefaultDescription
angleCOMFY_MATCHTYPE_V3
unitCOMBORadians2 options: Radians, Degrees

Outputs (1)

NameTypeDescription
resultFLOAT