How to separate music stems with Demucs on a cloud GPU

Rent a GPU on Deploy, then open a terminal in JupyterLab or over SSH. Install Demucs from the adefossez/demucs README, which says this repository is the officially maintained Demucs, and run the documented CLI for 4-stem or 2-stem separation. Copy the separated folder off the instance before you destroy it. Destroying the instance deletes its disk.

Transcription pages: How to transcribe and diarize audio with WhisperX on a cloud GPU and How to transcribe audio with faster-whisper on a cloud GPU. Music generation from a different repository: How to run Stable Audio Open on a cloud GPU. If the process runs out of memory: How to fix CUDA out of memory on a cloud GPU.

Separate a recording you have the right to use. The README says the code is released under the MIT license in the LICENSE file. The copyright line in that file names an organization. This page does not print that name. The README says the license of the weights is not clear, that MusDB contains data that were only usable for research purpose, and that the author cannot grant a license for that data or for a second dataset the sentence names. It says the 6-source variant of htdemucs was trained only on an internal dataset, which likely means CC-NC-BY. Read the file before you redistribute the program or the weights.

The commands below are copied from the upstream files named in each step. They were not run on a CloudGPU instance for this page. Anything this page adds around them is marked.

A second Demucs repository returned archived true from the GitHub API on 2026-11-13. This page does not print that repository or its clone line. demucs/__init__.py on the default branch sets __version__ to 4.1.0. PyPI demucs the same day listed version 4.1.0.

What the README says about memory

The README memory section, read at commit 829d21890023800713e5dd231c67e43ecc06069b, says GPU acceleration needs at least 3GB of RAM for demucs, and about 7GB of RAM with the default arguments. It says to add --segment SEGMENT, with SEGMENT an integer number of seconds. It says a segment length of at least 10 is recommended, and that the bigger the number is, the more memory is required, but quality may increase. It says the Hybrid Transformer models only support a maximum segment length of 7.8 seconds. It says creating PYTORCH_NO_CUDA_MEMORY_CACHING=1 is also helpful, and to add -d cpu if that still does not help. It says if you only have 3GB memory, set SEGMENT to 8, though quality may be worse if this argument is too small. It says the same environment variable can help users with even smaller RAM such as 2GB, and in parentheses that the author separated a track that is 4 minutes but only 1.5GB is used, and that this would make the separation slower. That 4-minute sentence is the README’s description of one track. This page did not remeasure it. The same section says that with -d cpu, processing time should be roughly equal to 1.5 times the duration of the track. That sentence is also the README’s. This page did not remeasure it.

separate.py exits if --segment is greater than the model maximum. For an HTDemucs model that maximum is separator.model.segment. This page did not load the default checkpoint and does not print a number from that attribute. The README’s “set SEGMENT to 8” sentence and its “maximum segment length of 7.8 seconds” sentence are both in the file. This page does not pick one of them as a command for the default model.

The -j flag is described as multiplying RAM by the same amount. separate.py defaults --jobs to 0. The README example is uvx demucs -j 2 myfile.mp3. This page did not run it.

GET /v1/public/compute-capabilities does not list GPUs. It returns feature flags. The memory column is vram_gb from gpu-prices.json, updated_at 2026-11-13T05:11:23.012Z. GET /v1/public/gpu-catalog the same day (generated_at 2026-11-13T05:11:24.062Z) listed the same names and the same vram_gb values, plus Ascend 910B at 64, which is not in gpu-prices.json and is not listed here. The catalog response also includes an availability field. This page does not copy it. Every prices row has gpu_count 1. Every vram_gb in that file is 8 or higher. The README’s default-argument figure is about 7GB, and its lower figure for demucs is at least 3GB. This page did not run Demucs and does not mark a row as enough. Which listing you can start is on Deploy.

The catalog template list had no Demucs template.

