Audio Frame Adjuster (CRT)
Make an audio clip match your video's frame count
- audio
- audio
- duration_seconds
Video and audio have different native units - frames and fps versus seconds - and the moment you're building a workflow that needs both to line up (music synced to a generated clip, a voiceover trimmed to fit an exact shot length), you're doing frame-to-seconds math by hand unless something does it for you. This node does that math and then actually extends or trims the audio to fit.
What it's for
You give it an audio clip and tell it how many frames your video is and at what fps. It works out the target duration from those two numbers and reshapes the audio to match - trimming if the audio is too long, and extending it using one of three strategies if it's too short. This matters more than it sounds like: video models with native audio generation (Lightricks' LTX-2/2.3 line is the current example doing synchronized audio+video in one pass) and any workflow gluing a separately-generated soundtrack onto a video batch both need the two tracks to land on exactly the same length, not "close enough."
The inputs and outputs that matter
audio- requiredAUDIOinput.frame_count(default 120, range 1–999999) - how many video frames you're targeting.fps(default 30, range 1–120) - your video's frame rate. Together withframe_countthis derives the target duration in seconds.extension_mode- an enum with three choices, for when the audio is shorter than the target:loop(repeats the clip until it fills the duration),silence(pads the remainder with silence), andfade_loop(loops the clip but crossfades the seam instead of a hard cut).fade_duration(default 0.5, range 0–5) - per its own tooltip: "Fade duration in seconds for fade_loop mode." Only relevant whenextension_modeisfade_loop.
Outputs: audio (the adjusted clip) and duration_seconds (a FLOAT - the computed target duration), which is handy to wire into any downstream node that also needs to know the clip length as a plain number rather than inspecting the audio object.
Installing it
Part of CRT-Nodes' seven-node CRT/Audio category, alongside things like the Parametric EQ, Tube Compressor, and the transcript nodes - all bundled in PGCRT's larger CRT-Nodes pack.
ComfyUI Manager - search CRT-Nodes, install, restart.
Manual:
cd ComfyUI/custom_nodes
git clone https://github.com/PGCRT/CRT-Nodes.git
pip install -r requirements.txt
Restart ComfyUI. The pack's audio tooling runs on librosa, pedalboard, and imageio-ffmpeg from the base requirements.txt - this node doesn't need anything beyond that shared install.
Common issues
- Audio and video still drift out of sync downstream - double-check
fpshere actually matches the fps your video is being saved or encoded at further down the graph. It's an easy mismatch to introduce if you changed your video node's frame rate but forgot to update this node to match. loopmode produces an audible click or seam - that's the hard cut where the clip repeats. If it's noticeable, switch tofade_loopand tunefade_durationuntil the seam disappears; for music with a strong beat, a longer fade tends to hide the seam better than a short one.silencemode leaves an obviously dead patch at the end - expected behavior, not a bug; it's the mode to reach for when you specifically want a hard stop rather than a continued loop, e.g. a voice line that should just end rather than repeat.- Output duration doesn't look right - remember
duration_secondsis computed fromframe_countandfps, not measured from the original audio. If the number looks off, it's almost always one of those two widget values, not a bug in the node.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| audio | AUDIO | — | |
| frame_count | INT | 1201–999999 | — |
| fps | FLOAT | 30.001–120 | — |
| extension_mode | COMBO | 3 options: loop, silence, fade_loop | |
| fade_duration | FLOAT | 0.50–5 | Fade duration in seconds for fade_loop mode |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| audio | AUDIO | — |
| duration_seconds | FLOAT | — |