File size: 2,915 Bytes
7889fea
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
---
license: apache-2.0
language:
  - en
pipeline_tag: text-to-speech
tags:
  - coreml
  - tts
  - vits
  - apple-silicon
  - ane
base_model:
  - owensong/Inflect-Micro-v2
  - owensong/Inflect-Nano-v2
---

# Inflect v2 CoreML (Micro + Nano)

Fixed-shape CoreML conversion of [Inflect-Micro-v2](https://huggingface.co/owensong/Inflect-Micro-v2)
(9.36M params) and [Inflect-Nano-v2](https://huggingface.co/owensong/Inflect-Nano-v2) (3.97M params) —
ultra-tiny VITS-family end-to-end English TTS, 24 kHz mono, fp16.

Converted by [FluidInference](https://huggingface.co/FluidInference) (mobius);
conversion pipeline, parity checks, and benchmark harness live in the
`models/tts/inflect-v2/coreml/` directory of the mobius repo.

## Contents

```
micro/            9.4M params, ~19 MB fp16 total per graph set
  encoder.mlpackage             tokens+mask -> m_p, logs_p, logw   [t_text=512]
  synthesizer_f{256,384,512,640,768,896,1024,2048}.mlpackage
                                z_p+mask -> waveform  [bucket frames x 256 samples]
  upstream_config.json
nano/             4.0M params, ~8 MB fp16 per graph set (same layout)
symbols.json      keithito-style symbol table (178 symbols, add_blank interspersal)
LICENSE           Apache-2.0 (upstream)
```

## Inference pipeline

Two deterministic models with everything stochastic or dynamically shaped on the host:

1. espeak-ng `en-us` phonemization (with stress) → symbol ids → intersperse blanks (`pad_id=0`) → pad to 512.
2. `encoder`: → `m_p`, `logs_p`, `logw`.
3. Host: `w = ceil(exp(logw))/speed`; repeat-expand `m_p`/`logs_p` to `y_len` frames;
   `z_p = m_p + randn * exp(logs_p) * noise_scale` (default 0.667).
4. Pick the smallest synthesizer bucket ≥ `y_len`; zero-pad `z_p`, mask valid frames.
5. `synthesizer`: reverse coupling flow + HiFiGAN → waveform; trim to `y_len * 256` samples.

Buckets are fixed-shape for ANE compatibility; at 128-frame granularity padding
overhead is within ~5% of exact-shape synthesis.

## Benchmarks (M5 Pro, macOS 26.6, GPU, MiniMax-English 100 phrases)

| Variant | Synth p50 / p95 | Agg RTFx | WER* | CER* |
|---|---|---|---|---|
| Micro | 25.7 / 35.5 ms | 245× | 1.43% | 0.44% |
| Nano | 13.2 / 16.9 ms | 460× | 1.92% | 0.57% |

\* Parakeet TDT v3 roundtrip, same scoring path as the
[FluidAudio](https://github.com/FluidInference/FluidAudio) TTS benchmarks.
fp16 parity vs the PyTorch reference: audio correlation > 0.9999, predicted
durations bit-identical.

## Notes

- ANE: the synthesizer's waveform-rate tensors exceed the ANE width limit
  (W ≤ 65536) above the 256-frame bucket; f256 reaches 77% ANE residency,
  larger buckets run on GPU (which is faster at every size on M-series).
- English only, one voice per variant, no cloning. Sample rate 24 kHz.
- Upstream weights and frontend: Apache-2.0, © the Inflect authors. This repo
  redistributes converted weights under the same license.