Catalog name vram_gb
RTX 2080 8
RTX 3080 10
RTX 2080 Ti 11
RTX 3080 Ti 12
V100 16G 16
A30 24
RTX 3090 24
RTX 4090 24
RTX 4090D 24
RTX 4080 SUPER 32G 32
RTX 5090 32
RTX 5090D 32
V100 32G 32
A100 40G 40
A800 40G 40
A40 48
RTX 4090 48G 48
RTX 4090D 48G 48
RTX A6000 48
NVIDIA RTX PRO 5000 72G 72
RTX PRO 5000 72G 72
A100 80G 80
A800 80G 80
H800 80
RTX 6000D 83
H20 96G 96
RTX PRO 6000 96G 96
RTX PRO 6000 Max-Q 96
H20-3e 141G 141

Install

On Deploy, choose Raw GPU. The deploy page says “SSH access and root within a dedicated container”. The README says Linux users must read docs/linux.md before posting an issue. That file’s install example is:

curl -LsSf https://astral.sh/uv/install.sh | sh

docs/linux.md then prints uvx demucs PATH_TO_AUDIO_FILE_1 as the next command. The installer runs in a child process, so it does not change this shell’s PATH. It puts uv and uvx in $HOME/.local/bin and updates shell profiles for a later shell. This page adds the PATH line from How to install PyTorch with uv on a cloud GPU before the first uvx. That line is not in docs/linux.md. It was not run. Later uv and uvx lines in this section need that directory on PATH in the same shell:

# This page adds the PATH line. docs/linux.md does not print it.
export PATH="$HOME/.local/bin:$PATH"
uvx demucs PATH_TO_AUDIO_FILE_1

docs/linux.md says uv takes care of installing Python, and that on Linux the default PyTorch package comes with CUDA support, so an NVIDIA GPU with recent drivers is used automatically. Otherwise separation runs on CPU, and -d cpu forces that. It says ffmpeg is optional, for flac output and for formats that are not decoded natively, and gives sudo apt-get install ffmpeg as the example. The README requirements section says at least Python 3.10. pyproject.toml sets requires-python to >=3.10 and torch>=2.1 except on Intel macOS. The README permanent-install lines, after which demucs MY_TRACK.mp3 is the command it prints, are:

uv tool install demucs

The same paragraph says python3 -m pip install -U demucs works too. The bleeding-edge line in that file is uvx --from git+https://github.com/adefossez/demucs demucs MY_TRACK.mp3. This page did not install the package. The commits API for the default branch main listed 829d21890023800713e5dd231c67e43ecc06069b, committed 2026-10-26T11:50:46Z.

Model flags, 4-stem, and 2-stem

The separating-tracks section says you can run from any folder. Its 4-stem line, with the README’s placeholder paths, is:

uvx demucs PATH_TO_AUDIO_FILE_1

Replace uvx demucs with demucs if you installed it with uv tool install or pip. The README says separated tracks are stored in the separated/MODEL_NAME/TRACK_NAME folder, as four stereo wav files sampled at 44.1 kHz: drums.wav, bass.wav, other.wav, and vocals.wav. An --mp3 run writes .mp3 instead. separate.py defaults --out to separated and --filename to {track}/{stem}.{ext}, then joins them, so the path is separated/<model>/<track>/<stem>.<ext>. The default extension in that file is wav. --mp3-bitrate defaults to 320. --float32 and --int24 are the other depth flags the README names. --flac requires ffmpeg.

The same section’s 2-stem line is:

uvx demucs --two-stems=vocals myfile.mp3

The README says you can also set that flag to drums or bass, and later that vocals can be changed to any source in the selected model. It says this mixes the files after separating the mix fully, so this will not be faster or use less memory. separate.py stores the flag as stem. With the default --other-method add, it writes the selected stem and a file whose stem name is no_ plus that stem. This page did not run the command.

