Trim Audio Duration
The scalpel of the audio family
- audio
- AUDIO
Generated audio never starts where you want it to. Stable Audio and ACE-Step happily give you lead-in silence, trailing noise, or a first bar you don't want - and TrimAudioDuration is how you cut it down to the good part. It slices an AUDIO tensor into a chosen time range, which makes it the most constantly useful of the audio editing nodes: you'll reach for it before almost every concat, merge, or save.
It's part of the September 2025 batch of built-in audio editing nodes, and it's about as direct as a node gets. Two numbers in, a shorter track out.
How it works
The node works in seconds, not frames - which is the first thing to appreciate, because it makes trimming feel like a DAW rather than a tensor op. Internally it converts your seconds to sample frames using the track's own sample rate, then slices the waveform.
The two inputs that matter:
start_index(FLOAT, default 0) - where to start, in seconds. It supports sub-second precision, and here's the genuinely nice bit: negative values count from the end of the track. So-10starts the trim ten seconds before the track ends. That's a lifesaver for grabbing the tail of a generation without first finding out how long it is.duration(FLOAT, default 60) - how long the trimmed segment should be, in seconds. The end of the slice is simplystart + duration, clamped to the track length.
The one restriction: the start has to land before the end. If your start plus duration overshoots the track, the node clamps to the actual end rather than erroring - so a trim of start=5, duration=100 on a 30-second track just gives you the last 25 seconds.
Inputs and output
audio(AUDIO) - the track to slice.start_index(FLOAT) - start in seconds; negative counts from the end.duration(FLOAT) - length of the segment in seconds.AUDIO(output) - the sliced segment.
Getting it
Ships with ComfyUI core since September 2025. Nothing to install.
Common issues
The main thing that trips people is expecting timeline-style clips with "end" values instead of start-plus-duration. It's start and length, not start and end - set duration to the segment length you want, not the end timestamp. And if you trim right up to the edge of a section, remember this node does a hard cut with no fade; for speech that's fine, for music you may want to trim a hair shorter or longer to land on a quieter moment. After trimming, feed the result to AudioConcat to assemble clips, or to PreviewAudio to check the cut by ear.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| audio | AUDIO | — | |
| start_index | FLOAT | 0.00-18446744073709550000–18446744073709550000 | Start time in seconds, can be negative to count from the end (supports sub-seconds). |
| duration | FLOAT | 60.00 | Duration in seconds |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| AUDIO | AUDIO | — |