You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: expose --use_directml CLI flag (experimental) (#290)
* docs: design spec for exposing DirectML via CLI (experimental tier)
Contributor (Vageesha Gupta) reported DirectML support exists (PR #211)
but is unreachable from the CLI. Design: expose --use_directml as
explicit opt-in, add conditional discoverability hint, document as
experimental with an honest per-architecture status, ship a patch
release, and reply inviting validation of untested architectures.
* docs: implementation plan for DirectML CLI exposure + spec correction
Correct spec to drop remote-CLI scope: DirectML is local-only and the
remote separation servers run on CUDA/CPU, so plumbing use_directml
through audio_separator/remote/* would be dead config. Add 5-task TDD
plan (CLI flag, discoverability hint, README, version bump, reply draft).
* feat: expose --use_directml CLI flag (experimental)
Wire the existing Separator(use_directml=...) support (PR #211) to the
CLI, mirroring --use_autocast. Explicit opt-in only. Adds the fixture
key + a wiring test in test_cli.py.
* feat: hint that --use_directml is available when DML packages are installed
In the CPU-fallback path of setup_torch_device, if torch_directml or
onnxruntime-directml is installed but DirectML wasn't enabled, log a
one-line INFO hint pointing to --use_directml. Fires during
'audio-separator --env_info' on DirectML-capable machines.
* docs: add experimental DirectML (Windows AMD/Intel GPU) install section
New install section with the dml extra, --use_directml usage, env_info
confirmation line, and an honest per-architecture status matrix. Also
adds --use_directml to the ToC, the full CLI-options reference, and the
Separator class parameters list.
* chore: bump version to 0.44.3
* chore: drop internal planning docs from PR
Copy file name to clipboardExpand all lines: README.md
+32-1Lines changed: 32 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -27,6 +27,7 @@ The simplest (and probably most used) use case for this package is to separate a
27
27
-[🎮 Nvidia GPU with CUDA or 🧪 Google Colab](#-nvidia-gpu-with-cuda-or--google-colab)
28
28
-[ Apple Silicon, macOS Sonoma+ with M1 or newer CPU (CoreML acceleration)](#-apple-silicon-macos-sonoma-with-m1-or-newer-cpu-coreml-acceleration)
29
29
-[🐢 No hardware acceleration, CPU only](#-no-hardware-acceleration-cpu-only)
30
+
-[🪟 Windows AMD / Intel GPU with DirectML (experimental)](#-windows-amd--intel-gpu-with-directml-experimental)
30
31
-[🎥 FFmpeg dependency](#-ffmpeg-dependency)
31
32
-[GPU / CUDA specific installation steps with Pip](#gpu--cuda-specific-installation-steps-with-pip)
32
33
-[Multiple CUDA library versions may be needed](#multiple-cuda-library-versions-may-be-needed)
@@ -139,6 +140,34 @@ Docker:
139
140
beveradb/audio-separator
140
141
```
141
142
143
+
### 🪟 Windows AMD / Intel GPU with DirectML (experimental)
144
+
145
+
> **Experimental / community-supported.** DirectML acceleration was contributed by the community and is not tested in CI or by the maintainer (it requires Windows plus an AMD or Intel GPU). It is opt-in and will never affect CUDA, Apple Silicon, or CPU users.
146
+
147
+
Install with the `dml` extra:
148
+
```sh
149
+
pip install "audio-separator[dml]"
150
+
```
151
+
152
+
Then enable it explicitly with the `--use_directml` flag:
153
+
```sh
154
+
audio-separator path/to/audio.wav --use_directml
155
+
```
156
+
157
+
💬 If DirectML is configured correctly you should see this log message when running `audio-separator --env_info`:
158
+
`ONNXruntime has DmlExecutionProvider available, enabling acceleration`
159
+
160
+
**Model architecture status on DirectML:**
161
+
162
+
| Architecture | Model types | Status |
163
+
|---|---|---|
164
+
| MDX |`.onnx`| ✅ Confirmed working |
165
+
| MDXC (incl. the default `bs_roformer` model) |`.ckpt` / `.yaml`| ⚠️ Expected to work, community-untested |
166
+
| VR |`.pth`| ⚠️ Expected to work, community-untested |
167
+
| Demucs | — | ❓ Unverified |
168
+
169
+
If you test any of the untested architectures, please [open an issue](https://github.com/nomadkaraoke/python-audio-separator/issues) with your `--env_info` output and logs — reports are what move these from "untested" to "confirmed".
170
+
142
171
### 🎥 FFmpeg dependency
143
172
144
173
💬 To test if `audio-separator` has been successfully configured to use FFmpeg, run `audio-separator --env_info`. The log will show `FFmpeg installed`.
@@ -418,7 +447,7 @@ Presets are defined in `audio_separator/ensemble_presets.json` — contributions
--sample_rate SAMPLE_RATE Modify the sample rate of the output audio (default: 44100). Example: --sample_rate=44100
461
490
--use_soundfile Use soundfile to write audio output (default: False). Example: --use_soundfile
462
491
--use_autocast Use PyTorch autocast for faster inference (default: False). Do not use for CPU inference. Example: --use_autocast
492
+
--use_directml Use DirectML for hardware-accelerated inference on Windows AMD/Intel GPUs (experimental; requires the 'dml' extra). Example: --use_directml
463
493
--custom_output_names CUSTOM_OUTPUT_NAMES Custom names for all output files in JSON format (default: None). Example: --custom_output_names='{"Vocals": "vocals_output", "Drums": "drums_output"}'
464
494
465
495
MDX Architecture Parameters:
@@ -616,6 +646,7 @@ You can also rename specific stems:
616
646
- **`sample_rate`:** (Optional) Set the sample rate of the output audio. `Default: 44100`
617
647
- **`use_soundfile`:** (Optional) Use soundfile for output writing, can solve OOM issues, especially on longer audio.
618
648
- **`use_autocast`:** (Optional) Flag to use PyTorch autocast for faster inference. Do not use for CPU inference. `Default: False`
649
+
- **`use_directml`:** (Optional) Flag to use DirectML for hardware-accelerated inference on Windows AMD/Intel GPUs (experimental; requires the `dml` extra and only takes effect when CUDA and Apple Silicon MPS are unavailable). `Default: False`
Copy file name to clipboardExpand all lines: audio_separator/utils/cli.py
+3Lines changed: 3 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -61,6 +61,7 @@ def main():
61
61
sample_rate_help="Modify the sample rate of the output audio (default: %(default)s). Example: --sample_rate=44100"
62
62
use_soundfile_help="Use soundfile to write audio output (default: %(default)s). Example: --use_soundfile"
63
63
use_autocast_help="Use PyTorch autocast for faster inference (default: %(default)s). Do not use for CPU inference. Example: --use_autocast"
64
+
use_directml_help="Use DirectML for hardware-accelerated inference on Windows AMD/Intel GPUs (experimental; requires the 'dml' extra). Example: --use_directml"
64
65
chunk_duration_help="Split audio into chunks of this duration in seconds (default: %(default)s = no chunking). Useful for processing very long audio files on systems with limited memory. Recommended: 600 (10 minutes) for files >1 hour. Chunks are concatenated without overlap/crossfade. Example: --chunk_duration=600"
65
66
ensemble_algorithm_help="Algorithm to use for ensembling multiple models (default: avg_wave). Choices: avg_wave, median_wave, min_wave, max_wave, avg_fft, median_fft, min_fft, max_fft, uvr_max_spec, uvr_min_spec, ensemble_wav. Example: --ensemble_algorithm=uvr_max_spec"
66
67
ensemble_weights_help="Weights for ensembling multiple models (default: equal). Number of weights must match number of models. Example: --ensemble_weights 1.0 0.5"
0 commit comments