The model list in the README says htdemucs is the default model. demucs/pretrained.py sets DEFAULT_MODEL to htdemucs, and the -n / --name default is htdemucs. An earlier paragraph in the same README still says Hybrid Transformer Demucs is not activated by default and names -n htdemucs_ft. Both paragraphs are in the file at this commit. The code default is htdemucs. The list also names htdemucs_ft, htdemucs_6s (adds piano and guitar), hdemucs_mmi, mdx, mdx_extra, mdx_q, and mdx_extra_q. The README says the quantized models require the quantized extra, for example uvx "demucs[quantized]" -n mdx_q myfile.mp3. docs/release.md says pretrained models are hosted on the Hugging Face hub, that get_model looks up bag names there first, and that single signatures still come from the legacy remote repo. demucs/hf.py sets DEFAULT_NAMESPACE to adefossez. hf_repo_name maps htdemucs to HTDemucs, a name that starts with htdemucs_ to HTDemucs- plus the rest, and any other name to Demucs- plus the name. The model API for adefossez/HTDemucs on 2026-11-13 returned gated false and a top-level license field of null. pretrained.py also sets ROOT_URL to a host this page does not print. This page does not copy that URL.

The README opening reports an SDR of 9.00 dB on the MUSDB HQ test set, and 9.20 dB with the sparse-attention and fine-tuning sentence in that paragraph. Those figures are the README’s. This page did not remeasure them. htdemucs_ft is described as taking 4 times more time than htdemucs. That relative figure is the README’s comparison of the two model names. This page did not remeasure it.

Web UI and ComfyUI

The repository does not ship a local Gradio app. The README Web Demo section links a Hugging Face Space. This page does not add a tunnel for that Space. The Graphical Interface section names a Windows and macOS GUI and a second project whose link is an issue on the archived repository. This page does not copy that issue URL and does not add those installs.

The README does not link a ComfyUI install. The ComfyUI examples top-level directory list on 2026-11-13 had no directory named for this project. audio/README.md in that repository documents other audio models and does not name Demucs. Examples HEAD was f9431bb000ce792094ff345446e22cac1ea6cef3. This page does not add a ComfyUI install.

When it fails

CUDA out of memory. The README’s own flags are --segment, PYTORCH_NO_CUDA_MEMORY_CACHING=1, and -d cpu, quoted above. If the process still raises that error, use how to fix CUDA out of memory on a cloud GPU.

“CUDA error: no kernel image is available for execution on the device” on an RTX 5090. pyproject.toml sets torch>=2.1 and does not name compute capability 12.0. The RTX 5090 guide says that card is compute capability 12.0 (sm_120) and that PyTorch 2.7 and later, on a build for CUDA 12.8 or newer, is the line that announced support. This page did not install a torch wheel and did not re-test this package on an RTX 5090. Catalog RTX 5090 and RTX 5090D are 32. That is the catalog number only.

Save the stems, then destroy

Copy the separated directory before you destroy the instance. Save your work before you destroy a cloud GPU is the checklist. The terms say data on local instance storage is permanently deleted when the instance is destroyed.

The pricing page FAQ states the billing rule in these words:

Per-minute options have a 1-minute minimum; unused prepaid minutes are refunded when you destroy the instance. Some configurations use whole-hour billing with a 1-hour minimum; unused time within a charged hour is not refunded on voluntary stop. The billing period, minimum charge and initial prepayment are shown before confirmation. No subscription.

Prices are not copied here.

Frequently asked questions

How much GPU memory does the Demucs README print?

The memory section says GPU acceleration needs at least 3GB of RAM for demucs, and about 7GB of RAM with the default arguments. It says a segment length of at least 10 is recommended, and that Hybrid Transformer models only support a maximum segment length of 7.8 seconds. If you only have 3GB it says to set SEGMENT to 8. It also describes an environment variable and a 2GB case in which one track used 1.5GB. That 1.5GB sentence is in the README, and this page did not remeasure it. Every vram_gb in gpu-prices.json on 2026-11-13 is 8 or higher. This page does not mark a catalog row as enough. Which listing you can start is on https://cloudgpu.app/deploy.

Which commands separate 4 stems and 2 stems?

