Load Audio & Crop
Trim your reference audio by ear instead of guessing seconds
- audioUI
- audio
- duration
Typing start_time and end_time in seconds is a miserable way to work with audio. You load a song, guess that the good part starts around 47 seconds, run the whole pipeline, and discover the chorus actually begins at 51. Load Audio & Crop is the fix: it loads an audio file onto the node as a real waveform player, and you drag the trim handles until it sounds right - then it hands the cropped window to the rest of the graph.
Audio is the newest, most bolted-on layer of the ComfyUI stack, and it shows. Most of the models that consume it want a clean segment, not a whole file: an audio-driven talking head wants the ten seconds where someone talks, an LTX-2.3 audio-conditioned video wants the exact instrumental you're syncing to, a reference track for a music-to-dance run wants the chorus and nothing else. Feeding those models a four-minute file is both a memory bill and a conditioning mess. This node is the trim-before-you-feed step.
There's a second trick hidden in the file picker. It doesn't just take audio. Point it at an .mp4, .mov, .mkv, .webm, or .avi and it will rip the audio track out of the video via PyAV - so you can pull the dialogue straight off a downloaded reference clip without a separate conversion step.
How it works
The node decodes the file through PyAV first, then falls back through soundfile, torchaudio, and a standard-library wave reader until something succeeds. That chain covers wav, mp3, flac, ogg, m4a, aac, opus, wma, and video containers. The smart bit: when a crop is set, it seeks and decodes only the window you asked for, so memory is bounded by the crop rather than the whole track. No crop means a full decode of the file.
On the canvas you get a waveform with play/pause (Space), frame stepping (← / →), and draggable cyan trim pins. Drag between the pins to slide the whole window; click outside or ✕ Full to reset to the full track. The handles are two-way bound to the numeric inputs, so you can also just type a value and watch the handles jump.
Inputs:
audio- a file picker over your ComfyUI input folder. Upload, drag & drop, or pick something already there.start_time/end_time(FLOAT, seconds) - where the crop begins and ends. Both snap to whole seconds. Settingend_timeto 0 means "to the end of the track," sostart_time30 /end_time0 gives you from 30 seconds onward.
Outputs:
audio- the crop as a standard ComfyUI AUDIO value (a{"waveform": tensor, "sample_rate": int}dict). It plugs straight into any node downstream that takes an AUDIO input.duration- the output audio's length in seconds.
What to watch out for
Three honest gotchas, all visible in the source:
durationrounds up to the nearest whole second (math.ceil). A 3.2-second crop reports 4.0. Fine for sanity checks and most downstream math, but if you're wiring duration into exact frame or latent calculations, don't take it as gospel.- Everything snaps to whole seconds. You can't grab a 1.5-second slice from the middle of a track - the crop grid is second-aligned. That's deliberate (video models think in frames, and seconds keeps the trim aligned with them), but it means fine sub-second timing needs a different tool.
- Ends can be quiet. Cropping on the second means the boundaries of your window land wherever they land mid-phrase. The waveform makes this visible before you commit, so nudge the handles until the edit sounds clean - that's the whole point of doing it visually.
How to install it
ComfyUI Manager - search "Comfyui-reference-loader" - or the manual route:
cd ComfyUI/custom_nodes
git clone https://github.com/sthao42/Comfyui-reference-loader
Restart ComfyUI afterward - the interactive UI lives in frontend JS that only loads on startup, so a restart plus a browser refresh is what actually registers it. No model downloads, no API keys, and no extra pip packages beyond what ComfyUI already ships (PyAV is bundled). One note: installing the pack pulls in all four of its nodes, including the video and image loaders. This pack is very new, so if the waveform never appears after a clean restart, check the browser console for the node's own decode errors before assuming the install broke - that's where it logs what it couldn't read.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| audio | COMBO | The audio file to load. Upload, drag & drop, or select an existing file. | |
| start_time | FLOAT | 00–100000 | Crop start time in seconds (0 = start). Snaps to nearest second. |
| end_time | FLOAT | 00–100000 | Crop end time in seconds (0 = full track / end). Snaps to nearest second. |
| audioUIopt | AUDIO_UI | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| audio | AUDIO | The loaded audio, cropped to the selected time range (or full audio if uncropped). |
| duration | FLOAT | Duration of the output audio rounded up to the nearest second. |