π Triangle Curve
The ping-pong wave that never gets boring
- frame_counter
- FLOAT
- INT
Some motion should swing back and forth without the abrupt reset of a saw wave. That's Triangle Curve [Dream]: it ramps up from min_value to max_value, then ramps straight back down - a ping-pong shape that gives you a continuous, even pulse. Zoom that glides in and out at constant speed. A rotation that sweeps one way, then the other. A weight that rises and falls on every cycle. Where a sine wave feels round and organic, a triangle wave feels mechanical and steady, which is often exactly the mood you want from a camera move.
This is one of the curve nodes in Dream Project Animation Nodes, the pack built for Deforum-style animation in ComfyUI. The mechanism is the same family as the pack's Saw and Sine curves: a frame counter tracks where you are, and the curve turns that into a number. The triangle's math is a modulo phase split in half - first half ramps up, second half ramps down - scaled into your min/max range. Nothing fancy, fully predictable, and that's the point.
The inputs that matter
- frame_counter - required. Any Dream frame counter works (Frame Counter (Simple) is the easiest start); the curve reads elapsed time from it.
- min_value / max_value - the two ends of the swing. Defaults of 0 β 1 are a clean baseline.
- periodicity_seconds - the length of one full up-and-down cycle. 10 seconds default is a slow, deliberate rock.
- phase - shifts the starting point of the cycle between -1 and 1, so you can start on the way down instead of the way up.
Outputs are FLOAT and INT, same value with one rounded. FLOAT drives continuous parameters like zoom, brightness, or conditioning weight; INT covers anything that insists on a whole number.
Installing it
Install through ComfyUI Manager by searching "Dream Project Animation Nodes", or clone it yourself:
cd ComfyUI/custom_nodes
git clone https://github.com/alt-key-project/comfyui-dream-project.git
cd comfyui-dream-project
pip install -r requirements.txt
Restart ComfyUI. Dependencies are minimal, but the numpy<2.0 pin in requirements.txt is the one thing to keep in mind - pip may downgrade your numpy and that can touch other custom nodes.
Common issues
As with every Dream curve, forgetting the frame_counter input is the number-one stumble; there's no stock ComfyUI node that emits a FRAME_COUNTER, so you need one of the pack's counter nodes upstream. Also worth one honest note: the pack's README says it's no longer being updated - the author moved to comfyui-dream-video-batches. A triangle wave is a twelve-line math function, so it keeps working on current ComfyUI regardless. If you want the same ping-pong but with soft, rounded peaks, that's the pack's Sine Curve.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| frame_counter | FRAME_COUNTER | β | |
| max_value | FLOAT | 1.00 | β |
| min_value | FLOAT | 0.00 | β |
| periodicity_seconds | FLOAT | 10.00 | β |
| phase | FLOAT | 0.00-1β1 | β |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| FLOAT | FLOAT | β |
| INT | INT | β |