(deforum) Cadence Parameters
Run diffusion less, interpolate the rest
- deforum_data
- deforum_data
The biggest waste in Deforum video is running full diffusion on every single frame - 120 frames of sampling for what's often a fairly slow camera move. (deforum) Cadence Parameters is the pack's answer: it lets you run diffusion on a subset of frames and fill the gaps with optical-flow interpolation, a trick Deforum adopted from the animation world where you animate keyframes and let software in-between them. Set diffusion_cadence to 4 and the sampler runs on roughly every 4th frame while the motion between them is synthesized - same-looking video, a fraction of the render time. This is the node that makes long Deforum renders feasible on consumer GPUs.
How it works
Cadence is a keyframe strategy. diffusion_cadence (default 4) says "diffuse a frame, then skip N-1 frames and only run the camera transform on them." The skipped frames are produced by optical-flow warping from the last diffused frame instead of a full denoise pass - optical_flow_cadence lets you pick the flow estimator (RAFT for quality, DIS Medium/Fine for speed, Farneback as the cheap classic). So your expensive diffusion runs at 6–15 fps while the output stays at 24fps, with the flow model doing the interpolation.
The node's second half is about redoing those interpolated frames: optical_flow_redo_generation and diffusion_redo tell the pipeline when to run diffusion again on top of a warped frame (re-adding detail that flow warping washes out), and the *_flow_factor schedules control how aggressively the flow warp is applied frame to frame. It's a two-tier pipeline - diffuse → warp → occasionally re-diffuse - and these six fields are the tuning knobs for all of it.
The inputs that matter
diffusion_cadence- how many frames between diffused frames. Default 4 is a good balance; 1 is "no cadence, diffuse everything" (wasteful); 8+ is fast but quality degrades as flow warping stretches further.optical_flow_cadence- the flow estimator for the interpolation step:None,RAFT,DIS Medium,DIS Fine,Farneback. RAFT is the quality pick; DIS Medium is the speed pick most people settle on.cadence_flow_factor_schedule-0: (1)by default; how much of the estimated motion to apply. Lower it if warped frames look too aggressive.optical_flow_redo_generation/redo_flow_factor_schedule/diffusion_redo- the "refresh" tier: when to re-run diffusion over interpolated frames and how strongly. Leave defaults unless you see blur.
Like all Deforum parameters nodes, it merges its settings into the deforum_data dict and passes it on - chain it after (deforum) Base Parameters.
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 (opencv-contrib-python, moviepy, numpy<2.0.0, deforum-studio backend, etc.). Python 3.10 per the README.
Where people get burned
The classic mistake is cranking diffusion_cadence too high to save time and then wondering why fast motion smears - flow warping is great for slow pushes, bad for whip-pans. Keep cadence moderate and turn up redo when there's fast movement. And if you set optical_flow_cadence to None, the interpolated frames aren't flow-warped at all, which silently changes the whole look. Finally, remember cadence interacts with the rest of the pipeline: frame-indexed schedules are evaluated per output frame, not per diffused frame, so your zoom schedule still covers the whole clip.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| diffusion_cadence | INT | 4 | — |
| optical_flow_cadence | COMBO | 5 options: None, RAFT, DIS Medium, DIS Fine, Farneback | |
| cadence_flow_factor_schedule | STRING | 0: (1) | — |
| optical_flow_redo_generation | COMBO | 5 options: None, RAFT, DIS Medium, DIS Fine, Farneback | |
| redo_flow_factor_schedule | STRING | 0: (1) | — |
| diffusion_redo | STRING | 0 | — |
| deforum_dataopt | deforum_data | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| deforum_data | deforum_data | — |