BS-RoFormer-Infer
Production-ready, inference-only toolkit for Band-Split RoPE Transformer audio source separation
BS-RoFormer-Infer provides a clean, lightweight API for running music source separation inference using Band-Split RoFormer models with automatic checkpoint management.
Features
- Inference Only: Lightweight package focused on production inference
- Auto-Download: the default model is fetched on first use and sha256-verified against recorded checksums
- CLI Tools:
bs-roformer-inferandbs-roformer-downloadcommands - Python API: Clean programmatic interface
- Model Registry: Easy model discovery with search and category filtering
Quick Start
Installation
# Using pip
pip install bs-roformer-infer
# Using UV (recommended)
uv pip install bs-roformer-infer
CLI Inference
# First run auto-downloads the recommended BS-RoFormer-SW model (~700 MB,
# sha256-verified) into ~/.cache/bs-roformer-infer/ -- no separate download step needed
bs-roformer-infer --input_folder ./songs --store_dir ./outputs
Every WAV inside input_folder produces separated stems (vocals, drums, bass, guitar, piano, other) plus *_instrumental.wav. Explicit --config_path/--model_path arguments still work and skip auto-resolution entirely.
Python API
from ml_collections import ConfigDict
import torch
import yaml
from bs_roformer import DEFAULT_MODEL, ensure_model_assets, get_model_from_config
from bs_roformer.inference import SafeLoaderWithTuple
# Resolves local copies, or downloads (sha256-verified) on first use
ckpt_path, config_path = ensure_model_assets(DEFAULT_MODEL)
with open(config_path) as f:
config = ConfigDict(yaml.load(f, Loader=SafeLoaderWithTuple))
model = get_model_from_config("bs_roformer", config)
model.load_state_dict(torch.load(ckpt_path, map_location="cpu"))
Model Weights
Where weights live
Downloads default to ~/.cache/bs-roformer-infer/<model-slug>/. The location is
configurable, resolved in this order:
- Explicit argument:
--models_dir(inference CLI),--output-dir(download CLI), orensure_model_assets(..., models_dir=...)(API) - The
BS_ROFORMER_MODELS_PATHenvironment variable - The default
~/.cache/bs-roformer-infer/
A relative ./models directory (the pre-0.1.4 default) is still searched as a
read fallback, so existing downloads keep working without re-fetching.
Auto-download
When bs-roformer-infer runs without --model_path/--config_path, the
requested registry model (default: BS-RoFormer-SW) is looked up in the
directories above and downloaded on first use. Downloads are verified against
the sha256 checksums recorded in src/bs_roformer/data/checksums.json; a
mismatch deletes the file and retries instead of keeping a corrupt checkpoint.
Manual download (offline / air-gapped)
The recommended BS-RoFormer-SW model needs one file (its config ships inside the package):
| File | URL | sha256 |
|---|---|---|
BS-Rofo-SW-Fixed.ckpt (699,412,152 bytes) |
https://huggingface.co/enerjazzer/BS-ROFO-SW-Fixed/resolve/main/BS-Rofo-SW-Fixed.ckpt | 24e7d35ee9c64415673d3fd33e06a67cac2c103c5df6267ba1576459c775916e |
Place it at
~/.cache/bs-roformer-infer/roformer-model-bs-roformer-sw-by-jarredou/BS-Rofo-SW-Fixed.ckpt
(or the equivalent path under your BS_ROFORMER_MODELS_PATH), and inference
will pick it up without network access.
The other 9 registry models (re-hosted 2026-07-12, see CHANGELOG for full provenance) download from these mirrors:
| Model | File | URL | sha256 |
|---|---|---|---|
| De-Reverb | deverb_bs_roformer_8_384dim_10depth.ckpt (361,499,604 bytes) |
https://huggingface.co/Politrees/UVR_resources/resolve/main/models/Roformer/BandSplit/deverb_bs_roformer_8_384dim_10depth.ckpt | 9c38653aaa5e49f2f7b84dd3be2b6b679e0cbea23978e6b48389ee6f0a914768 |
| De-Reverb (config) | deverb_bs_roformer_8_384dim_10depth_config.yaml (2,358 bytes) |
https://huggingface.co/anvuew/dereverb_bs_roformer/resolve/main/archive/deverb_bs_roformer_8_384dim_10depth.yaml (author's file — NOT Politrees' similarly-named copy, which silently uses the wrong stft_hop_length; see CHANGELOG) |
a87cf93b36b9a20d25a9cc4f78a2541ea0033988e7b6c38dcf0029e9290af816 |
| Chorus Male-Female by Sucial | model_chorus_bs_roformer_ep_267_sdr_24.1275.ckpt (527,121,477 bytes) |
https://huggingface.co/Politrees/UVR_resources/resolve/main/models/Roformer/BandSplit/model_chorus_bs_roformer_ep_267_sdr_24.1275.ckpt | 123c00786bdbc6bd462dddb35cd21fd6ae99ab8319f93f63a8abc1012e593d94 |
| Instrumental Resurrection by unwa | bs_roformer_instrumental_resurrection_unwa.ckpt (204,483,033 bytes) |
https://huggingface.co/Politrees/UVR_resources/resolve/main/models/Roformer/BandSplit/model_BandSplit-Roformer_Resurrection_Instrumental_by-Unwa.ckpt | 16311025a5133ae6411760ccfe9e3e66b31a01d9d8bec0a03fa7ec4bedac7a15 |
| Male-Female by aufr33 | bs_roformer_male_female_by_aufr33_sdr_7.2889.ckpt (527,119,779 bytes) |
https://huggingface.co/Politrees/UVR_resources/resolve/main/models/Roformer/BandSplit/bs_roformer_male_female_by_aufr33_sdr_7.2889.ckpt | 3cf11736d1b42a11ae55d8299316585921477dd2a671b24b663660846ca9861b |
| Vocals by Gabox | bs_roformer_vocals_gabox.ckpt (639,254,584 bytes) |
https://huggingface.co/Politrees/UVR_resources/resolve/main/models/Roformer/BandSplit/bs_roformer_voc_gabox.ckpt | 18d58efe5e949e70fab11b875329af6d06ef11ccc29574bfe943fb57cc827f38 |
| Vocals Resurrection by unwa | bs_roformer_vocals_resurrection_unwa.ckpt (204,510,749 bytes) |
https://huggingface.co/Politrees/UVR_resources/resolve/main/models/Roformer/BandSplit/model_BandSplit-Roformer_Resurrection_Vocals_by-Unwa.ckpt | 9dbfe5cb572e4ed32a15ec727d7bd06c8d7aba97509e6fda5bc008bb1e0b2dd5 |
| Vocals Revive by unwa | bs_roformer_vocals_revive_unwa.ckpt (639,326,600 bytes) |
https://huggingface.co/Politrees/UVR_resources/resolve/main/models/Roformer/BandSplit/bs_roformer_revive_by_unwa.ckpt | f1d7e4bfdfef07c6b2bc1d65283a7d03c3c38f8c7dbc8d729b785f93c8b8699a |
| Vocals Revive V2 by unwa | bs_roformer_vocals_revive_v2_unwa.ckpt (639,326,600 bytes) |
https://huggingface.co/Politrees/UVR_resources/resolve/main/models/Roformer/BandSplit/bs_roformer_revive_v2_by_unwa.ckpt | 58098850c882a7472dad39f99fb8040ce6eaafe671cfe9881d89aea276bbb5f5 |
| Vocals Revive V3e by unwa | bs_roformer_vocals_revive_v3e_unwa.ckpt (639,326,600 bytes) |
https://huggingface.co/Politrees/UVR_resources/resolve/main/models/Roformer/BandSplit/bs_roformer_revive_v3_by_unwa.ckpt (hosted there without the trailing "e" — same file) | 1b0751b9a15c591407c3b77f08eb4ad3005e42e96051f3f2b39760f1130c467b |
The Chorus/Male-Female-aufr33 config
(config_chorus_male_female_bs_roformer.yaml) and the three Revive
checkpoints' shared config (config_bs_roformer_vocals_revive_unwa.yaml) are
also fetched from Politrees/UVR_resources — see data/overrides.json for the
exact URLs and data/checksums.json for their hashes.
Download CLI (manual path)
# List available models
bs-roformer-download --list-models
# Download the recommended model into the cache dir
bs-roformer-download --model roformer-model-bs-roformer-sw-by-jarredou
# Download into a custom directory
bs-roformer-download --model roformer-model-bs-roformer-sw-by-jarredou --output-dir ./models
Note on download availability (re-audited 2026-07-12): all 10 registry models now have live download sources. The 9 that fell back to the dead upstream TRvlvr repository were re-hosted to Politrees/UVR_resources (with the De-Reverb config sourced from the author's anvuew/dereverb_bs_roformer repo instead — see CHANGELOG for why). Run
python tools/check_weights_liveness.py(needs network) to re-check.
Recommended Model
BS-RoFormer-SW (roformer-model-bs-roformer-sw-by-jarredou) by jarredou is the recommended default model for audio source separation. It supports 6-stem separation (vocals, drums, bass, guitar, piano, other) and provides excellent quality for production workflows.
from bs_roformer import DEFAULT_MODEL
print(DEFAULT_MODEL) # "roformer-model-bs-roformer-sw-by-jarredou"
Available Models
| Model | Category | Description |
|---|---|---|
roformer-model-bs-roformer-sw-by-jarredou |
multi-stem | Recommended - 6-stem separation (vocals, drums, bass, guitar, piano, other) |
roformer-model-bs-roformer-vocals-resurrection-by-unwa |
vocals | Vocals Resurrection by unwa |
roformer-model-bs-roformer-vocals-revive-v3e-by-unwa |
vocals | Vocals Revive V3e by unwa |
roformer-model-bs-roformer-vocals-revive-v2-by-unwa |
vocals | Vocals Revive V2 by unwa |
roformer-model-bs-roformer-vocals-revive-by-unwa |
vocals | Vocals Revive by unwa |
roformer-model-bs-roformer-vocals-by-gabox |
vocals | Vocals by Gabox |
roformer-model-bs-roformer-instrumental-resurrection-by-unwa |
instrumental | Instrumental Resurrection by unwa |
roformer-model-bs-roformer-de-reverb |
dereverb | De-reverberation model |
| ... | ... | See --list-models for full list |
Categories: multi-stem, vocals, instrumental, dereverb
As of the 2026-07-12 re-audit, all registry entries have a live download URL (see the availability note in Model Weights).
Registry Helpers
from bs_roformer import MODEL_REGISTRY
# List all categories
print(MODEL_REGISTRY.categories())
# List models by category
for model in MODEL_REGISTRY.list("vocals"):
print(model.name, model.checkpoint)
# Search models
results = MODEL_REGISTRY.search("unwa")
for m in results:
print(m.slug)
# Pretty-print all models
print(MODEL_REGISTRY.as_table())
Development Installation
# Clone repository
git clone https://github.com/openmirlab/bs-roformer-infer.git
cd bs-roformer-infer
# Install with UV
uv sync
# Install with pip
pip install -e ".[dev]"
Acknowledgments
This project builds upon the excellent work of several open-source projects:
- BS-RoFormer by Phil Wang (lucidrains) - Clean PyTorch implementation of the Band-Split RoPE Transformer architecture
- python-audio-separator by Andrew Beveridge (nomadkaraoke) - Pre-trained checkpoints and model configurations
- Original Research - Wei-Tsung Lu, Ju-Chiang Wang, Qiuqiang Kong, and Yun-Ning Hung for the Band-Split RoPE Transformer paper
License
MIT License - see LICENSE for details.
This project includes code and configurations adapted from:
- BS-RoFormer (MIT) - Phil Wang
- python-audio-separator (MIT) - Andrew Beveridge
Citation
If you use BS-RoFormer-Infer in your research, please cite the original paper:
@inproceedings{Lu2023MusicSS,
title = {Music Source Separation with Band-Split RoPE Transformer},
author = {Wei-Tsung Lu and Ju-Chiang Wang and Qiuqiang Kong and Yun-Ning Hung},
year = {2023},
url = {https://api.semanticscholar.org/CorpusID:261556702}
}
Support
For issues and questions:
- GitHub Issues: github.com/openmirlab/bs-roformer-infer/issues
Metadata
Release files for bs-roformer-infer 0.1.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| bs_roformer_infer-0.1.5.tar.gz | 25.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| bs_roformer_infer-0.1.5-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 56.9 kB
Release files / bs_roformer_infer-0.1.5.tar.gz
| Download URL | bs_roformer_infer-0.1.5.tar.gz |
|---|---|
| Size | 25.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8d17452d32a09dce2b8422f24b524b32481386e640c511462c0989515e4a6bc1
|
|
BLAKE2b-256 checksum How to use checksums |
cd34020ffe73323ed1ca452327df5863c5585cf43962b7230eac98dc541e75d3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 12, 2026.
Transparency logRelease files / bs_roformer_infer-0.1.5-py3-none-any.whl
| Download URL | bs_roformer_infer-0.1.5-py3-none-any.whl |
|---|---|
| Size | 31.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
46f3d5eb4b666a54adcb67524258c3cb6f96e185db97a3e1e1ef7efaea4e1848
|
|
BLAKE2b-256 checksum How to use checksums |
2654d4875883ce1a2b488aea4785e7182d2ba695bde7511ad85bfd05eab21337
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 12, 2026.
Transparency log