Nodes/Comfyui_URN_AudioTools/URN Audio Smart Splitter
ComfyUI Node

URN Audio Smart Splitter

Chop a song into 9-second pieces without cutting mid-word

By Clivey1234·Created 2 days ago·Updated a day ago· 4
URN Audio Smart Splitter
  • audio_input
  • output_folder
  • debug_text
  • transcript_srt
◄audio▾►
◄target_length9.000►
◄minimum_length6.000►
◄maximum_length12.000►
◄vocal_safetyStrong►
◄whisper_modelmedium►
◄analysis_deviceCUDA►
◄beam_size18►
◄patience3.0►
◄output_formatFLAC►
◄export_stemstrue►
◄use_vocal_stem_for_analysistrue►
◄export_vocal_chunkstrue►
◄export_music_stemtrue►

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:

  1. Decode the audio and build a fine-grained energy profile (10 ms hops).
  2. Transcribe with Faster-Whisper to get word-level timestamps.
  3. Expand each word's region by a clearance based on vocal_safety - Strong is more conservative than Normal.
  4. Look for protected quiet corridors between word regions, score the candidates, and refine the chosen cut to the middle of the widest safe gap.
  5. 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_input is 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) and maximum_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 to Normal when Strong can't find enough cut points in dense material.
  • whisper_model - tiny through large-v3. medium is the default and a fair balance; large-v3 is slow and demands the most.
  • analysis_device - Auto, CUDA or CPU.
  • beam_size (default 18) and patience (default 3) - Whisper decoding effort. Higher searches more alternatives, slower.
  • output_format - FLAC (default, lossless) or MP3.
  • 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/.

CategoryURN Audio Tools

Inputs (15)

NameTypeDefaultDescription
audioCOMBO0 options:
target_lengthFLOAT9.0005–60—
minimum_lengthFLOAT6.0005–60—
maximum_lengthFLOAT12.0005–60—
vocal_safetyCOMBOStrong2 options: Strong, Normal
whisper_modelCOMBOmedium5 options: tiny, base, small, medium, large-v3
analysis_deviceCOMBOCUDA3 options: Auto, CUDA, CPU
beam_sizeINT181–20—
patienceFLOAT3.01–5—
output_formatCOMBOFLAC2 options: FLAC, MP3
export_stemsBOOLEANtrueSave the full Mel-RoFormer isolated vocal stem beside the chunks.
use_vocal_stem_for_analysisBOOLEANtrue—
export_vocal_chunksBOOLEANtrue—
export_music_stemBOOLEANtrueSave the full Mel-RoFormer instrumental/music stem (music without vocals) in the stems folder.
audio_inputoptAUDIO—

Outputs (3)

NameTypeDescription
output_folderSTRING—
debug_textSTRING—
transcript_srtSTRING—