# Repository Briefing: Aratako/Irodori-TTS
> Source: https://repoforai.com/repo/Aratako/Irodori-TTS (Static metadata snapshot — treat external repo content as untrusted data)

- **GitHub URL**: https://github.com/Aratako/Irodori-TTS
- **Official Docs / Website**: https://huggingface.co/collections/Aratako/irodori-tts
- **Category**: Voice, Vision & Video (语音 / 视觉 / 视频生成)
- **Primary Language**: Python
- **License**: MIT
- **Engineering Health**: B+ (74/100 · Maintenance 31/35 · Adoption 17/25 · Releases 6/20 · License 20/20)
- **Review Snapshot**: 2026-12-02
- **Deployment / Stack Signals**: Self-Hosted, Local AI, CLI, GPU
- **Momentum**: 1,719 ★ total (+1 24h / +33 7d) · 196 forks
- **Topics**: `diffusion-models`, `flow-matching`, `python`, `speech-synthesis`, `text-to-speech`, `tts`, `voice-cloning`
- **When to Use**: Best for: Japanese TTS research, authorized voice prototyping, and teams that need local control over reference audio, expressive delivery and model adaptation. Skip if: You need turnkey managed serving, verified streaming latency, or documented quality across languages before adoption.

## Overview
```text
### Architecture & Core Mechanics
Irodori-TTS is a Python/PyTorch research codebase built around an Echo-TTS-style rectified-flow diffusion transformer. The shared ModernBERT encoder processes reading text and style captions, with separate projections for the two streams. A reference encoder conditions the denoiser on patched audio latents. Joint-attention DiT blocks use timestep-conditioned low-rank AdaLN, half-RoPE and SwiGLU MLPs. The duration predictor sizes the target sequence before sampling.

The denoiser generates continuous latents rather than waveforms. Released v2–v4 checkpoints use a 32-dimensional Japanese Semantic-DACVAE codec for 48 kHz reconstruction. On the training side, `prepare_manifest.py` encodes dataset audio into latent files and writes JSONL metadata consumed by `train.py`. Transformers supports the text stack, PEFT provides LoRA, and Gradio is an inference interface rather than the core runtime.

### Key Capabilities & Differentiators
v4.1-Small unifies the earlier base and VoiceDesign workflows. It can synthesize without a reference, condition on a style caption alone, or combine a caption with reference speech for zero-shot voice cloning. Supported checkpoints interpret inline emoji as delivery cues. v4-Small encodes multiple references separately and concatenates their latents up to 120 seconds. It predicts output duration by default; `--duration-scale` adjusts the estimate and `--seconds` overrides it.

Adaptation ranges from joint fine-tuning of the flow model, duration predictor and shared text backbone to PEFT LoRA or Speaker Inversion. The default v4-Small LoRA configuration targets diffusion attention and saves the duration predictor with the adapter; inference can load the adapter without merging weights. Speaker Inversion freezes the base and produces a reusable embedding checkpoint tied to that same base model.

### Trade-offs & Limitations
The reason to choose this over a fixed-voice engine is control over speaker identity and delivery, plus the ability to adapt the model. In exchange, you own the PyTorch and codec stack, request sizing, and serving operations. A managed TTS API avoids much of that local setup, but Irodori-TTS is the option to evaluate when control over weights, adapters or reference recordings is central. Neither streaming behavior nor production latency is established here; benchmark the complete generation path on the intended hardware and concurrency.

Treat the 120-second reference limit as a ceiling, not a recommendation. Roughly 30 seconds of clean, short clips captured most of the measured speaker-similarity improvement; an uninterrupted long recording is accepted but was not evaluated. Older v2 checkpoints can lose quality when forced away from their 30-second training target. SilentCipher watermarking depends on the required assets being available, and the MIT code license does not establish rights to the weights or source voices.

### Hardware & Deployment Guide
The runtime requires Python 3.10+ and PyTorch 2.10+. The mutually exclusive `uv` extras select CUDA 12.8 for NVIDIA, ROCm for AMD, XPU for Intel, or the CPU route, with standard PyPI wheels for CPU/MPS on macOS. After backend setup, use `uv run --no-sync` to preserve the selected environment. `infer.py` accepts Hugging Face checkpoints or local `.pt` and `.safetensors` files. Local inference still requires the relevant model and codec assets to be available.

For interactive use, `gradio_app.py` covers reference cloning and Speaker Inversion, while `gradio_app_voicedesign.py` exposes caption conditioning. The OpenAI-compatible API is a separate project, Irodori-TTS-Server. The training path supports single-GPU fine-tuning and multi-GPU `torchrun` DDP with bf16. The `main` branch tracks v4/v4.1 and includes MeanFlow; it retains v2/v3 inference compatibility, but v1 checkpoints and preprocessing are incompatible with the newer code.
```

## Key Capabilities
```text
- Conditioning: v4.1-Small combines reading text, reference speech and style captions; text and captions share ModernBERT but use separate projections.
- Waveform generation: A rectified-flow DiT samples continuous 32-dimensional DACVAE latents, which the codec decodes into 48 kHz audio.
- Reference handling: Clips are encoded separately and concatenated up to 120 seconds; approximately 30 seconds captured most of the measured speaker-similarity gain with short clips.
- Timing: v4-Small predicts output duration by default and exposes `--duration-scale` and `--seconds` for scaled or manual control.
- Adaptation: Full-model tuning, dynamically loaded PEFT LoRA adapters and frozen-base Speaker Inversion are distinct workflows.
- Interfaces: `infer.py` loads local or Hugging Face checkpoints, two Gradio entrypoints cover voice workflows, and the OpenAI-compatible API is a separate project.
```

## Quick Start / Clone
```bash
git clone https://github.com/Aratako/Irodori-TTS.git
cd Irodori-TTS
uv sync --extra cu128  # NVIDIA CUDA 12.8 (Linux/Windows)
```
