InvCosWave π π π
CosWave, phase-flipped β start low and rise when you need the opposite swing
- FLOAT
- INT
InvCosWave is the phase-inverted cousin of CosWave in FizzNodes' wave family. Same oscillator, same controls, flipped start. Where CosWave starts its cycle high and falls, InvCosWave starts low and rises. That's the entire difference, and it's exactly as useful as it sounds: two things that need to trade places - a camera and its subject, a light and a shadow, two strengths that should peak at different times - get driven by CosWave on one side and InvCosWave on the other, and they alternate forever.
The formula is a negated cosine:
y_translation + amplitude * -(cos(-(2Ο * current_frame / phase - x_translation)))
Which, once the negatives cancel, reads as a cosine shifted by half a cycle. Practically: with the defaults (y_translation 0.5, amplitude 0.5) it starts near 0, climbs to 1, and falls back - the mirror image of CosWave's 1β0β1.
Inputs are the standard wave set: phase (frames per cycle), amplitude (swing size), x_translation (horizontal/phase shift), y_translation (center value), and current_frame (your frame counter). Outputs are FLOAT and INT, the same number in both - INT is the float truncated. Both outputs are single values per frame, so this is a point-sample node: feed it a current frame and get the value for that frame, the way you'd wire any oscillation into a per-frame parameter.
When to reach for it
Anytime you want a value that "starts quiet and grows" on a loop - a reveal that swells, an effect that eases in from zero. And whenever you're pairing two animations that should never hit their peaks together, this is the cheap way to guarantee it. Same caveat as the rest of the wave nodes: it prints each output to the console as it runs, so expect terminal noise on long jobs. And if you need the standard phase instead, that's CosWave sitting one row up in the menu.
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. Light dependencies, no models - it's a few lines of numpy.
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 | β |