SWivid /F5-TTS

Official code for "F5-TTS: A Fairytaler that Fakes Fluent and Faithful Speech with Flow Matching"

★ 15,597⑂ 2,281👁 130⑃ 253● 898▤ 22
PythonMITCreated 2024-10-08arxiv.org/abs/2410.06885
Download: 1.1.221.1.22 ↓1.1.222026-07-23
+12
Daily
15,597
stars
2,281
forks
130
watchers
253
prs
898
issues
22
releases

README

F5-TTS: A Fairytaler that Fakes Fluent and Faithful Speech with Flow Matching









 --

F5-TTS: Diffusion Transformer with ConvNeXt V2, faster trained and inference.

E2 TTS: Flat-UNet Transformer, closest reproduction from paper.

Sway Sampling: Inference-time flow step sampling strategy, greatly improves performance

 Thanks to all the contributors !

 News
- 2025/03/12: 🔥 F5-TTS v1 base model with better training and inference performance. Few demo.
- 2024/10/08: F5-TTS & E2 TTS base models on 🤗 Hugging Face, 🤖 Model Scope, 🟣 Wisemodel.

 Installation

 Create a separate environment if needed

bash
 Create a conda env with python_version=3.10  (you could also use virtualenv)
conda create -n f5-tts python=3.11
conda activate f5-tts

 Install FFmpeg if you haven't yet
conda install ffmpeg


 Install PyTorch with matched device


NVIDIA GPU

 bash
  Install pytorch with your CUDA version, e.g.
 pip install torch==2.8.0+cu128 torchaudio==2.8.0+cu128 --extra-index-url https://download.pytorch.org/whl/cu128
 
  And also possible previous versions, e.g.
 pip install torch==2.4.0+cu124 torchaudio==2.4.0+cu124 --extra-index-url https://download.pytorch.org/whl/cu124
  etc.
 




AMD GPU

 bash
  Install pytorch with your ROCm version (Linux only), e.g.
 pip install torch==2.9.1+rocm7.2 torchaudio==2.9.1+rocm7.2 --extra-index-url https://download.pytorch.org/whl/rocm7.2

  For older GPUs (RDNA1/2/3 only):
  pip install torch==2.5.1+rocm6.2 torchaudio==2.5.1+rocm6.2 --extra-index-url https://download.pytorch.org/whl/rocm6.2
 

 Note: RDNA 3.5 and RDNA 4 GPUs (Radeon 8050S/8060S, RX 9060/9070 series) require
 ROCm 7.x — these architectures (gfx1151/gfx1201) are not included in ROCm 6.x
 (6.2 compatibility matrix vs
 7.2 compatibility matrix).
 Using ROCm 6.x on these GPUs causes HIP error: invalid device function (1236).




Intel GPU

 bash
  Install pytorch with your XPU version, e.g.
  Intel® Deep Learning Essentials or Intel® oneAPI Base Toolkit must be installed
 pip install torch torchaudio --index-url https://download.pytorch.org/whl/test/xpu
 
  Intel GPU support is also available through IPEX (Intel® Extension for PyTorch)
  IPEX does not require the Intel® Deep Learning Essentials or Intel® oneAPI Base Toolkit
  See: https://pytorch-extension.intel.com/installation?request=platform
 




Apple Silicon

 bash
  Install the stable pytorch, e.g.
 pip install torch torchaudio
 



 Then you can choose one from below:

  1. As a pip package (if just for inference)
 
 bash
 pip install f5-tts
 
 
  2. Local editable (if also do training, finetuning)
 
 bash
 git clone https://github.com/SWivid/F5-TTS.git
 cd F5-TTS
  git submodule update --init --recursive   (optional, if use bigvgan as vocoder)
 pip install -e .
 

 Docker usage also available
bash
 Build from Dockerfile
docker build -t f5tts:v1 .

 Run from GitHub Container Registry
docker container run --rm -it --gpus=all --mount 'type=volume,source=f5-tts,target=/root/.cache/huggingface/hub/' 

Top issues

Discussions

Latest release

1.1.22 1.1.22 2026-07-23
What's Changed
 fix: allocate fix_duration across chunks to avoid N× duration blow-up by @Wing900 in https://github.com/SWivid/F5-TTS/pull/1309

 New Contributors
 @Wing900 made their first contribution in https://github.com/SWivid/F5-TTS/pull/1309

Full Changelog: https://github.com/SWivid/F5-TTS/compare/1.1.21...1.1.22

Snapshot: 2026-11-16T09:23:14Z · Data license Apache-2.0 · JSON