Audio Crop Process (UTK)
Trim, boost, and resample audio inside the video workflow
- audio
- audio
- sample_rate
- channels
- duration
Audio in ComfyUI is usually a side quest - you need to trim a clip to match your video length, boost it so it isn't inaudible, or resample it so the video model actually accepts it. Audio Crop Process (UTK) does all three in one node, and it plugs directly into ComfyUI's native AUDIO format, so it works with whatever audio node or loader the rest of your graph uses.
How it works
You feed it an audio input (the standard AUDIO tensor+sample-rate dict that ComfyUI's audio nodes pass around) and set up to five transforms:
- offset_seconds - where to start. 0 = from the beginning.
- duration_seconds - how long a chunk to keep, counted from the offset. 0 = keep everything from the offset to the end. To trim the head off a clip you set offset; to grab a specific window you set both.
- gain_db - volume in decibels, ±100 range. +6 dB is roughly double loudness; −6 is half. The standard "this clip is too quiet" fix.
- resample_to_hz - the target sample rate (e.g. 44100 or 48000). 0 = leave it alone. It uses
torchaudio.functional.resampleinternally. This matters more than people expect: some video pipelines hard-require a specific sample rate and silently glitch if you feed them 44.1k when they want 48k. - make_stereo (default on) - forces mono audio to stereo by duplicating the channel. If the input already has more than two channels, it errors instead of guessing.
Order matters: crop first, then resample, then gain, then channel conversion. So a gain_db applies to the cropped segment - if you crop a loud section, the gain is applied to that, which is what you usually want.
Outputs
Four: audio (the processed AUDIO, ready to feed a video node's audio input or a save node), sample_rate, channels, and duration (all the numbers that tell you what came out - handy for logging or for feeding a context-window calculator).
Installing it
Standard pack install - ComfyUI Manager → search ComfyUI-UniversalToolkit, or:
cd ComfyUI/custom_nodes
git clone https://github.com/whmc76/ComfyUI-UniversalToolkit
cd ComfyUI-UniversalToolkit && pip install -r requirements.txt
Then restart. This node is where the pack's audio dependencies matter: it needs torchaudio (for resampling), which is in the requirements but is one of the heavier extras. If you only installed partial deps, resampling errors here are the tell.
Gotchas
duration_seconds = 0means "to the end," not "zero length." This is the one that confuses people - a 0 here is "no limit." If you want literally nothing, that's not a thing this node does.- make_stereo + multi-channel input = hard error. Mono goes to stereo happily; 5.1 or anything above 2 channels refuses. Downmix those before this node.
- It uses torchaudio for resampling - if you don't need resampling you can dodge the heavy dependency, but the node still imports it. Install the pack's requirements properly and move on.
- The AUDIO format is pack-agnostic in ComfyUI, so this plays nice with any loader - just not with raw file paths. If you have a file, load it first.
It's the boring, necessary glue for anything that pairs audio with generated video. Not exciting, but when your clip is 3 seconds too long and the export keeps failing, this is the node that ends the fight.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| audio | AUDIO | — | |
| gain_db | FLOAT | 0.00-100–100 | — |
| offset_seconds | FLOAT | 0.000–100000000000000000 | — |
| duration_seconds | FLOAT | 0.000–100000000000000000 | — |
| resample_to_hz | FLOAT | 0.000–100000000000000000 | — |
| make_stereo | BOOLEAN | true | — |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| audio | AUDIO | — |
| sample_rate | INT | — |
| channels | INT | — |
| duration | FLOAT | — |