Skip to content

Add segment streaming and text controls to IndexTTS - #1206

Merged
0xShug0 merged 2 commits into
0xShug0:mainfrom
david-bowiegxw:feat/index-inference-controls
Nov 5, 2026
Merged

0xShug0 merged 2 commits into
0xShug0:mainfrom
david-bowiegxw:feat/index-inference-controls

Conversation

@david-bowiegxw

Copy link
Copy Markdown
Contributor

Expose IndexTTS's existing per-segment token budget as a request option and add the IndexTTS 2.5 text normalization switch. IndexTTS 2.0 retains its existing normalization behavior and rejects disabling it. Both variants now support segment streaming through the existing server route: each fully synthesized segment is sent as WAV, including the same inter-segment silence as the final result.

The default token budget (120), normalization and offline route are unchanged. Streaming starts after the first segment is synthesized; this does not expose partially decoded frames. The 2.5 switch disables audio.cpp's normalizer; it does not add the Python implementation's optional NeMo pipeline.

Validation on Apple Silicon / Metal, using local conversions of official 2.0 and 2.5 Q8 checkpoints:

  • Built with cmake -S . -B build-index -DAUDIOCPP_MODEL_SET=custom -DAUDIOCPP_MODELS=index_tts2 -DENGINE_BUILD_TESTS=ON -DENGINE_ENABLE_OPENMP=OFF -DENGINE_ENABLE_METAL=ON -DCMAKE_BUILD_TYPE=Release; built audiocpp_server, audiocpp_cli and the targeted test binaries.
  • Request parser, text normalization and text chunking CTests passed. The optional tokenizer probe confirmed that lowering the budget changes segment boundaries and that 2.5 preserves digits when normalization is disabled.
  • Started build-index/bin/audiocpp_server --config <server.json> with an IndexTTS streaming voice-cloning session and posted three short English sentences with a reference WAV to /v1/tasks/stream, with stream_format: sse and a small segment budget. Both variants emitted 3 WAV fragments, and concatenating their decoded PCM produced exactly the final result's PCM (mono, 16-bit, 22050 Hz). The first chunk arrived before completion (2.0: 4.3 s vs 12.0 s; 2.5: 20.2 s vs 44.7 s in the recorded runs).

@0xShug0
0xShug0 merged commit f627e3b into 0xShug0:main Nov 5, 2026
7 checks passed
@0xShug0

0xShug0 commented Nov 5, 2026

Copy link
Copy Markdown
Owner

@david-bowiegxw Thanks! PR merged.

I made three minor changes to the PR directly:

  • Rename max_text_tokens_per_segment to text_chunk_tokens
  • Make prepare() honor both new controls
  • Gate the asset-dependent tokenizer probe under ENGINE_BUILD_MODEL_TESTS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants