Nodes/ComfyUI_Demucs/Demucs_Loader
ComfyUI Node

Demucs_Loader

The quiet half of ComfyUI's stem splitter

By smthemex·Created 2 years ago·Updated 9 months ago· 12
Demucs_Loader
    • model
    d_modelhtdemucs
    overlap0.25
    shifts1
    splittrue

    Demucs_Loader is the unglamorous half of this pack, and it's easy to dismiss it as a formality. It does exactly one thing: loads a Demucs music-separation model into memory so its partner node, Demucs_Sampler, can actually split a song into stems. No model file to hunt down, no API key, no cloud service. The weights just appear on first run and everything after that is local.

    Demucs is Meta's music source separation model - the thing that takes a song and hands you back isolated bass, drums, other, and vocals. This loader is how you get that capability inside a ComfyUI graph, next to your image and video nodes. If you've ever wanted to feed a music video through AnimateDiff keyed to the beat, or extract a vocal track for karaoke-style audio work, this is the starting point.

    How it works

    Under the hood the loader builds a Separator from Demucs' own Python API. You give it a model name as a string, and it looks that name up against Demucs' registry of pretrained models, downloading the checkpoint from Meta's servers on first use into the torch hub cache. It's the same auto-download behavior you're used to from ComfyUI checkpoints, except there's no manual step - the node handles it.

    Device selection is automatic: CUDA if you have it, then MPS on Apple Silicon, then CPU as the fallback. On CPU, long tracks get slow fast, which is what the split toggle is for.

    The inputs that actually matter

    You only really need to touch three of the four inputs, and the loader has sensible defaults for all of them.

    • d_model - a free-form string, defaulting to htdemucs. That default is the right choice for almost everyone: it's the Hybrid Transformer model Demucs is famous for. You can also type other signatures like htdemucs_ft (finetuned on a bigger mix) or hdemucs_mmi, and the first use downloads them. Misspelled names just fail loudly, so there's no danger, only confusion.
    • shifts - how many random time-shifts get averaged. The default of 1 is one clean pass. Crank it to 2–4 and you buy a small quality bump (Demucs' docs say up to ~0.2 SDR) at several times the runtime. For a quick stem split, leave it alone.
    • split - chops the track into overlapping segments so a big song doesn't blow up your VRAM. Default on, and the sensible choice unless your track is short and your GPU is fat.
    • overlap - how much those split segments overlap (default 0.25). Slightly higher overlap smooths the seams between segments; it's a fine-tuning knob, not a fire-and-forget one.

    The one output

    The only output is model, a custom Demucs_MODEL type that wires straight into Demucs_Sampler's model input. That's the entire circuit: loader → sampler → audio out.

    Installing ComfyUI_Demucs

    ComfyUI Manager finds the pack if you search "ComfyUI_Demucs", or clone it by hand:

    cd ComfyUI/custom_nodes
    git clone https://github.com/smthemex/ComfyUI_Demucs.git
    

    Then, per the README:

    pip install -r requirements_minimal.txt
    

    The requirements list is small - einops, julius, lameenc, openunmix, torchaudio - but openunmix drags in a chunk of audio-science dependencies, so the install can feel heavier than a one-node pack deserves. Note the pack pins torchaudio>=0.8,<2.1, which matches a typical ComfyUI environment but is worth knowing about if you run bleeding-edge torch. Restart ComfyUI after installing.

    Troubleshooting

    The one thing that trips people is the first run: the loader has to reach dl.fbaipublicfiles.com to pull the model, so if it errors with a network or hub failure the first time, that's the cause - rerun once you're online, and the checkpoint will be cached from then on.

    Everything else you can hit in this pack shows up in the Sampler, not here. This node really is the easy part: pick a model name, leave the defaults alone, and wire the output one hop over. Do that and you've got a working stem splitter sitting inside ComfyUI.

    CategoryDemucs

    Inputs (4)

    NameTypeDefaultDescription
    d_modelSTRINGhtdemucs
    overlapFLOAT0.250.01–1
    shiftsINT11–4096
    splitBOOLEANtrue

    Outputs (1)

    NameTypeDescription
    modelDemucs_MODEL