Hysen Labs
Model or dataset
DakeQQ/Text-to-Speech-TTS-ONNX avatar
DakeQQ

Text-to-Speech-TTS-ONNX

Utilizes ONNX Runtime for TTS model.

69 stars6 forksPythonApache-2.0
DEEP OPEN-SOURCE ANALYSIS

Text-to-Speech-TTS-ONNX: running TTS models on ONNX Runtime

A Python project that exports, optimizes, and runs a wide range of speech synthesis and voice cloning models through ONNX Runtime.

What the project supports

Text-to-Speech-TTS-ONNX is a Python repository that focuses on running speech synthesis models on ONNX Runtime instead of framework specific runtimes. The README describes it as covering text to speech, voice cloning, voice design, and vocoding from a single toolkit. Each supported model family ships with three scripts: Export to convert the model into ONNX, Inference to run it, and Optimize to tune the result. The supported list is broad and spans several tasks. BigVGAN V2 acts as a neural vocoder that turns mel spectrograms into audio at 24 kHz. F5-TTS and the Raon-OpenTTS models handle voice cloning and require prompt audio, with the Raon models offered in 0.3B and 1B sizes. IndexTTS versions one through two point five add emotion control. FireRedTTS3, Qwen3-TTS, and VoxCPM cover cloning, continuation, and voice design with mode dependent prompt handling. Inflect and KaniTTS are text to speech models that need no reference audio. This range lets a user pick a model by language, sample rate, or whether a reference voice is available, and the shared model table in the README lists the audio input and output rate for each one. The unified Export, Inference, and Optimize trio means a contributor learns one pattern and can then apply it to any family in the list, which lowers the cost of experimenting with a new model. The unified export, inference, and optimize trio means a contributor learns one pattern and can then apply it to any family in the list, which lowers the cost of experimenting with a new model that interests them.

The audio contract and formats

The project defines a clear audio contract so exported models behave predictably. Input and output sample rates, together with the audio data type, are set per exporter through variables such as IN_SAMPLE_RATE, OUT_SAMPLE_RATE, IN_AUDIO_DTYPE, and OUT_AUDIO_DTYPE, while KaniTTS and BigVGAN expose output settings only. Audio tensors may use F16, F32, or INT16 precision, with floating point values kept in the minus one to one range and INT16 using PCM amplitude. Resampling happens inside the ONNX graph through torch interpolation, which keeps the sample rate conversion part of the model rather than a separate preprocessing step. A Metadata.onnx file stores the fixed package contract, and the inference script validates that metadata, the graph layout, and any referenced files before running. Streaming exporters must map each codec or latent frame to a whole number of output samples. Raon-OpenTTS is English only in this package and needs reference audio whose text matches the prompt, so the contract enforces a tight link between prompt and reference that prevents mismatched voice cloning attempts. By keeping the contract explicit and validated, the project avoids the silent failures that happen when a runtime guesses the wrong sample rate or data type for a given model. By keeping the contract explicit and validated, the project avoids the silent failures that happen when a runtime guesses the wrong sample rate or data type for a given model at load time.

Performance and how to run

The performance table gives real time factor numbers measured on Ubuntu 24.04 with a six second reference generating about fifteen words, so lower RTF means faster synthesis. On a CPU, IndexTTS finishes in eighteen seconds for an RTF of six, and KaniTTS with q4f32 reaches an RTF of 0.87, meaning it synthesizes faster than real time. GPU runs are far quicker: VoxCPM 1.5 on an RTX 5060 Ti with f16 posts an RTF of 0.17, and BigVGAN V2 on an older MX150 still clears an RTF of 1.53. The README notes that tests use a six second reference and generate roughly fifteen words unless stated otherwise, and that BigVGAN uses a specific mel input shape of one by one hundred by five hundred twelve. Getting started means cloning the repository and using the per model Export, Inference, and Optimize scripts, with native rate conversion handled by the exporter and mode dependent inputs configured in the inference script. The work is published under the Apache-2.0 license, and the shared performance table reports both CPU and GPU timings for direct comparison. The table also records the precision used for each run, so a reader can see the tradeoff between a quantized model and a full precision one on the same hardware. The table also records the precision used for each run, so a reader can see the tradeoff between a quantized model and a full precision one on the same hardware before committing to a setup.

Editorial conclusion

The repository is written in Python, carries the Apache-2.0 license, and reports an RTF of 0.17 for VoxCPM 1.5 on an RTX 5060 Ti GPU in its performance table.

DEEP OPEN-SOURCE ANALYSIS

Official sources

Community notes

Community notes