- Add XTTS v2 configuration to .env.example - Refactor Dockerfile to multi-stage build with CUDA 12.1 support - Update Makefile with Kokoro and XTTS test environment targets - Refactor Piper engine (app/engines/piper.py) to use python module execution - Add comprehensive documentation for Kokoro and XTTS plans - Add helper scripts and patches for build process
1.8 KiB
1.8 KiB
Coqui XTTS v2 Implementation Plan
Objective
Implement Coqui XTTS v2 (tts_models/multilingual/multi-dataset/xtts_v2) as a new engine in AudioEngineHub.
1. Dependencies (requirements.txt)
- Add
TTS(Coqui TTS). - Note: This is a heavy library. We will add it to
requirements.txt. - Potential Conflict:
TTSoften requires specifictorchversions. We need to ensure it plays nicely withf5-tts(which also uses torch) andkokoro.
2. Configuration (app/config.py & .env)
XTTS_DEVICE: "cuda" or "cpu" (default: "cuda")XTTS_ACCEPT_LICENSE: "true" (required to use the model)XTTS_MODEL_VERSION: "v2.0.2" (or "main" for latest)
3. Engine Implementation (app/engines/xtts.py)
- Class:
XTTSEngine(inheritsTTSEngineBase) - Init:
- Load
TTSAPI. - Download/Load model:
tts_models/multilingual/multi-dataset/xtts_v2. - Handle license agreement.
- Load
- Synthesize:
- Inputs:
text,speaker(voice cloning reference),language. - Voice Cloning: The
speakerargument will be interpreted as a filename inapp/asset/voices/(or a default provided sample). - Language: XTTS supports 17 languages. We will map them (e.g., "en", "de", "fr").
- Inputs:
- List Models: Return
['xtts_v2']. - List Voices: Scan
app/asset/voices/for.wavfiles to use as reference speakers.
4. System Updates
app/main.py: RegisterxttsinALL_ENGINES.Dockerfile: Ensure system dependencies (already haveffmpegandespeak-ng, which are good).
5. Directory Structure
app/asset/voices/: Directory to store reference audio files for cloning.
Action Plan
- Update
requirements.txt. - Create
app/engines/xtts.py. - Update
app/config.py. - Update
app/main.py.