Nodes/ComfyUI-Keyframed/KfSinusoidalAdjustAmplitude
ComfyUI Node

KfSinusoidalAdjustAmplitude

Nudge a sine without rebuilding it

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

Sinusoidal curves are this pack's perpetual-motion machines - clean oscillators you can layer, entangle, and multiply into anything. But a sine you can't tune is a sine you eventually delete and rebuild. KfSinusoidalAdjustAmplitude is the tuning knob: it takes an existing sinusoidal curve, adds a adjustment to its amplitude, and hands back a new curve with everything else - wavelength and phase - exactly as it was. If the oscillating parameter in your animation is too loud or too quiet, this is the node that fixes it without touching the other settings.

The adjustment is additive, not absolute. adjustment: 0 returns a copy with the same amplitude; 0.1 makes it a tenth louder; -0.2 ducks it. You chain these to fine-tune without ever revisiting the original construction node, and because it outputs the same curve type it accepts, you can stack it with the phase and wavelength adjusters - the pack ships a sibling for each parameter.

Why you'd reach for it

Any animation where a sine drives a strength - prompt weight oscillation, LoRA strength breathing, ControlNet intensity pulsing. You set up the base oscillator, and then you find the peaks are either too subtle or so strong they overwhelm. Drop this node on the wire, dial the adjustment, and re-check. It's also how you'd harmonize multiple oscillators: keep their base wavelength/phase identical and use per-curve amplitude adjustments to set their relative loudness.

The inputs that matter

  • curve - a SINUSOIDAL_CURVE, force-input. Note the type: this is the second output of the Sinusoidal Curve With Frequency/Wavelength nodes (they return both a KEYFRAMED_CURVE and a SINUSOIDAL_CURVE from the same underlying object - feed the sinusoidal one here).
  • adjustment - a FLOAT, default 0, stepped at 0.01. The amount added to the amplitude. Positive makes the wave taller, negative makes it flatter.

Two outputs, both the same new curve under different type labels:

  • KEYFRAMED_CURVE - feed this to anything that accepts a general curve (evaluate, arithmetic, groups).
  • SINUSOIDAL_CURVE - feed this to the next adjust node, since the adjusters require the sinusoidal type.

How it works

The source reads the input curve's wavelength, phase, and amplitude, adds the adjustment to the amplitude, and constructs a fresh SinusoidalCurve from the result. Because it's a new object rather than a mutation, the input curve is untouched and you can keep a pristine copy around as a reference - or feed the output onward through more adjusters.

Installing it

Part of ComfyUI-Keyframed (dmarx's pack wrapping his keyframed library). ComfyUI Manager: search "Keyframed". Or:

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

Restart ComfyUI. The pack auto-installs keyframed and toolz on first load; no model downloads.

Troubleshooting

The main trap is mixing curve types. If you feed a plain KEYFRAMED_CURVE into this node it won't accept the wire, because it insists on a SINUSOIDAL_CURVE - grab the second output from the constructor node. And since amplitude adjustment is additive, chaining this node twice stacks the adjustments; if a value looks wrong, check you haven't double-applied. Watch the range too: a sine with amplitude pushed past 1 can send a downstream strength above its intended domain, and the pack will happily pass it through. Plot the result with KfPGroupDraw if you're unsure.

Categorykeyframed/sinusoidal

Inputs (2)

NameTypeDefaultDescription
curveSINUSOIDAL_CURVE
adjustmentFLOAT0.00

Outputs (2)

NameTypeDescription
KEYFRAMED_CURVEKEYFRAMED_CURVE
SINUSOIDAL_CURVESINUSOIDAL_CURVE