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.1.0.tar.gz (23.0 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.1.0-py3-none-any.whl (28.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: indextts_onnx-0.1.0.tar.gz
  • Upload date:
  • Size: 23.0 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.1.0.tar.gz
Algorithm Hash digest
SHA256 02a92850fb6e39b3398c56de73cd31abc6f20867f3d0036a8fcffc1cfd5217d4
MD5 39f3ac1f7c577030ad7dda70a325d78f
BLAKE2b-256 ec2aa6630efb3e7b9f32b9f9bbd535b4bf3bfc6c18728d9930e49d4a3a6e08b0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: indextts_onnx-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 28.1 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.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2dfcf1ba3ebe8e32fb550f5d1688a27f02138ce752c4563e1426c1d4c58bdd85
MD5 1d7c8724e91e82770a635c41c44281fd
BLAKE2b-256 f605cbd6ebfe4f43168d387342740704f0b2263123a6c0223074c01c817baee4

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