ComfyUI Node

πŸ“ˆ Saw Curve

One long push, then snap back to zero

By alt-key-projectΒ·Created 3 years agoΒ·Updated 2 years agoΒ· 114
πŸ“ˆ Saw Curve
  • frame_counter
  • FLOAT
  • INT
β—„max_value1.00β–Ί
β—„min_value0.00β–Ί
β—„periodicity_seconds10.00β–Ί
β—„phase0.00β–Ί

A sine wave is a round trip; a saw wave is a one-way trip that restarts. Saw Curve [Dream] ramps your value smoothly from min_value up to max_value, and the moment it hits the top, it snaps back to the bottom and does it again. If you've ever watched a Deforum-style zoom that creeps forward frame by frame and then resets for the next loop, that's this shape. It's the curve you reach for when you want constant, relentless motion in one direction - a camera that never stops pushing in, a brightness that keeps climbing, a rotation that spins the same way each cycle.

It's part of the Dream Project Animation Nodes pack, built around the frame-counter abstraction: a counter tracks your position in the animation, and a curve converts that position into a value. Saw Curve just does it with a modulo ramp. The math is ((time + period*phase) % period) / period, scaled into your min/max range - deterministic, cheap, and easy to reason about.

The inputs that matter

  • frame_counter - required. Feed it any Dream frame counter (Frame Counter (Simple) is the painless option) and the curve tracks time internally.
  • min_value / max_value - the bottom and top of the ramp. With defaults 0 β†’ 1 you get a clean duty cycle; widen the range for bigger swings.
  • periodicity_seconds - how long a full ramp takes. 10 seconds default is a slow push; 1–2 seconds reads as urgent.
  • phase - shifts where in the cycle you start, from -1 to 1. Negative phase starts you partway up the ramp.

Like every Dream curve, it outputs FLOAT and INT - the same value, one rounded. FLOAT is the one you'll wire 90% of the time; INT is there for destinations that demand a whole number.

Installing it

Install the whole pack through ComfyUI Manager - search "Dream Project Animation Nodes" - or manually:

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 after. Dependencies are light (imageio, scipy, torchvision, evalidate), with one thing to watch: the pack pins numpy<2.0, so pip may pull your numpy back a major version. That's expected and usually harmless, but it can ripple into other nodes.

Common issues

The classic mistake is the missing frame counter - the curve silently does nothing useful if you've forgotten the FRAME_COUNTER input, because ComfyUI's built-in primitives don't produce one. Also keep in mind the pack's own README: it's declared no longer under active development (the author moved on to comfyui-dream-video-batches). For a saw wave none of that matters - this is a tiny, stable math node that works on current ComfyUI exactly as it always has. If you need a smooth pulse instead of a hard reset, grab Triangle Curve or Sine Curve from the same menu.

Category✨ Dream/πŸŽ₯ animation/πŸ“ˆ curves

Inputs (5)

NameTypeDefaultDescription
frame_counterFRAME_COUNTERβ€”
max_valueFLOAT1.00β€”
min_valueFLOAT0.00β€”
periodicity_secondsFLOAT10.00β€”
phaseFLOAT0.00-1–1β€”

Outputs (2)

NameTypeDescription
FLOATFLOATβ€”
INTINTβ€”