VocoLoom Logo

VocoLoom

Modular multi-voice AI speech synthesis platform and microservice powered by F5-TTS, Vocos, and optional RVC.

πŸ‡¬πŸ‡§ English Β· πŸ‡©πŸ‡ͺ Deutsch

--- ## Overview **VocoLoom** is a modular multi-voice AI speech synthesis platform and HTTP microservice built on **F5-TTS** (Flow-Matching DiT + CFM) and the **Vocos** vocoder, with optional **RVC** (Retrieval-based Voice Conversion) post-processing via an embedded **Applio** integration. It exposes a **Gradio 5 Web Studio**, a **FastAPI REST API** (with OpenAPI/Swagger documentation at `/docs`), and a **CLI** (`vocoloom.py`), all sharing a unified `VoiceManager` that auto-discovers self-contained **Voice Packs** from `voices//`. Currently hosted voice pack: - **JΓΌrgen Seiferth** (`juergen_seiferth`) β€” Fairground showman legend from *β€žDie Welt ist unser Feldβ€œ* (1995), featuring Ruhrpott cadence and classic fairground expressions, including optional RVC refinement. ``` β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ Clients: Web Studio (Gradio /) Β· REST API Β· CLI β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β–Ό β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ VoiceManager (vocoloom/voice_manager.py) β”‚ β”‚ β€’ Auto-discovers voices// β”‚ β”‚ β€’ VRAM model caching & phrase splitting β”‚ β”‚ β€’ F5-TTS (CFM + DiT) + Vocos vocoder (24 kHz) β”‚ β”‚ β€’ Optional RVC pass via Applio (rmvpe) β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β–Ό β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ voices// (Voice Pack) β”‚ β”‚ voice.json Β· model.pt Β· reference.wav/.txt β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ ``` --- ## Features - **Modular Voice-Pack Architecture**: Each voice lives in its own directory `voices//` with metadata (`voice.json`), fine-tuned checkpoint (`model.pt`), reference audio (`reference.wav`), transcript (`reference.txt`), and avatar (`avatar.png`). New voices are automatically discovered on startup. - **Natural Phrase Splitting**: Automatically splits longer inputs at sentence boundaries (`.!?`) and commas (for phrases > 80 characters) and inserts 250 ms pauses between segments to prevent flow-trajectory drift. - **VRAM Caching & Preloading**: `vocoloom/server.py` preloads the first discovered voice into GPU VRAM on startup for low-latency synthesis and clears CUDA cache cleanly when switching voices. - **Gradio Web Studio (`/`)**: Interactive browser interface with voice dropdown, dialect/tag badges, speech speed slider (`0.6`–`1.4`), optional RVC toggle, one-click sample sentences, and WAV audio playback. - **FastAPI REST API (`/api/v1/*`)**: CORS-enabled HTTP endpoints with automatic Swagger UI at `/docs` returning `audio/wav` streams. - **Command-Line Interface (`vocoloom.py`)**: List hosted voices, synthesize WAV files directly (with optional `--play` on Windows), or launch the combined Web UI + API server. - **Optional RVC Post-Processing**: When `rvc_support.supported` is `true` in `voice.json`, synthesis can optionally run through Applio (`rmvpe` F0 extraction, configurable `rvc_index`). - **GPU-Accelerated Docker Image**: Ready-to-deploy CUDA 12.4 + cuDNN 9 container (`git.orfel.de/jannik/vocoloom:latest`) with NVIDIA GPU reservation and healthcheck. --- ## How It Works & Tech Stack ### Voice-Pack Structure Every voice pack resides in `voices//`: ```text voices/ └── juergen_seiferth/ β”œβ”€β”€ voice.json # Metadata: id, name, subtitle, dialect, tags, defaults, rvc_support β”œβ”€β”€ model.pt # Fine-tuned F5-TTS checkpoint (EMA or raw state dict) β”œβ”€β”€ reference.wav # Clean reference audio clip β”œβ”€β”€ reference.txt # Exact transcript (fallback if not in voice.json) └── avatar.png # Avatar image served at /api/v1/voices/{id}/avatar ``` ### Tech Stack | Component | Technology | | :--- | :--- | | **TTS Engine** | `f5-tts` (`>=0.2.0`, Flow-Matching `CFM` + `DiT` with `dim=1024`, `depth=22`, `heads=16`), `vocos` (`>=0.1.0`, `24000 Hz`) | | **Tokenization** | Custom German character vocabulary (`models/F5-TTS-German/vocab.txt`) | | **Voice Conversion (Optional)** | Embedded `Applio` (`run_infer_script`, `f0_method="rmvpe"`) | | **Web API & Server** | FastAPI (`>=0.115.0`), Uvicorn (`>=0.32.0`), Pydantic (`>=2.9.0`) | | **Web Studio UI** | Gradio (`>=5.0.0`) mounted inside FastAPI at `/` | | **Audio & Numerics** | PyTorch (`2.6.0` + CUDA 12.4 in Docker), `soundfile`, `numpy`, `pillow` | | **Default Port** | `7860` | --- ## Prerequisites & Installation ### Prerequisites - **Python 3.10+** (for local execution) with an NVIDIA CUDA GPU recommended (CPU fallback is supported automatically if CUDA is unavailable) - **FFmpeg** & **libsndfile1** installed on the system - **Docker** + **NVIDIA Container Toolkit** (for GPU Docker deployment) ### Option 1: Local Installation ```bash git clone https://git.orfel.de/Jannik/VocoLoom.git cd VocoLoom python -m venv .venv # Linux/macOS: source .venv/bin/activate # Windows: .venv\Scripts\activate pip install -r requirements.txt ``` ### Option 2: Docker & GPU Deployment (Jannik-Cloud Standard) VocoLoom follows the **Docker-First** workflow using the pre-built image in the Gitea Container Registry (`git.orfel.de`): ```bash # Clone repository git clone https://git.orfel.de/Jannik/VocoLoom.git cd VocoLoom # Build locally (optional) docker build -t git.orfel.de/jannik/vocoloom:latest . # Push to Gitea Container Registry (optional) docker push git.orfel.de/jannik/vocoloom:latest # Start GPU container with docker-compose.yml docker compose up -d ``` `docker-compose.yml` mounts `./voices:/app/voices` and `./models:/app/models`, reserves 1 NVIDIA GPU, and exposes port `7860`. --- ## Configuration ### Environment Variables | Variable | Default | Description | | :--- | :--- | :--- | | `VOCOLOOM_PORT` | `7860` | HTTP port for Web Studio & REST API | | `VOCOLOOM_HOST` | `0.0.0.0` | Bind host address | | `NVIDIA_VISIBLE_DEVICES` | `all` | Exposed GPU devices inside Docker | ### Adding a New Voice Pack (`voice.json`) Create a new directory `voices//` containing `model.pt`, `reference.wav`, `reference.txt` (or inline `reference_text`), optional `avatar.png`, and `voice.json`: ```json { "id": "my_voice", "name": "Display Name", "subtitle": "Short Subtitle", "description": "Voice persona description.", "gender": "male", "language": "de", "dialect": "Standard", "tags": ["Tag1", "Tag2"], "engine": "f5-tts", "model_file": "model.pt", "reference_audio": "reference.wav", "reference_text": "Exact transcript of reference.wav", "default_speed": 1.0, "cfg_strength": 1.8, "nfe_step": 64, "sample_sentences": [ "Sample sentence one." ], "rvc_support": { "supported": false } } ``` Restart VocoLoom and the new voice pack is automatically available in the Web Studio, CLI, and REST API. --- ## Usage ### 1. Start Web Studio & REST API ```bash python webui.py ``` Or via the CLI: ```bash python vocoloom.py serve --host 0.0.0.0 --port 7860 ``` - **Web Studio**: `http://localhost:7860/` - **Swagger API Docs**: `http://localhost:7860/docs` - **Health Check**: `http://localhost:7860/health` On Windows, `start_webui.bat` activates `.venv` and launches `python webui.py`. ### 2. CLI Usage (`vocoloom.py`) ```bash # List all hosted voices python vocoloom.py list # Synthesize speech to a WAV file python vocoloom.py speak --voice juergen_seiferth "Mahlzeit Alexander!" -o ausgabe.wav # Adjust speed and enable optional RVC refinement python vocoloom.py speak -v juergen_seiferth "Jetzt ist aber fertig Ballett!" -s 1.0 --rvc --index 0.70 -o out.wav ``` ### 3. REST API Examples ```bash # Check server health & loaded device curl http://localhost:7860/health # List available voices curl http://localhost:7860/api/v1/voices # Get details for a specific voice curl http://localhost:7860/api/v1/voices/juergen_seiferth # Download voice avatar curl http://localhost:7860/api/v1/voices/juergen_seiferth/avatar --output avatar.png # Synthesize speech (returns audio/wav) curl -X POST http://localhost:7860/api/v1/synthesize \ -H "Content-Type: application/json" \ -d '{"voice_id": "juergen_seiferth", "text": "Mahlzeit mein Lieber!", "speed": 1.0, "use_rvc": false, "rvc_index": 0.70}' \ --output rede.wav ``` --- ## Project Structure ```text VocoLoom/ β”œβ”€β”€ assets/ β”‚ └── logo.png # Application logo β”œβ”€β”€ models/ β”‚ └── F5-TTS-German/ # German base checkpoint & vocab.txt β”œβ”€β”€ personality/ # Persona notes & Modelfile for JΓΌrgen Seiferth β”œβ”€β”€ voices/ β”‚ └── juergen_seiferth/ # Default Voice Pack (voice.json, model.pt, reference.wav/.txt, avatar.png) β”œβ”€β”€ vocoloom/ β”‚ β”œβ”€β”€ __init__.py # Package exports (Voice, VoiceManager) β”‚ β”œβ”€β”€ voice.py # Voice dataclass & directory loader β”‚ β”œβ”€β”€ voice_manager.py # Auto-discovery, VRAM management, F5-TTS & Applio synthesis β”‚ β”œβ”€β”€ api.py # FastAPI REST endpoints (/health, /api/v1/*) β”‚ β”œβ”€β”€ webui.py # Gradio 5 Web Studio UI β”‚ β”œβ”€β”€ server.py # Combined FastAPI + Gradio server & voice preloading β”‚ └── cli.py # CLI commands (list, speak, serve) β”œβ”€β”€ Applio/ # Embedded RVC inference engine (optional) β”œβ”€β”€ webui.py # Server entrypoint β”œβ”€β”€ vocoloom.py # CLI entrypoint β”œβ”€β”€ start_webui.bat # Windows launcher β”œβ”€β”€ requirements.txt # Python dependencies β”œβ”€β”€ Dockerfile # PyTorch 2.6 + CUDA 12.4 container └── docker-compose.yml # GPU-enabled Docker Compose definition ``` --- ## License This project's own code is dedicated to the public domain under **CC0 1.0 Universal** β€” see [`LICENSE`](LICENSE). > **Third-Party Components:** External dependencies, bundled libraries, fonts, datasets, and media assets retain their own respective licenses and are excluded from CC0 1.0. See [`THIRD_PARTY_NOTICES.md`](THIRD_PARTY_NOTICES.md) for details.