Skip to main content

Restore SVC models disguised as OpenUTAU/DiffSinger voicebanks

Project description

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 melcvec_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.jsonlocal_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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ds2svc-0.1.0.tar.gz (57.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ds2svc-0.1.0-py3-none-any.whl (61.8 kB view details)

Uploaded Python 3

File details

Details for the file ds2svc-0.1.0.tar.gz.

File metadata

  • Download URL: ds2svc-0.1.0.tar.gz
  • Upload date:
  • Size: 57.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ds2svc-0.1.0.tar.gz
Algorithm Hash digest
SHA256 17cefc6858879c55af0487f9ad20b675f9fe4fc0b459b162829b846c67df6512
MD5 e837ea8836ba687e9f1f53efe0d31ef9
BLAKE2b-256 b2695ba73ae297fa09ad163ab6adc2e1c06ece7d1c2811ee00496d3c9a217182

See more details on using hashes here.

Provenance

The following attestation bundles were made for ds2svc-0.1.0.tar.gz:

Publisher: python-publish.yml on KakaruHayate/ds2svc

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ds2svc-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: ds2svc-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 61.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ds2svc-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6e3e344ede6b6a31892346cbcb4df953a98f69555c1f139307bb6c91283eebaf
MD5 58353720c2ff07a3b3bcc8ec706d8ee3
BLAKE2b-256 ffa5fec14062c0c7d724f36aac9c315e742a321364d0992f4927f42d0625a348

See more details on using hashes here.

Provenance

The following attestation bundles were made for ds2svc-0.1.0-py3-none-any.whl:

Publisher: python-publish.yml on KakaruHayate/ds2svc

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page