Downloads · 30 days
114
15% of all-time downloads
FluidInference/supertonic-3-coreml
supertonic-3-coreml is a text-to-speech model from FluidInference. Use it when you need text read aloud. It is set up for coreml. The card lists the license as openrail++.
Downloads · 30 days
114
15% of all-time downloads
All-time downloads
740
Public
Repo size
781 MB
Likes
8
Public
Click a slice to open those files.
.bin1.7 GB · 99%
From the Hugging Face model README
On‑device multilingual TTS model converted to Core ML for Apple platforms. This is a hand‑port of Supertone Supertonic‑3 v1.7.3 from ONNX → PyTorch → Core ML, suitable for FluidAudio's TTS pipeline on macOS/iOS. 31 languages, 44.1 kHz output, flow‑matching diffusion with classifier‑free guidance (8 denoising steps).
The conversion script is here: https://github.com/FluidInference/mobius/tree/main/models/tts/supertonic-3/coreml
And the FluidAudio integration is here: https://github.com/FluidInference/FluidAudio/tree/main/Sources/FluidAudio/TTS/Supertonic3
text_encoder — token embeddings → contextual text features [B, 256, T].duration_predictor — predicts utterance duration from text features.vector_estimator — flow‑matching diffusion in latent space
(8 steps, classifier‑free guidance via batch‑2 duplication, ConvNeXt + cross‑attention to text + style attention).vocoder — ConvNeXt decoder → 44.1 kHz waveform.English, Korean, Japanese, Arabic, Bulgarian, Czech, Danish, German, Greek, Spanish, Estonian, Finnish, French, Hindi, Croatian, Hungarian, Indonesian, Italian, Lithuanian, Latvian, Dutch, Polish, Portuguese, Romanian, Russian, Slovak, Slovenian, Swedish, Turkish, Ukrainian, Vietnamese.
| Module | Size | Predict | Compute placement |
|---|---|---|---|
| duration_predictor | 1.8 MB | 0.82 ms | CPU (tiny) |
| text_encoder | 17 MB | 2.15 ms | 62 % ANE |
| vocoder | 48 MB | 1.17 ms | 100 % ANE |
| vector_estimator (fp16) | 122 MB | 9.29 ms | CPU + GPU (see notes) |
| vector_estimator (int8) | 62 MB | ~same | int8 weight-only / fp16 acts; ~10 % lower peak RSS, RMSE ≈ 0.016 vs FP16 |
End‑to‑end on M2: ≈ 0.74 s to synthesize 6.32 s of audio for a single English sentence (RTFx ≈ 8.5×), 8 denoising steps. Output verified against FluidAudio Parakeet TDT ASR.
Note on vector_estimator: 100 % of its ops are ANE‑eligible after
the float‑mask + precompute refactor, but Apple's ANECCompile currently
returns opaque error 11 on this graph and silently falls back to CPU/GPU.
See coreml/trials.md in the conversion repo for the full investigation.
Both .mlpackage (Core ML source bundle, includes weights + spec) and the
precompiled .mlmodelc (ready for direct MLModel(contentsOf:) load) are
shipped — use .mlmodelc to skip the on‑device compile step on first load.
TextEncoder.mlpackage / TextEncoder.mlmodelc — fixed T=128 text input.DurationPredictor.mlpackage / DurationPredictor.mlmodelc — fixed T=128 text input.VectorEstimator.mlpackage / VectorEstimator.mlmodelc — latent.L and text.T as RangeDim(17..512), FP16 weights (122 MB).VectorEstimator_int8.mlpackage / VectorEstimator_int8.mlmodelc — same model, int8 weight-only (per-channel symmetric) + FP16 activations (62 MB; ~10 % lower peak RSS, RMSE ≈ 0.016 vs FP16).Vocoder.mlpackage / Vocoder.mlmodelc — latent.L_ttl as RangeDim(4..512).tts.json — token / text frontend configuration.unicode_indexer.json — Unicode → token id mapping (multilingual frontend).voice_styles/ — 10 voice style embeddings, one JSON per voice (F1-F5 female, M1-M5 male). See Voices.manifest.json — file inventory (sha256 + sizes) for both .mlpackage and .mlmodelc.infer.py — minimal self-contained Python demo (loads .mlmodelc / .mlpackage directly).requirements.txt — Python deps for infer.py (coremltools, numpy, soundfile).10 zero-shot voice styles ship under voice_styles/, one JSON per voice. Pick
the path of the one you want at synthesis time (--voice-style in infer.py,
or Supertonic3VoiceStyle.load(from:) in Swift). They are caller-supplied, so
there is no separate selection step in the model itself.
| Voice | Gender | File |
|---|---|---|
| F1 | Female | voice_styles/F1.json |
| F2 | Female | voice_styles/F2.json |
| F3 | Female | voice_styles/F3.json |
| F4 | Female | voice_styles/F4.json |
| F5 | Female | voice_styles/F5.json |
| M1 | Male | voice_styles/M1.json |
| M2 | Male | voice_styles/M2.json |
| M3 | Male | voice_styles/M3.json |
| M4 | Male | voice_styles/M4.json |
| M5 | Male | voice_styles/M5.json |
All 10 are the upstream Supertonic-3 reference styles, copied verbatim from Supertone/supertonic-3.
10 zero-shot voice styles ship under voice_styles/, one JSON per voice. Pick
the path of the one you want at synthesis time (--voice-style in infer.py,
or Supertonic3VoiceStyle.load(from:) in Swift). They are caller-supplied, so
there is no separate selection step in the model itself.
| Voice | Gender | File |
|---|---|---|
| F1 | Female | voice_styles/F1.json |
| F2 | Female | voice_styles/F2.json |
| F3 | Female | voice_styles/F3.json |
| F4 | Female | voice_styles/F4.json |
| F5 | Female | voice_styles/F5.json |
| M1 | Male | voice_styles/M1.json |
| M2 | Male | voice_styles/M2.json |
| M3 | Male | voice_styles/M3.json |
| M4 | Male | voice_styles/M4.json |
| M5 | Male | voice_styles/M5.json |
All 10 are the upstream Supertonic-3 reference styles, copied verbatim from Supertone/supertonic-3.
For the curious / for sanity checking, this repo ships a small self‑contained
script infer.py that loads all four modules directly via coremltools and
writes a 44.1 kHz WAV. No external repo clone required.
# 1. Download the repo (e.g. via huggingface_hub or `git lfs clone`).
git lfs clone https://huggingface.co/FluidInference/supertonic-3-coreml
cd supertonic-3-coreml
# 2. Install the 3 deps (macOS, Python 3.11+ recommended).
python -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
# 3. Synthesize.
python infer.py "Hello, world." --voice-style voice_styles/M1.json -o hello.wav
python infer.py "Bonjour le monde." --lang fr --voice-style voice_styles/M1.json -o fr.wav
# Use the int8-quantized VectorEstimator (62 MB instead of 122 MB).
python infer.py "Hello, int8 build." --vector-estimator VectorEstimator_int8.mlpackage -o int8.wav
# Optional: pick a compute unit explicitly.
python infer.py "Test" --compute-units CPU_AND_NE -o ne.wav
The Python script loads .mlpackage (which is what coremltools accepts);
the .mlmodelc bundles are for direct Swift / Objective‑C use
(MLModel(contentsOf:)) where they skip the on‑device compile step.
For production use, the FluidAudio Swift framework handles model loading, text frontend, batching, chunking, and the diffusion / vocoder loop.
import AVFoundation
import FluidAudio
Task {
// Download and load Supertonic-3 models (first run only)
let models = try await Supertonic3Models.downloadAndLoad()
// Initialize the TTS manager
let tts = Supertonic3Manager(config: .default)
try await tts.initialize(models: models)
// Synthesize speech for some text with a voice style
let style = try VoiceStyle.load(path: "voice_styles/M1.json")
let audio = try await tts.synthesize(text: "Hello, world.", style: style)
// audio.samples is 44.1 kHz Float32 PCM in [-1, 1]
try AudioWriter.writeWav(audio.samples, sampleRate: 44_100, to: "hello.wav")
tts.cleanup()
}
For more examples (including CLI usage and benchmarking), see the FluidAudio repository: https://github.com/FluidInference/FluidAudio
vector_estimator currently runs on CPU + GPU instead of ANE due to an
Apple‑side ANE compiler limitation (see Performance).T=128 token windows; longer text
must be segmented by the caller.OpenRAIL‑M (inherited from upstream Supertone/supertonic-3). The Core ML conversion tooling and FluidAudio integration are MIT‑licensed. See the FluidAudio repository for details and usage guidance.