Skip to main content

ds2svc

Restore SVC models that have been disguised as OpenUTAU-compatible DiffSinger voicebanks, and run inference on the recovered model.

Some packed "DiffSinger" voicebanks in the wild are not DiffSinger at all — they are existing SVC models (RVC, DDSP-SVC) repackaged to run on a DiffSinger ONNX API. This harms the open community's trust and safety. ds2svc identifies such banks, extracts the genuine SVC model back out, and provides inference.

What it does

  1. Detect — load a voicebank ZIP, read its yaml manifest, and inspect the ONNX graph internals (not just config) to decide whether it is a legitimate DiffSinger bank or a disguised SVC model.
  2. Extract (in progress) — recover the SVC ONNX with clean inputs (cvec_units + f0).
  3. Infer (planned) — Streamlit WebUI + realtime inference.

Supported disguises:

Source Based on Disguise Genuine model recovered
UTAI RVC RVC packed as a "vocoder" (units[768], f0) → waveform
DDSP-SVS DDSP-SVC DDSP-SVC packed inside the "acoustic" model (units[768], f0, volume) → mel → pc-nsf-hifigan

Detection signatures

Detection trusts the ONNX graph, not the config (config fields are easy to fake, and unusual-but-legit banks exist):

  • UTAI / RVC — the payload graph contains a normalizing flow (net_g/flow) beside net_g/enc_p and an NSF decoder net_g/dec: the RVC SynthesizerTrn.
  • DDSP-SVS — the acoustic graph contains a real STFT op (legit DiffSinger acoustics have none) plus ddsp_model/unit2ctrl, istft_method, melext, and a backend_reflow ReFlow stage.
  • DSP ops alone (Sin/Cos/CumSum/RandomNormalLike) are not used — they also appear in genuine DiffSinger diffusion backbones.

Usage

pip install -e .[infer,realtime]
ds2svc detect path/to/bank.zip
ds2svc extract path/to/bank.zip --out artifacts/<id>
ds2svc infer artifacts/<id> --in vocal.wav --out converted.wav --f0 fcpe
ds2svc realtime artifacts/<id>

See MANUAL_DOWNLOADS.md for offline weight installation.

Status

  • Voicebank ZIP reader + manifest resolver (paths resolved relative to yaml)
  • ONNX graph probe + detection (RVC / DDSP-SVS / legit)
  • UTAI/RVC extraction — graph-surgery excision of the empty-index TopK chain, input rename mel→cvec_units. Output: (cvec_units[1,T,768], f0[1,T]) → waveform[1,N] at 44.1 kHz, net_g (encoder + flow + NSF decoder) preserved byte-for-byte.
  • DDSP-SVS extraction — bit-lossless weight-port into a rebuilt Unit2Wav (CombSubSuperFast + RectifiedFlow/LYNXNet2), re-exported as a single ONNX (cvec_units[1,T,768], f0[1,T], volume[1,T]) → mel[1,T,128] (ReFlow loop baked in). Pair with pc-nsf-hifigan for audio; the mel→wav stage can later be merged into this graph for a one-shot audio-output model.
  • Inference frontend — ContentVec (lengyue233/content-vec-best), f0 (fcpe/rmvpe), volume, pc-nsf-hifigan vocoder, and a unified load_model(ModelDir) → infer(audio, sr, key_shift, f0_method) that auto-selects RVC or DDSP path from ds2svc_meta.json.
  • Realtime GUI — FreeSimpleGUI + sounddevice stream with sliding buffer, SOLA crossfade, correlation-based overlap alignment, f0=fcpe default. ds2svc realtime <model_dir>.
  • Streamlit WebUI — drag-drop vocal WAV → convert → preview + download. Auto-caches model, persists output across re-renders. streamlit run ds2svc/webui/app.py
  • Manual download guide for offline weight placement, with per-file URLs and directory layout.

See PLAN.md for the full design.

Development

Tests reference private voicebanks by anonymized IDs. Copy tests/fixtures/local_banks.example.json → local_banks.json (gitignored) and point the IDs at your local archives, then:

pytest

License

MIT. This project is for community safety and lawful recovery of open or self-owned models. Respect the licenses of upstream RVC / DDSP-SVC / DiffSinger.

Metadata

Release files for ds2svc 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ds2svc 0.1.0
File Size Uploaded Provenance Actions
ds2svc-0.1.0.tar.gz 57.6 kB With provenance Details for ds2svc-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ds2svc 0.1.0
File Interpreter ABI Platform Actions
ds2svc-0.1.0-py3-none-any.whl Python 3 none any Details for ds2svc-0.1.0-py3-none-any.whl

Total release size: 119.4 kB

Release files / ds2svc-0.1.0.tar.gz

Download URL ds2svc-0.1.0.tar.gz
Size 57.6 kB
Tags Source
SHA-256 checksum
How to use checksums
17cefc6858879c55af0487f9ad20b675f9fe4fc0b459b162829b846c67df6512
BLAKE2b-256 checksum
How to use checksums
b2695ba73ae297fa09ad163ab6adc2e1c06ece7d1c2811ee00496d3c9a217182
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 Jun 16, 2026.

Transparency log

Release files / ds2svc-0.1.0-py3-none-any.whl

Download URL ds2svc-0.1.0-py3-none-any.whl
Size 61.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6e3e344ede6b6a31892346cbcb4df953a98f69555c1f139307bb6c91283eebaf
BLAKE2b-256 checksum
How to use checksums
ffa5fec14062c0c7d724f36aac9c315e742a321364d0992f4927f42d0625a348
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 Jun 16, 2026.

Transparency log

Security for ds2svc 0.1.0

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for ds2svc-0.1.0.tar.gz

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 Jun 16, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page