(deforum) Amplitude to Schedule
Amplitude curves become motion schedules
- amplitude
- deforum_frame_data
- y
- z
- DEFORUM_FRAME_DATA
- AMPLITUDE
- STRING
This is the node that makes a Deforum video actually dance. (deforum) Amplitude to Schedule takes an AMPLITUDE series - beat energy, an envelope, anything you extracted from your music - and converts it into a Deforum keyframe schedule for one of the animation parameters: zoom, translation_x, angle, rotation_3d, fov, cfg_scale, and 40-something others. Every music-synced Deforum workflow is built on this pattern, and this is the cleanest implementation of it in the pack. If you've ever watched a video where the camera punches in on every beat, this node was in that graph.
How it works
You pick a parameter with type_name and hand over the amplitude. For each frame index, the node evaluates a math expression with the raw amplitude value as x (and optionally the frame index t, the total length max_f, plus secondary series y and z). The default expression is x/100 - which scales your (presumably 0–100-ish) amplitude into the small percentage range that zoom or translation schedules expect. The result for every frame becomes a keyframe-series entry, which gets written into the deforum_frame_data dict under the right schedule key (zoom_series, translation_x_series, and so on). That dict then drives the sampler nodes, which interpolate the series to get per-frame values.
Under the hood it's a constrained eval: the expression can use x, t, max_f, y, z, plus a whitelist of math functions (sin, cos, exp, log, sqrt, factorial, pi, e, min, max, abs, ...). That whitelist is the safety valve - you can't just run arbitrary Python, which is the right call for something that evaluates on every frame.
The inputs that matter
type_name- which schedule you're generating. The dropdown lists all the Deforum schedule types;zoom,translation_x/y/z,angle, androtation_3d_*are the ones you'll reach for first.amplitude- theAMPLITUDEseries doing the driving.math- the per-frame expression, defaultx/100. This is your creative knob:x/100is gentle,x * 0.5is violent,pow(x, 2) / 1000makes it punchy only on big peaks.max_frames- the length the schedule is built for (default 500). Match it to your animation's frame count or the tail of the schedule will be wrong.filter_window- a built-in moving-average smooth on the amplitude before mapping; 0 (default) is off. Same idea as the separate TimeSmoothing node.
Outputs: DEFORUM_FRAME_DATA (the dict with your new schedule merged in - wire this onward), AMPLITUDE (the mapped series), and STRING (a human-readable 0:(val), 1:(val), ... schedule you can eyeball or paste elsewhere).
Installing it
Part of Deforum Nodes (XmYx). ComfyUI Manager → "Deforum Nodes", or:
cd ComfyUI/custom_nodes
git clone https://github.com/XmYx/deforum-comfy-nodes.git
First boot runs install.py (pandas, librosa, opencv-contrib-python, moviepy, numpy<2.0.0, deforum-studio). Python 3.10 per the README.
Where people get burned
Scale, scale, scale. Amplitude values are usually 0–1 or 0–100 depending on your extraction node, and if you don't divide down (x/100) your zoom schedule is in the hundreds of percent and the camera launches off-screen. Check the STRING output once to see what the mapped series actually looks like before you commit to a long render. And don't forget max_frames - an animation longer than the schedule gets whatever the last keyframe holds, forever.
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| type_name | COMBO | 47 options: angle, transform_center_x, transform_center_y, zoom, translation_x, translation_y, +41 | |
| amplitude | AMPLITUDE | — | |
| max_framesopt | INT | 5001–16500 | — |
| mathopt | STRING | x/100 | — |
| filter_windowopt | INT | 00–100 | — |
| deforum_frame_dataopt | DEFORUM_FRAME_DATA | — | |
| yopt | AMPLITUDE | — | |
| zopt | AMPLITUDE | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| DEFORUM_FRAME_DATA | DEFORUM_FRAME_DATA | — |
| AMPLITUDE | AMPLITUDE | — |
| STRING | STRING | — |