All runners now include automatic model downloading from official UVR sources - just like the GUI!
List Available Models
# List all MDX-Net models
python mdx_headless_runner.py --list
# List only installed models
python mdx_headless_runner.py --list-installed
# List models not yet downloaded
python mdx_headless_runner.py --list-uninstalled
# Same for Demucs and VR
python demucs_headless_runner.py --list
python vr_headless_runner.py --list
Download Models
# Download a specific model (without running inference)
python mdx_headless_runner.py --download "UVR-MDX-NET Inst HQ 3"
python demucs_headless_runner.py --download "htdemucs_ft"
python vr_headless_runner.py --download "UVR-De-Echo-Normal by FoxJoy"
Auto-Download on Inference
# Just use the model name - it will download automatically if not installed!
python mdx_headless_runner.py -m "UVR-MDX-NET Inst HQ 3" -i "song.flac" -o "output/" --gpu
# Demucs models auto-download too
python demucs_headless_runner.py --model htdemucs_ft --input "song.flac" --output "output/" --gpu
Model Info & Fuzzy Matching
# Get detailed info about a model
python mdx_headless_runner.py --model-info "UVR-MDX-NET Inst HQ 3"
# Typo? Get suggestions!
python mdx_headless_runner.py --model-info "UVR-MDX Inst HQ"
# Output: Did you mean: UVR-MDX-NET Inst HQ 1, UVR-MDX-NET Inst HQ 2, ...
Features
Feature
Description
🌐 Official Registry
Syncs with UVR’s official model list
🔄 Resume Downloads
Interrupted downloads can be resumed
⏱️ Retry with Backoff
Automatic retry on network errors
💾 Disk Space Check
Pre-checks available space before download
🔍 Fuzzy Matching
Suggests similar model names on typos
✅ Integrity Check
Validates downloaded files
🛡️ Error Handling & GPU Fallback
All runners include robust error handling with automatic GPU-to-CPU fallback:
# If GPU runs out of memory, automatically falls back to CPU
python mdx_headless_runner.py -m "model.ckpt" -i "song.flac" -o "output/" --gpu
# Output on GPU error:
# ============================================================
# ERROR: GPU memory exhausted
# ============================================================
# Suggestion: Try: (1) Use --cpu flag, (2) Reduce --batch-size...
#
# Attempting to fall back to CPU mode...
Error Messages
Errors now include clear explanations and suggestions:
Before
After
FileNotFoundError
Audio file not found: song.wav
CUDA out of memory
GPU memory exhausted. Try: --cpu or reduce --batch-size
Model not found
Model 'xyz' not found. Did you mean: UVR-MDX-NET...?
📊 CLI Progress Display
All runners feature a professional CLI progress system with real-time feedback:
from mdx_headless_runner import run_mdx_headless
from demucs_headless_runner import run_demucs_headless
from vr_headless_runner import run_vr_headless
# MDX separation
run_mdx_headless(
model_path='model.ckpt',
audio_file='song.wav',
export_path='output',
use_gpu=True,
verbose=True # Print progress
)
# Output: output/song_(Vocals).wav, output/song_(Instrumental).wav
# Demucs separation (vocals only)
run_demucs_headless(
model_path='htdemucs',
audio_file='song.wav',
export_path='output',
use_gpu=True,
demucs_stems='Vocals', # or 'All Stems' for all
primary_only=True,
verbose=True
)
# Output: output/song_(Vocals).wav
# VR Architecture separation
run_vr_headless(
model_path='model.pth',
audio_file='song.wav',
export_path='output',
use_gpu=True,
window_size=512,
aggression_setting=5,
is_tta=False,
# For unknown models, provide params manually:
# user_vr_model_param='4band_v3',
# user_primary_stem='Vocals'
)
# Output: output/song_(Vocals).wav, output/song_(Instrumental).wav
💡 Note: Functions process audio and save to export_path. Check output directory for results.
🔍 Troubleshooting
❌ GPU not detected
# Check CUDA
python -c "import torch; print(torch.cuda.is_available())"
# Reinstall PyTorch with CUDA
pip uninstall torch torchvision torchaudio
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu124
❌ Model not found
Option 1: Use automatic download (recommended)
# List available models
python mdx_headless_runner.py --list
# Download the model
python mdx_headless_runner.py --download "UVR-MDX-NET Inst HQ 3"
# Or just use it - auto-downloads!
python mdx_headless_runner.py -m "UVR-MDX-NET Inst HQ 3" -i song.wav -o output/
Option 2: Manual download
Default locations:
MDX: ./models/MDX_Net_Models/
Demucs: ./models/Demucs_Models/v3_v4_repo/
VR: ./models/VR_Models/
❌ Network/Download errors
# Force refresh model registry
python model_downloader.py --sync
# Check network connectivity
python -c "import urllib.request; urllib.request.urlopen('https://github.com')"
The downloader includes:
Automatic retry (3 attempts with exponential backoff)
Resume interrupted downloads
Fallback to cached registry
❌ VR model hash not found
If your VR model isn’t in the database, provide parameters manually:
# List available params
python vr_headless_runner.py --list-params
# Specify param and primary stem
python vr_headless_runner.py -m "model.pth" -i "song.wav" -o "output/" \
--param 4band_v3 --primary-stem Vocals
Common params: 4band_v3, 4band_v2, 1band_sr44100_hl512, 3band_44100
评论