Nodes/ComfyUI-Keyframed/KfSinusoidalAdjustWavelength
ComfyUI Node

KfSinusoidalAdjustWavelength

Stretch a sine curve without touching its phase

By dmarx·Created 3 years ago·Updated 2 years ago· 92
KfSinusoidalAdjustWavelength
  • curve
  • KEYFRAMED_CURVE
  • SINUSOIDAL_CURVE
adjustment0.0

Sine curves in ComfyUI-Keyframed have two ways of describing how fast they wiggle: frequency (cycles per frame) and wavelength (frames per cycle). They're reciprocals of each other, and which one you think in is a personality test. If you're a "one full cycle every 12 frames" person, this is the adjust node for you: it stretches or compresses an existing curve's wavelength while leaving phase and amplitude alone.

This is the wavelength-side sibling of KfSinusoidalAdjustFrequency, both part of dmarx's small "adjust" family in the ComfyUI-Keyframed pack. They exist because tuning an existing curve by adding a number beats deleting a constructor node and re-entering every field - especially mid-workflow, when the curve is already wired into conditioning or parameter nodes downstream.

How it works

The node reads the wavelength, phase, and amplitude off your input curve, adds your adjustment to the wavelength, and builds a fresh SinusoidalCurve from the result. Add 6 to a curve with the default wavelength of 12 and it now takes 18 frames per cycle - slower. Subtract and it speeds up.

Worth noting why both this and the frequency variant exist: because wavelength and frequency are reciprocals, adding to one isn't the same operation as adding to the other. wavelength += 6 from 12 down to 6 is a 2x speed-up; frequency += 0.01 from 1/12 is only a ~12% change. The two nodes let you pick the mental model you're already in rather than doing reciprocal math in your head. Also, the adjustment step here is 0.5, so you're nudging in half-frame increments - fine-grained enough to dial in a beat.

Inputs and outputs

  • curve - a SINUSOIDAL_CURVE, forced as an input, so it has to come from another node.
  • adjustment - a FLOAT, default 0.

Both outputs (KEYFRAMED_CURVE and SINUSOIDAL_CURVE) return the same new curve object. Keep chaining with the SINUSOIDAL_CURVE output if more tweaks are coming; feed KEYFRAMED_CURVE into anything curve-shaped downstream, like Evaluate Curve At T or Apply Curve To Conditioning.

Installing it

Part of the ComfyUI-Keyframed pack. Through ComfyUI Manager, search "ComfyUI-Keyframed"; or:

cd ComfyUI/custom_nodes
git clone https://github.com/dmarx/ComfyUI-Keyframed

Then restart ComfyUI. There are no model files, and the only real dependency is the keyframed Python library, auto-installed on first startup (requirements.txt is a single line). If that first launch hangs on the pip install, that's normal - and if it fails, pip install keyframed manually. The node lives under keyframedsinusoidal. If you think in frames rather than cycles, this is the variant you want; the frequency adjust node is for everyone who thinks in beats-per-second.

Categorykeyframed/sinusoidal

Inputs (2)

NameTypeDefaultDescription
curveSINUSOIDAL_CURVE
adjustmentFLOAT0.0

Outputs (2)

NameTypeDescription
KEYFRAMED_CURVEKEYFRAMED_CURVE
SINUSOIDAL_CURVESINUSOIDAL_CURVE