owensong's picture
Stage verified Inflect v2 release candidate and evaluation evidence
125985b verified
|
Raw
History Blame
1.03 kB

Python API

InflectTTS(model_dir, device="cpu")

Loads one released checkpoint and its configuration. Construct the engine once and reuse it for multiple utterances.

synthesize(text, *, speed=1.0, variation=0.667, seed=0)

Returns a mono numpy.float32 waveform at 24 kHz. Empty text raises ValueError. speed must be between 0.5 and 2.0; variation must be between 0.0 and 1.0. Long input is split at punctuation-aware boundaries, and each chunk uses seed + chunk_index.

save(text, output, **kwargs)

Synthesizes and writes a WAV file, creating parent directories as needed. It returns the output Path.

from inference import InflectTTS

tts = InflectTTS(".", device="cpu")
waveform = tts.synthesize("A compact model can still speak clearly.", seed=7)
tts.save("This is written directly to disk.", "out.wav", seed=7)

The API is intentionally small. It does not expose speaker cloning, streaming state, SSML, or language switching in the v2 launch package.