Kokoro-7M-Distill ONNX
ONNX export of oddadmix/Kokoro-7M-Distill (7.48M params, Apache-2.0), a student distilled from hexgrad/Kokoro-82M. Built for in-browser inference with onnxruntime-web on WebGPU.
Demo: mrfakename/kokoro-7m-distill-webgpu
The graph uses the same I/O as onnx-community/Kokoro-82M-v1.0-ONNX, and the vocabulary is identical to Kokoro-82M, so Kokoro runtimes that take the 82M graph (e.g. a transformers.js StyleTextToSpeech2Model pipeline) can load this one too.
| input | shape | |
|---|---|---|
input_ids |
int64 [1, T] |
Kokoro token ids, padded with 0 at both ends (T ≤ 512) |
style |
float32 [1, 256] |
row T-3 (number of phonemes minus one) of a voice pack |
speed |
float32 [1] |
1.0 = normal |
Outputs: waveform (24 kHz float32), duration (frames per token).
Files
| file | size | notes |
|---|---|---|
onnx/model.onnx |
30.6 MB | fp32, recommended for both WebGPU and WASM |
onnx/model_quantized.onnx |
15.7 MB | dynamic int8 (MatMul/Gemm/Conv). Audibly noisier and slower on CPU than fp32 for this model, so the demo does not use it |
voices/af_msa.bin |
522 kB | float32 [510, 1, 256], the voice pack the student was distilled on (use this one) |
voices/af_heart.bin |
522 kB | Kokoro's af_heart; the student never saw it in training |
There is no fp16 file: the model is already 30 MB, and fp32 runs well past realtime on WebGPU.
Front-end
The model was trained on misaki phonemes (misaki.en.G2P, US English), the same as Kokoro-82M. Feeding raw espeak-ng output mispronounces diphthongs (misaki uses single-character A I O W Y). The demo Space ships a JavaScript port of misaki's lexicon path (misaki.js) with espeak-ng as the out-of-vocabulary fallback.
Export
export.py loads the original checkpoint through the vendored kokoro_patched package (disable_complex=True) and exports KModelForONNX with opset 17. The fp32 graph matches the PyTorch model in output length exactly; waveforms differ only by the random phase noise of the harmonic source.