URN Audio Smart Splitter
Chop a song into 9-second pieces without cutting mid-word
- audio_input
- output_folder
- debug_text
- transcript_srt
Every audio-driven video pipeline needs the same thing: a long track broken into short chunks that each fit a clip length. Every naive implementation does it the same way too - fixed 9-second splits on the timeline - which is why so much lip-sync footage features a mouth that keeps moving after the audio stops.
URN Audio Smart Splitter (class URNSmartAudioChunker) does it properly. It transcribes the audio, finds the gaps between words, and puts the cuts there. It exports the chunks, per-chunk subtitles, a full SRT, and optionally the vocal and instrumental stems along with them.
How it works
Under the hood there's a chain of decisions, in this order:
- Decode the audio and build a fine-grained energy profile (10 ms hops).
- Transcribe with Faster-Whisper to get word-level timestamps.
- Expand each word's region by a clearance based on
vocal_safety-Strongis more conservative thanNormal. - Look for protected quiet corridors between word regions, score the candidates, and refine the chosen cut to the middle of the widest safe gap.
- If no safe gap exists near the target, fall back to a plain energy-based cut rather than skipping the chunk.
Mel-RoFormer (the Kim FT2 Bleedless model, via audio-separator) does the optional vocal separation, and use_vocal_stem_for_analysis makes the analysis run on the isolated vocal instead of the full mix - the difference between finding word gaps and finding drum hits. The model lands in ComfyUI/models/mel_roformer/ on first use and is reused after; the node also caches settings per source so it doesn't re-separate the same file for nothing.
Output is organised per source under ComfyUI/output/audio_chunks/, with chunks/, vocal_chunks/, chunk_srts/, chunk_text/, stems/ and transcripts/. Stems are always written lossless as FLAC, even when your chunk format is MP3.
Inputs and outputs
The settings that matter:
audio- a file picker for MP3/WAV/FLAC.audio_inputis the optional connected AUDIO alternative; when a cable is connected it takes priority and the picked file is ignored.target_length(default 9s),minimum_length(6s) andmaximum_length(12s) - the splitter aims at the target but is allowed to wander between the bounds to find a safe cut. The target has to sit inside the min/max range.vocal_safety-Strong(default) gives wider clearance around words. Drop toNormalwhen Strong can't find enough cut points in dense material.whisper_model-tinythroughlarge-v3.mediumis the default and a fair balance;large-v3is slow and demands the most.analysis_device-Auto,CUDAorCPU.beam_size(default 18) andpatience(default 3) - Whisper decoding effort. Higher searches more alternatives, slower.output_format-FLAC(default, lossless) orMP3.- The export toggles:
export_stems,use_vocal_stem_for_analysis,export_vocal_chunks,export_music_stem.
Outputs are output_folder (path string, handy as a prefix), debug_text (the processing report - analysis method, settings, cut-safety statistics, paths) and transcript_srt, the full transcript as standard SRT, which is also written to disk.
Install
cd ComfyUI/custom_nodes
git clone https://github.com/Clivey1234/Comfyui_URN_AudioTools
Run install.bat, or install requirements.txt with ComfyUI's Python. This is the node that makes the pack's dependency list heavy - faster-whisper, audio-separator[cpu], librosa, scipy, soundfile. MP3 chunk export needs ffmpeg on PATH; FLAC doesn't.
ComfyUI Manager: search Comfyui_URN_AudioTools. Note that this node list entry is URN Audio Smart Splitter, while the class name stays URNSmartAudioChunker for workflow compatibility - the visible name changed at some point and the old readme filename still says "Smart Audio Splitter".
Common issues
First run takes forever. It's downloading the Whisper model and the Mel-RoFormer checkpoint. Later runs reuse them. If you're on CPU, drop whisper_model to base or small and set export_stems off - separation is the expensive part, and you can skip it entirely if you don't need stems.
The chunks are uneven lengths. That's the feature, not a bug. The splitter trades chunk-count regularity for not cutting through words, so a chunk can come out noticeably shorter or longer than target_length when the nearest safe gap is far away. Tighten minimum_length/maximum_length if you need it more predictable, and accept more mid-word cuts in trade.
MP3 export fails. ffmpeg isn't on PATH where ComfyUI can see it. Use FLAC - you're feeding these into another process anyway, and lossless is the better default.
Vocal chunks don't line up with the main chunks. They're meant to be sample-aligned, which is the point of generating them at all. If they've drifted, you likely changed the whisper or analysis settings between runs - the debug report will show which analysis path was used.
Nothing useful in vocal_chunks/. Mel-RoFormer separation must have run. Check that stems were exported without error and that the model file exists in ComfyUI/models/mel_roformer/.
Inputs (15)
| Name | Type | Default | Description |
|---|---|---|---|
| audio | COMBO | 0 options: | |
| target_length | FLOAT | 9.0005–60 | — |
| minimum_length | FLOAT | 6.0005–60 | — |
| maximum_length | FLOAT | 12.0005–60 | — |
| vocal_safety | COMBO | Strong | 2 options: Strong, Normal |
| whisper_model | COMBO | medium | 5 options: tiny, base, small, medium, large-v3 |
| analysis_device | COMBO | CUDA | 3 options: Auto, CUDA, CPU |
| beam_size | INT | 181–20 | — |
| patience | FLOAT | 3.01–5 | — |
| output_format | COMBO | FLAC | 2 options: FLAC, MP3 |
| export_stems | BOOLEAN | true | Save the full Mel-RoFormer isolated vocal stem beside the chunks. |
| use_vocal_stem_for_analysis | BOOLEAN | true | — |
| export_vocal_chunks | BOOLEAN | true | — |
| export_music_stem | BOOLEAN | true | Save the full Mel-RoFormer instrumental/music stem (music without vocals) in the stems folder. |
| audio_inputopt | AUDIO | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| output_folder | STRING | — |
| debug_text | STRING | — |
| transcript_srt | STRING | — |