CosWave π π π
A cosine wave as a node β for anything you want to oscillate instead of linearly ramp
- FLOAT
- INT
CosWave is exactly what it says on the tin: a cosine oscillator packaged as a ComfyUI node. Feed it a frame number and it outputs a value that swings smoothly up and down between y_translation Β± amplitude over and over. It's the animation equivalent of a metronome - if you want something in your video to pulse, sway, rock, or breathe, this is the clean way to do it instead of hand-typing a keyframe curve.
It computes, per frame:
y_translation + amplitude * cos(2Ο * current_frame / phase - x_translation)
The four floats you set are the standard oscillator controls. phase is the period in frames - how long one full cycle takes. amplitude is how far from center the value swings. y_translation is the center point the wave oscillates around (default 0.5, so with amplitude 0.5 you sweep 0β1). x_translation shifts the wave horizontally - effectively a phase offset that slides where the cycle starts. current_frame is your frame counter, usually wired from your animation loop or a helper like Calculate Frame Offset.
Outputs are FLOAT and INT - the same value, with INT being the float truncated. That dual output is handy: wire FLOAT into something like a pan or zoom strength that likes decimals, and INT into an integer input like a step count or an image index, without needing a separate conversion node.
Where it fits
FizzNodes' wave nodes exist for when a linear ramp isn't what you want - easing into a value and easing out of it, or looping a motion forever. A camera sway, a light pulsing, a subject bobbing: cosine is the natural shape. The README points to framesync.xyz for audio-synced exports if you want these curves to hit beats instead of just running on a timer. One honest caveat: the wave nodes print() every output to the console as they run, so long animations will spam your terminal. It's cosmetic, but it's real.
Install
cd ComfyUI/custom_nodes && git clone https://github.com/FizzleDorf/ComfyUI_FizzNodes.git
cd ComfyUI_FizzNodes && pip install -r requirements.txt
Or install "FizzNodes" via ComfyUI Manager and restart. No models, nothing heavy. If you find yourself wanting the opposite phase (starting low and rising) grab InvCosWave in the same menu - it's this node flipped.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| phase | FLOAT | 10β9999 | β |
| amplitude | FLOAT | 0.50β9999 | β |
| x_translation | FLOAT | 00β9999 | β |
| y_translation | FLOAT | 0.500β9999 | β |
| current_frame | INT | 10β9999 | β |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| FLOAT | FLOAT | β |
| INT | INT | β |