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.3.0.tar.gz (23.4 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.3.0-py3-none-any.whl (28.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: indextts_onnx-0.3.0.tar.gz
  • Upload date:
  • Size: 23.4 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.3.0.tar.gz
Algorithm Hash digest
SHA256 149bf141828e9f718ecd0f62e6367b05e6d0515cf83c7243adbbd6d82aff69c5
MD5 553f4334d440a4cef42b7020b7e20e56
BLAKE2b-256 210613c19175d47bbb251bb224468ecbebcd4cb76fa1e843d7bb7918c6bdecd7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: indextts_onnx-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 28.6 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.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e22a2aac5fd1d95aa1135249a34ac2865d986cacbbf300f4d40b114b15d00922
MD5 72384340398337bdab4bd110cb98df80
BLAKE2b-256 286b05334bbb0fa55aa46831290324d76bd3aa34ed68b26e6fbe40e98a9f312e

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