Skip to main content

IndexTTS2 voice cloning via ONNX Runtime — no PyTorch at inference time

Project description

indextts-onnx

IndexTTS2 voice cloning via ONNX Runtime. No PyTorch at inference time.

Models are automatically downloaded from HuggingFace on first use.

One-liner

uvx indextts-onnx --ref-audio reference.wav --text "你好,欢迎使用语音克隆系统。" --output output.wav

Python API

from indextts_onnx import IndexTTSInfer

tts = IndexTTSInfer("~/.cache/indextts-onnx/models")
tts.infer("reference.wav", "你好,欢迎使用语音克隆系统。", "output.wav")

Install

pip install indextts-onnx

CLI

indextts-onnx --ref-audio ref.wav --text "Your text" --output out.wav

Options:

  • --model-dir: Custom model directory (default: auto-download to ~/.cache/indextts-onnx/models)
  • --threads: CPU threads (default: auto)

Architecture

IndexTTS2 inference involves 10 ONNX models. This package runs them with ONNX Runtime + numpy, eliminating the PyTorch runtime dependency (~3.3GB total):

Model Format Size Purpose
wav2vec2bert int8 396M Semantic feature extraction
semantic_codec int8 22M Quantize semantic embeddings
campplus int8 8M Speaker style embedding
gpt2_init int8 837M First autoregressive step
gpt2_step int8 476M Per-token generation step
gpt2_forward int8 826M Forward pass for latent
s2mel_ref int8 4M Reference length regulation
s2mel_gen int8 4M Generation preprocessing
dit_step fp32 363M DiT flow matching step
bigvgan fp32 429M Neural vocoder

GPT2 models use int8 quantization (3x faster). DiT and BigVGAN stay fp32 (int8 degrades quality for flow matching).

License

MIT

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

indextts_onnx-0.2.0.tar.gz (23.2 kB view details)

Uploaded Source

Built Distribution

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

indextts_onnx-0.2.0-py3-none-any.whl (28.4 kB view details)

Uploaded Python 3

File details

Details for the file indextts_onnx-0.2.0.tar.gz.

File metadata

  • Download URL: indextts_onnx-0.2.0.tar.gz
  • Upload date:
  • Size: 23.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for indextts_onnx-0.2.0.tar.gz
Algorithm Hash digest
SHA256 8f0db3aab8c89011ea0a7af5d3b143dda545f6e26a2bf5a5dfb14abebbdfeb40
MD5 908f47da6e1107bccc0064ad08f8de70
BLAKE2b-256 ccc77745faf2badf1503a94a7263a90b6fe46dd4f39fa589bee912fb6f4653de

See more details on using hashes here.

File details

Details for the file indextts_onnx-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: indextts_onnx-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 28.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for indextts_onnx-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7b01545582c6af39f868816b5772c106b40052855a7a7f068780f96f31bcb45e
MD5 5b9b1481dcfe4a22d651712de1fda629
BLAKE2b-256 496bcc14d4d0bacf76533641be464dfc2bea1d811a934d3993b46a8dab1d5d14

See more details on using hashes here.

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