1038lab

Kokoro-82M-zh-MLX is a fast, high-quality text-to-speech model optimized for Apple Silicon. Built on the official Kokoro architecture with native MLX inference — no GPU required on your Mac.

Features

🎙️ 103 Voices 55 Chinese Female (zf_*), 45 Chinese Male (zm_*), 3 English (af_*)
🚀 Apple Silicon Native Runs entirely on Metal GPU via MLX — up to 10× faster than CPU
🔊 High Quality Based on Kokoro v1.1-zh with 100+ hours of professional training data
📦 Zero Dependencies Single model.safetensors + voices/*.safetensors, ready to use

Quick Start

from mlx_audio.tts.generate import load_model

m = load_model("1038lab/Kokoro-82M-zh-MLX")

results = list(m.generate(
    text="今天天气很好,一起去公园散步吧。",
    voice="zf_001",
    speed=1.0,
    lang_code="z"
))
from mlx_audio.audio_io import write as audio_write
audio_write("output.wav", results[0].audio, 24000, format="wav")

Installation

pip install misaki[zh] phonemizer-fork espeakng-loader mlx-audio

Usage

Speech Generation

from mlx_audio.tts.generate import load_model
from mlx_audio.audio_io import write as audio_write

m = load_model("1038lab/Kokoro-82M-zh-MLX")

# Chinese TTS (lang_code="z")
results = list(m.generate(
    text="你好世界,这是一段中文测试。",
    voice="zm_009",       # male voice
    speed=1.0,
    lang_code="z"         # "z"=Chinese, "a"=English
))
audio_write("output.wav", results[0].audio, 24000, format="wav")

# English TTS
results = list(m.generate(
    text="Hello world!",
    voice="af_heart",
    speed=1.0
))
audio_write("output.wav", results[0].audio, 24000, format="wav")

Streaming

results = list(m.generate(text="A long text here...", voice="zf_001", lang_code="z", streaming=True))
for chunk in results:
    if chunk.audio is not None:
        print(f"Chunk {chunk.segment_idx}: {len(chunk.audio)} samples")

Available Voices

Voice Prefix Type Count
zf_ Chinese Female 55
zm_ Chinese Male 45
af_ / bf_ English 3

Parameters

Parameter Description Default
text Input text required
voice Voice identifier "zf_001"
speed Speed multiplier 1.0
lang_code Language ("z"=Chinese, "a"=English) auto-detect
streaming Enable streaming output False

Performance

Benchmarked on M-series MacBook Pro:

Task RTF Latency
zh zf_001, 5s text ~0.07× ~2.4s for 5s audio
en af_heart, 3s text ~0.85× ~2.5s for 3s audio

Lower RTF = faster. RTF < 1.0 means faster than real-time.

Audio Samples

Click any audio below to hear the voice quality:

Voice ID Demo Text Audio
zf_001 (Chinese Female) 我现在正在使用最新的语音合成技术...
zm_009 (Chinese Male) 我现在正在使用最新的语音合成技术测试男声效果...
af_heart (English) Hello! This is Heart speaking...

See samples/index.html for a full interactive voice index with all 15 demo voices.

License

This model is released under the Apache 2.0 License. The underlying model architecture is from hexgrad/Kokoro. The voice embeddings are converted from the official kokoro-v1.1-zh models.

Acknowledgements


1038lab

Kokoro-82M-zh-MLX 是一个专为 Apple Silicon (M1/M2/M3/M4) 优化的开源语音合成模型。基于原生 MLX 架构实现,无需额外 GPU 即可在 Mac 上快速运行。

功能特点

🎙️ 103 个声音 55 个中文女声 (zf_*)、45 个中文男声 (zm_*)、3 个英文 (af_*, bf_*)
🚀 Apple Silicon 原生加速 完全支持 Metal GPU — 比 CPU 快 10 倍以上
🔊 高质量语音 基于 Kokoro v1.1-zh,100+ 小时专业训练数据
📦 开箱即用 model.safetensors + voices/*.safetensors,无需复杂配置

快速开始

from mlx_audio.tts.generate import load_model

m = load_model("1038lab/Kokoro-82M-zh-MLX")

results = list(m.generate(
    text="今天天气很好,一起去公园散步吧。",
    voice="zf_001",
    speed=1.0,
    lang_code="z"
))
from mlx_audio.audio_io import write as audio_write
audio_write("output.wav", results[0].audio, 24000, format="wav")

安装依赖

pip install misaki[zh] phonemizer-fork espeakng-loader mlx-audio

使用说明

语音合成

from mlx_audio.tts.generate import load_model
from mlx_audio.audio_io import write as audio_write

m = load_model("1038lab/Kokoro-82M-zh-MLX")

# 中文发音
results = list(m.generate(
    text="你好世界,这是一段中文测试。",
    voice="zm_009",       # 男声
    speed=1.0,
    lang_code="z"         # 语言代码:"z"=中文, "a"=英文
))
audio_write("output.wav", results[0].audio, 24000, format="wav")

# 英文发音
results = list(m.generate(
    text="Hello world!",
    voice="af_heart",
    speed=1.0
))
audio_write("output.wav", results[0].audio, 24000, format="wav")

流式输出

results = list(m.generate(text="这是一段长文本...", voice="zf_001", lang_code="z", streaming=True))
for chunk in results:
    if chunk.audio is not None:
        print(f"音频块 {chunk.segment_idx}: {len(chunk.audio)} samples")

可用声音

声音前缀 类型 数量
zf_ 中文女声 55
zm_ 中文男声 45
af_ / bf_ English 3

参数说明

参数 描述 默认值
text 要转换的文本 必填
voice 声音标识符 "zf_001"
speed 语速倍率 1.0
lang_code 语言 ("z"=中文, "a"=英文) 自动检测
streaming 是否启用流式输出 False

性能表现

在 M 系列 MacBook Pro 上的实测结果:

任务 RTF 耗时
中文 zf_001,5s 文本 ~0.07× ~2.4s 生成 5s 音频
英文 af_heart,3s 文本 ~0.85× ~2.5s 生成 3s 音频

RTF 越小越快。RTF < 1.0 表示比实时更快。

示例音频

点击查看各个声音的演示音频:samples/index.html

声音 ID 示范文本 试听
zf_001 (中文女声) 我现在正在使用最新的语音合成技术...
zm_009 (中文男声) 我现在正在使用最新的语音合成技术测试男声效果...
af_heart (English) Hello! This is Heart speaking...

许可证

本项目基于 Apache 2.0 License 发布。底层模型架构来自 hexgrad/Kokoro。声音嵌入文件由官方 kokoro-v1.1-zh 模型转换而来。

致谢

Downloads last month
200
Safetensors
Model size
81.8M params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support