MD: LFO Generator (Automator)
Animate any number over time — the LFO generator that outputs a list *and* a live value
- current_value
- value_list
- lfo_plot
- list_as_string
An LFO - low-frequency oscillator - is the musician's trick of wiggling a parameter on a slow, repeating wave. MD_LFO_Generator brings that to ComfyUI: it produces a list of values that oscillate between two bounds over a fixed number of steps, so you can sweep a denoise level, a strength, a scale - any FLOAT input - over the course of a batch or an animation instead of holding it constant.
The neat part is the dual output. Most ComfyUI modulation nodes make you pick one style: a value list to splice into a batch, or a single value for the current frame. This one gives you both. And it renders a plot, because guessing whether your wave actually looks like what you wanted is the fastest way to waste a render.
How it works
The core is a tiny waveform generator. Pick a shape - sine, triangle, sawtooth, square, pulse, noise, or the easing variants - and it samples that wave across steps frames, mapped so the wave's low point hits amplitude_min and its high point hits amplitude_max. frequency sets how many full cycles fit across the whole run (not per-second, which trips people up - 1.0 means one cycle over the entire list). phase_offset shifts where the wave starts, so 0.5 begins halfway through a cycle. The Random waveform is seeded, and noise_smoothing runs a convolution over it so random jumps don't make your parameter spasm frame to frame.
The inputs that matter
- waveform - 12 shapes. Sine is the sane default; sawtooth for a ramp; square for hard on/off.
- frequency - cycles across the whole duration.
- amplitude_min / amplitude_max - the floor and ceiling of the sweep. These are the two you'll touch constantly.
- steps - how many values the list holds. Match it to your batch size or total frames.
- phase_offset - where the wave begins.
- seed / noise_smoothing - only matter for the Random waveform.
Outputs: current_value (a single FLOAT, ideal when wired with the optional current_step input so it tracks a changing frame index), value_list (the full FLOAT list for batch/broadcast workflows), list_as_string (for text or debugging), and lfo_plot (an IMAGE preview of the wave).
Installing
Ships with MD Nodes:
cd path/to/ComfyUI/custom_nodes
git clone https://github.com/MDMAchine/ComfyUI_MD_Nodes.git
cd ComfyUI_MD_Nodes
pip install -r requirements.txt
Or ComfyUI Manager → MD Nodes → install, then restart. The plot output needs matplotlib; the values themselves don't.
Common issues
The most common mistake is reading frequency as "cycles per second" - it's cycles per full run, so a frequency of 1 over 20 steps is a single gentle swell, not a wobble. And remember that a plain LFO output doesn't change anything by itself: it's only useful connected to a parameter that varies per frame or per batch item. If your workflow expects one fixed number, wiring current_value with a fixed current_step just hands you back a constant - pick the output that matches how your consumer node consumes it.
Inputs (9)
| Name | Type | Default | Description |
|---|---|---|---|
| waveform | COMBO | Sine | WAVEFORM SHAPE • Purpose: The mathematical pattern used to modulate the values. |
| frequency | FLOAT | 1.00.1–100 | FREQUENCY (SPEED) • Purpose: How many complete cycles occur over the batch duration. |
| amplitude_min | FLOAT | 0.00-10000–10000 | MINIMUM VALUE (FLOOR) • Purpose: The absolute lowest value the wave will hit. |
| amplitude_max | FLOAT | 1.00-10000–10000 | MAXIMUM VALUE (CEILING) • Purpose: The absolute highest value the wave will hit. |
| phase_offset | FLOAT | 0.000–1 | PHASE SHIFT • Purpose: Offsets where the wave begins. 0.5 starts the wave halfway through its cycle. |
| steps | INT | 201–10000 | TOTAL STEPS (DURATION) • Purpose: The total number of frames/steps to generate in the list. |
| seed | INT | 00–9007199254740991 | STOCHASTIC SEED • Purpose: Controls the randomness of the 'Random (Noise)' waveform. |
| noise_smoothing | FLOAT | 0.500–1 | NOISE SMOOTHING • Purpose: Applies a convolution kernel to smooth out jagged points. Only active for Random waves. |
| current_stepopt | INT | 00–10000 | CURRENT STEP INDEX • Purpose: If connected, returns the specific float value at this index from the generated list. |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| current_value | FLOAT | — |
| value_list | FLOAT | — |
| lfo_plot | IMAGE | — |
| list_as_string | STRING | — |