VRGDG_TrimFinalClip
Cut the finished video exactly to the music, without opening an editor
- trigger
- final_clip_path
The last step of an AI music video is always the same disappointment: the rendered clip is a couple of seconds longer than the song, and you end up in a video editor trimming the tail by hand. VRGDG_TrimFinalClip is the node that does that trim for you, right inside ComfyUI, so the final file matches the audio duration exactly.
It sits at the end of VRGameDevGirl's music video pipeline. After the per-scene chunks are generated, combined into one long clip, and synced to the audio, this node cuts the result down to size and hands you the path of the finished file. If you're building the full reference-image-plus-audio-track workflow, this is the "and then it just renders" step - the thing that makes the pipeline actually one-click rather than "one click plus manual editing."
How it works
The inputs tell the story of the whole assembly process:
trigger- expects aVHS_FILENAMESvalue, i.e. the filename output of a VideoHelperSuiteVHS_VideoCombinenode. This is how the node knows which combined clip to trim, and it's why the node has no filename widget: it waits for the combine step to report what it wrote.output_folderandbase_name(defaultvideo) - where the trimmed file goes and what it's called.frames_per_scene,index,total_sets- the chunk geometry of your render, so the node can map the combined clip back to where each scene starts.audio_total_duration(float, seconds) - the song length. This is the number everything gets cut to.fps(default 24) - used to convert the duration into the right frame count.overwrite(default true) - re-render over an existing trimmed file or not.
The single output, final_clip_path (a string), is what you save or upload - a finished video whose duration matches your audio track. That "open an editor and drag the end in" step is gone.
Installing it
Part of the VRGameDevGirl Video Enhancement Nodes pack. Install via ComfyUI Manager (search vrgamedev) or manually:
cd ComfyUI/custom_nodes
git clone https://github.com/vrgamegirl19/comfyui-vrgamedevgirl
Restart ComfyUI. One dependency to know about: the trigger input is a VHS_FILENAMES type, which comes from VideoHelperSuite - you need that pack installed too, which you almost certainly already have if you're doing any video work in ComfyUI. No model downloads.
Common issues
The node won't connect to your combine node. The trigger input only accepts VHS_FILENAMES - you must wire it from a VideoHelperSuite combine node's filename output. A plain string won't snap in.
The trim is off by a few frames. Check fps against what your combine node actually used. If the combine ran at 30 but this node thinks 24, every duration conversion is wrong. And make sure audio_total_duration is the true song length in seconds.
overwrite is false and nothing happens. The node skips an existing output. Flip it to true to force a fresh trim.
For anyone building the full music video workflow, this is the node that turns a pipeline into a finished product. It's fiddly to wire the first time - the VHS_FILENAMES trigger trips people up - but once it's connected, it's a permanent fixture.
Inputs (9)
| Name | Type | Default | Description |
|---|---|---|---|
| trigger | VHS_FILENAMES | — | |
| output_folder | STRING | — | |
| base_name | STRING | video | — |
| frames_per_scene | INT | — | |
| audio_total_duration | FLOAT | — | |
| index | INT | — | |
| total_sets | INT | — | |
| fps | INT | 24 | — |
| overwrite | BOOLEAN | true | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| final_clip_path | STRING | — |