The model list says htdemucs is the default model and names drums, bass, other, and vocals. The command in the separating-tracks section is uvx demucs followed by the audio path. The 2-stem command in that section is uvx demucs --two-stems=vocals myfile.mp3. That paragraph says vocals can be changed to any source in the selected model, and that this mixes the files after separating the mix fully. separate.py writes the selected stem and, with the default other_method add, a file named no_ plus that stem. This page did not run either command.

Where does Demucs save the separated files?

The README says separated tracks are stored in the separated/MODEL_NAME/TRACK_NAME folder, as four stereo wav files at 44.1 kHz: drums.wav, bass.wav, other.wav, and vocals.wav, or mp3 if you passed --mp3. separate.py defaults --out to separated and --filename to {track}/{stem}.{ext}. This page did not run the command.

What license does the Demucs repository print?

The README says the code is released under the MIT license in the LICENSE file. The grant in that file includes the words free of charge. Those words are license text, not a CloudGPU price and not a storage allowance. The copyright line names an organization. This page does not print that name. The README says the license of the weights is not clear, that MusDB contains data that were only usable for research purpose, and that the author cannot grant a license for that data or for a second dataset the sentence names. It says the 6-source variant was trained only on an internal dataset, which likely means CC-NC-BY. The file prints no dollar amount.

Sources (read 2026-11-13, Asia/Shanghai)

  • adefossez/demucs README (maintained-repo sentence, 3GB and about 7GB, segment 10 and 7.8, SEGMENT 8, the 2GB parenthesis, -d cpu and 1.5 times duration, 4-stem and --two-stems, model list, 44.1 kHz output folder, SDR 9.00 and 9.20, MIT and the weights paragraph): https://github.com/adefossez/demucs/blob/main/README.md commit 829d21890023800713e5dd231c67e43ecc06069b. Repository HEAD is that commit, pushed date on the commits API 2026-10-26T11:50:46Z
  • docs/linux.md (uv install example, uvx demucs, CUDA wheel note, optional ffmpeg): commit eeac1d15891af95b1288d2884b95baa3e5baa96c
  • docs/release.md (v4.1.0, hub hosting, legacy fallback): commit 6a604bb002d12c4fbabb303ba64db40b5c5743f0
  • demucs/separate.py (--out separated, --filename, --two-stems, --jobs 0, --mp3-bitrate 320, segment fatal): commit ab872e10daf3316d3ee2f21fcd6f90a3cbd6216a
  • demucs/pretrained.py (DEFAULT_MODEL htdemucs, hub lookup, ROOT_URL not printed): same commit
  • demucs/hf.py (DEFAULT_NAMESPACE adefossez, hf_repo_name): same commit
  • pyproject.toml (requires-python >=3.10, torch>=2.1): commit 2883f3db65617d6d178c6ed10d869dc14e44e59b
  • LICENSE (MIT grant; copyright line not printed on this page): commit 3b8430c12242bbbba48769eed6da5190c6ff3c2d
  • demucs/__init__.py (__version__ 4.1.0) at HEAD 829d21890023800713e5dd231c67e43ecc06069b. PyPI demucs 4.1.0 on 2026-11-13
  • Model API adefossez/HTDemucs (gated false, top-level license null, sha cbc8a9b1a87023b7fd74e7b3412e6321c0eab003): https://huggingface.co/api/models/adefossez/HTDemucs read 2026-11-13
  • ComfyUI examples (no Demucs directory; audio/README.md does not name Demucs): https://github.com/comfyanonymous/ComfyUI_examples commit f9431bb000ce792094ff345446e22cac1ea6cef3
  • Public GPU memory: https://cloudgpu.app/gpu-prices.json (updated_at 2026-11-13T05:11:23.012Z) and https://cloudgpu.app/v1/public/gpu-catalog (generated_at 2026-11-13T05:11:24.062Z). GET /v1/public/compute-capabilities returned feature flags and no GPU list. The catalog had no Demucs template. The GitHub API for the other Demucs repository returned archived true. This page does not print that repository

Cards you can start are on the Deploy page. Prices are on https://cloudgpu.app/pricing and are not repeated here.

Last updated: 2026-11-13 (Asia/Shanghai).