Nodes/SDXL Auto Prompter/APNext H3 Stem Split (Demucs stems for beats)
ComfyUI Node

APNext H3 Stem Split (Demucs stems for beats)

Split the song so the beat detectors hear the rhythm section

By dagthomas·Created 3 years ago·Updated about 23 hours ago· 290
APNext H3 Stem Split (Demucs stems for beats)
  • audio
  • beats_mix
  • vocals
  • drums
  • bass
  • other
  • info
modelhtdemucs (4 stems, fast)
include_drumstrue
include_basstrue
include_vocalsfalse
include_otherfalse

Beat detection has a dirty secret: it's much easier to fake than to do well. On a compressed master, the low-band spectral flux that a kick detector reads is polluted by vocals, pads, and bass-note changes - the pack's Sound Events header notes that a bassline move can fake a kick entirely. H3StemSplit exists to take that pollution out of the equation. It separates the song into vocals / drums / bass / other with Demucs and lets you sum only the stems that actually carry the pulse into a beats_mix - which is what you feed the beat and event detectors instead of the full song.

How it works

It wraps Demucs (htdemucs, the same separator the stemkit app uses). Pick the model, and the node separates the song, then sums whichever stems you've selected into beats_mix. The defaults are the right call for most music: drums and bass on (the kick and snare are the pulse, and bass hits ride the kick on most masters), vocals and other off (vocal energy in the low band is exactly what fakes beats on the full mix). Turn include_other on for guitar-driven tracks whose rhythm lives outside the drums.

Two model choices:

  • htdemucs - the standard 4-stem hybrid transformer, fast.
  • htdemucs_ft - fine-tuned, runs four models and averages them. Noticeably slower, slightly cleaner stems.

The dependency you have to install yourself

This is the one node in the H3 audio suite with a genuine extra install step. Demucs is not in the pack's requirements.txt - it's an optional dependency. The node tells you when it's missing, and so will I:

# into ComfyUI's python - portable Windows build:
python_embeded\python.exe -m pip install demucs
# or a normal venv:
pip install demucs

Then restart ComfyUI. First use downloads the htdemucs weights - about 320 MB - into the torch hub cache. The separation runs once per song and is cached like any node output, and the model is moved off the GPU afterwards so the render gets its VRAM back. On CPU it's workable but slow; on GPU a song is a couple of minutes at most.

Outputs and where they go

  • beats_mix - the selected stems summed. Wire this into H3 Sound Events and H3 Beat Grid instead of the full song, so beats are detected from the instruments that carry them.
  • vocals - the vocal stem. This is the star output for the music-video pipeline: wire it into the Music Video Writer's vocals (Whisper transcribes a stem noticeably cleaner than the mix - the same advice as the Lyrics Transcribe node) and into H3 Masked Song Latent's voice gate.
  • drums, bass, other - the individual stems, if you want them separately.
  • info - model, device, length, and what went into beats_mix.

The same vocal stem also feeds H3VoiceOverMusic's voice input, so one Stem Split node fans out to most of the audio chain.

Installing the pack

ComfyUI Manager, search "comfyui_dagthomas", install, restart:

cd ComfyUI/custom_nodes
git clone https://github.com/dagthomas/comfyui_dagthomas
cd comfyui_dagthomas
pip install -r requirements.txt

Honest take: if your track is a clean, sparse production you may not need this node at all - the detectors do fine on obvious four-on-the-floor. You reach for it when the beat detector starts hallucinating kicks that aren't there, or when the vocal is fighting the low band. That's a precise problem, and this is a precise fix. It's also the priciest node in the audio suite in setup terms (extra pip install + 320 MB weights), so don't add it until you've hit the problem it solves.

Categorycomfyui_dagthomas/H3

Inputs (6)

NameTypeDefaultDescription
audioAUDIOThe song to split into stems.
modelCOMBOhtdemucs (4 stems, fast)Which Demucs model separates the song. htdemucs is the standard 4-stem hybrid transformer; htdemucs_ft runs four models and averages them - noticeably slower, slightly cleaner stems.
include_drumsBOOLEANtruePut the drum stem into beats_mix - the kick and snare ARE the pulse.
include_bassBOOLEANtruePut the bass stem into beats_mix - bass hits ride the kick on most masters.
include_vocalsBOOLEANfalsePut the vocal stem into beats_mix. Usually off: vocal energy in the low band is exactly what fakes beats on the full mix.
include_otherBOOLEANfalsePut the other stem (guitars, keys, synths, pads) into beats_mix. On for guitar-driven tracks whose rhythm lives outside the drums.

Outputs (6)

NameTypeDescription
beats_mixAUDIOThe selected stems summed - wire into H3 Sound Events / H3 Beat Grid instead of the full song, so beats are detected from the instruments that carry them.
vocalsAUDIOThe vocal stem - wire into the Music Video Writer's `vocals` (cleaner Whisper transcription) or H3 Masked Song Latent's voice gate.
drumsAUDIOThe drum stem.
bassAUDIOThe bass stem.
otherAUDIOEverything else - guitars, keys, synths, pads.
infoSTRINGModel, device, length and what went into beats_mix.