Mel-Band RoFormer
Split a song into vocals and backing track inside ComfyUI, no DAW required
- audio
- vocals
- instruments
Mel-Band RoFormer is a stem splitter. Feed it a track, get two audio outputs: vocals and instruments. That's the whole node. No prompt, no sampler, no seed.
Which sounds almost too boring to install a custom pack for - until you're doing audio-driven video. If you want a character to lip-sync to a song, the model needs the voice, not drums competing with it. Strip the vocal out first and your sync gets dramatically less confused; keep the instrumental separately and you can lay it back under the finished clip. Same trick drives audio-reactive motion work, where people have been hand-rolling Hybrid Demucs in ComfyUI for years to push keyframe transitions off a stem. This node makes the split a single box instead of a loader-plus-sampler subgraph.
What's actually going on in there
RoFormer-based splitters are spectrogram maskers: the audio gets STFT'd, a transformer with rotary positional embeddings estimates a mask over the time-frequency plane saying "this bin is voice", and the inverse transform reconstructs the signal. Mel-band variants group the frequency axis into mel-spaced bands so attention works on musically sensible chunks rather than raw bins.
Princepainter didn't write the model. The vendored code in melband_model/ is lifted from kijai's ComfyUI-MelBandRoFormer (commit 7b12f8c), the port the LTX-2 lip-sync crowd was already using to process an external MP3. The contribution here is the wrapper: one node doing the load and inference together, config pinned to the vocal-separation architecture (stereo, single target stem, 44.1 kHz, 60 mel bands).
One consequence worth internalising: the model only ever predicts one stem. instruments isn't a second pass, it's original - vocals, subtracted in the code. If separation is imperfect the bleed shows up in both outputs, and the backing track carries faint vocal ghosts the vocal track left behind.
Inference is chunked at 352800 samples with 50% overlap and a faded window stitched back together, so a long track is many passes, not one. The model goes onto the GPU for the run and back to the offload device afterwards, so it doesn't squat on your VRAM, and it caches by filename so the second run in a session skips the disk load.
The two inputs
audio is the AUDIO type - whatever your loader hands you, native LoadAudio or the pack's own PainterAudioUpload. Mono input gets duplicated to stereo automatically, and anything that isn't 44.1 kHz is resampled on the way in - both announce themselves with a line in the console, so if the separation looks off, that log is the first place to check what the node actually received.
model_name is a dropdown over ComfyUI/models/diffusion_models - a strange home for an audio model, but that's where the loader looks, and the tooltip says so. The list shows every .safetensors in there, so it's full of Flux and Wan checkpoints you should not pick.
Outputs are vocals and instruments, both AUDIO, both at 44100 Hz regardless of what you fed in. Wire vocals into whatever audio-driven video or lip-sync node you're using; wire either into a video combine node if you want the audio muxed onto the result.
Install
Via Manager, search PainterNodes. Manually:
cd ComfyUI/custom_nodes
git clone https://github.com/princepainter/ComfyUI-PainterNodes
cd ComfyUI-PainterNodes
pip install -r requirements.txt
Then restart. requirements.txt is only soundfile and numpy, both already shipped with ComfyUI - the real dependency of this node is rotary_embedding_torch plus einops, imported by the vendored model. einops comes with ComfyUI; rotary_embedding_torch often doesn't, so if the node doesn't appear:
pip install rotary_embedding_torch einops
Then grab a checkpoint. The one that circulates with these workflows is MelBandRoformer_fp32.safetensors from Kijai's MelBandRoformer_comfy repo on Hugging Face. Drop it in ComfyUI/models/diffusion_models/ and hit refresh in the ComfyUI menu (or just restart) so the dropdown sees it.
Where people get burned
The node silently doesn't exist. The pack's __init__.py wraps every module import in a try/except and just prints [PainterNodes] Failed to import PainterMelBandRoFormer: .... So a missing rotary_embedding_torch doesn't crash ComfyUI, it just removes the node from the menu while the rest of the pack keeps working. Check the console output when you restart - that line names the missing module.
Wrong checkpoint, ugly error. The loader uses a strict state-dict load against the pinned config. A BS-RoFormer file, a karaoke variant with different band counts, or a .ckpt packed with extra training state will throw a mismatch instead of quietly working. This node is for single-target vocal mel-band models, not every RoFormer on the internet.
Empty dropdown. The model is in models/checkpoints or models/audio because that felt logical. It isn't looking there.
It's not instant. A four-minute song is roughly sixty overlapping chunk passes - order of minutes on a mid-range card, not seconds. Test on thirty seconds before running an album.
Batches. Only the first audio in a batch is processed. Split tracks one at a time.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| audio | AUDIO | — | |
| model_name | COMBO | Mel-Band RoFormer 模型 (.safetensors),位于 ComfyUI/models/diffusion_models 目录 |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| vocals | AUDIO | — |
| instruments | AUDIO | — |