Nodes/ComfyUI-Keyframed/KfSinusoidalWithWavelength
ComfyUI Node

KfSinusoidalWithWavelength

The same sine wave, but you think in frames per loop

By dmarx·Created 3 years ago·Updated 2 years ago· 92
KfSinusoidalWithWavelength
    • KEYFRAMED_CURVE
    • SINUSOIDAL_CURVE
    wavelength12.0
    phase0.0000
    amplitude1.00

    KfSinusoidalWithWavelength is KfSinusoidalWithFrequency's friendlier twin. Both generate a repeating sine curve for keyframing; the only difference is how you tell them how fast it should wave. The frequency node asks "cycles per frame?" - the wavelength node asks "frames per cycle?" - and since frequency and wavelength are reciprocals, they're describing the exact same wave. The defaults even agree: wavelength 12 here is frequency 1/12 over there.

    If you've ever stared at 0.083333 in a float field and thought "okay, but how many frames is that?", you're the target audience. Wavelength answers in the units you actually think in.

    How it works

    It's a thin wrapper that constructs a SinusoidalCurve(wavelength=…, phase=…, amplitude=…) from the keyframed library, then returns it. Under the hood the library stores wavelength as the canonical parameter anyway - the frequency constructor just inverts it - so this node is arguably the more "native" one. The wave itself:

    • wavelength is frames per full cycle, default 12. So with default settings the curve repeats every 12 frames of your animation. Lower it for faster pulsing, raise it for slow breathing.
    • phase is a radian offset, default 0, stepped at π/24 for fine control. π flips the wave upside down, which is a classic way to offset two curves against each other.
    • amplitude is peak height, default 1 - the wave swings between -amplitude and +amplitude, starting at 0 and rising.

    Wiring it up

    Both outputs are the same curve object with different type labels: KEYFRAMED_CURVE for the general keyframed ecosystem (curve math, Apply Curve to Conditioning), SINUSOIDAL_CURVE for the sinusoidal sub-ecosystem (the Adjust and Get nodes). Choose by what you're plugging into.

    Real-world use is the same as the frequency variant: a LoRA weight that waxes and wanes, a denoise strength that pulses, any parameter that should oscillate while your prompt schedule holds steady. It's the sort of thing people point to when someone asks "can I make a value follow a curve?" - yes, and this is the cleanest way in.

    Installing it

    No model files, no weights - just Python. The pack auto-installs its keyframed dependency on first load. Either use ComfyUI Manager and search "ComfyUI-Keyframed", or:

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

    Restart ComfyUI and the node appears under keyframed → sinusoidal.

    Common issues

    Same trap as its twin: with the default amplitude of 1 this curve oscillates around 0, so it goes negative half the time. Feed it into something expecting 0-to-1 weights and you'll get strange results that aren't a bug. For prompt conditioning, use the entangled curve nodes - they phase-offset several sines so they always sum to 1. For everything else, just pick the wavelength that feels right, run KfCurveDraw on it to eyeball the shape, and iterate.

    Categorykeyframed/sinusoidal

    Inputs (3)

    NameTypeDefaultDescription
    wavelengthFLOAT12.0
    phaseFLOAT0.0000
    amplitudeFLOAT1.00

    Outputs (2)

    NameTypeDescription
    KEYFRAMED_CURVEKEYFRAMED_CURVE
    SINUSOIDAL_CURVESINUSOIDAL_CURVE