Skip to main content
Back

Shanghai Jiao Tong's F5-TTS Clones Any Voice in Seconds at 0.15 RTF

A fully non-autoregressive text-to-speech system built on flow matching that hits an RTF of 0.15 with zero-shot voice cloning across English and Chinese.

Pro

  • F5-TTS is a fully non-autoregressive TTS model based on flow matching with a Diffusion Transformer backbone.
  • The Hugging Face checkpoint has crossed 760K downloads with over 1,000 likes.
  • Drops phoneme aligners, duration predictors, and text encoders in favor of padded character input plus ConvNeXt V2 refinement.
  • Introduces Sway Sampling, a training-free inference strategy that improves flow matching TTS models across the board.
  • Hits WER 2.42 and RTF 0.15 on LibriSpeech-PC, trained on 100K hours of the Emilia dataset.
  • Weights are CC-BY-NC-4.0, so commercial deployment is not permitted despite the open GitHub release.

A fully non-autoregressive text-to-speech model that clones a voice from a few seconds of audio, runs at a real-time factor of 0.15, and ships with open weights has quietly become one of the most downloaded speech models on Hugging Face. F5-TTS now sits at over 760,000 monthly downloads and roughly 1,200 likes on the Hub, and the checkpoints are freely available for anyone who wants to run zero-shot voice cloning locally.

The model comes from the X-LANCE Lab at Shanghai Jiao Tong University, with collaborators at Cambridge and Geely. The name is a mouthful: F5-TTS stands for A Fairytaler that Fakes Fluent and Faithful Speech with Flow Matching. Underneath the pun is a simple design that skips most of the machinery TTS systems usually pile on.

A pipeline stripped to the studs

Most zero-shot TTS systems lean on a stack of specialized components: phoneme aligners, duration predictors, text encoders, sometimes a semantically infused audio codec. F5-TTS drops those pieces entirely, running fully non-autoregressive generation on top of flow matching with a Diffusion Transformer. The text input is padded with filler tokens to match the length of the input speech, and denoising handles the rest, an approach first shown feasible by E2 TTS.

E2 TTS, the predecessor this design borrows from, has real problems: slow convergence and low robustness make the original design hard to follow. F5-TTS addresses this by first modeling the input with ConvNeXt to refine the text representation, making it easier to align with the speech. In practice, the character sequence gets its own little modeling budget before it ever touches the audio stream, which turns out to matter a lot for alignment stability.

Sway Sampling, the free lunch

The second contribution is a change you can retrofit into other flow matching models without retraining. The authors propose an inference-time Sway Sampling strategy that improves the model's performance and efficiency, and it plugs into existing flow matching systems as a drop-in replacement for the sampling schedule.

The intuition: early flow steps determine the overall shape of the speech, while later steps polish details. Sway Sampling biases the ODE solver to spend more of its budget on those early steps. The function looks like this:

import math
def sway_sample(u, s=-1.0):
    # u ~ Uniform[0,1], s in [-1, 2/(pi-2)]
    return u + s * (math.cos(0.5 * math.pi * u) - 1 + u)

With s = -1, the sampling is heavily biased toward smaller t values, giving the solver more information before committing to a global structure. The ablation shows this consistently improves WER, speaker similarity, and naturalness on both base and small models, and it also works when bolted onto E2 TTS.

Training recipe

The base models were trained on Emilia, a large multilingual in-the-wild dataset. F5-TTS uses roughly 100K hours of English and Chinese data after filtering out failed transcriptions and misclassified languages. Some specifics worth noting:

  • Backbone is a Diffusion Transformer with adaLN-zero, plus ConvNeXt V2 blocks for text refinement, totaling around 336M parameters.
  • Text is fed as raw alphabets and symbols for English, and full pinyin for Chinese, with a vocabulary of 2,546 tokens covering code-switched sentences.
  • Audio is represented as 100-dimensional log mel-filterbank features at 24 kHz with hop length 256.
  • Training ran for 1.2M updates over roughly a week on 8 NVIDIA A100 80G GPUs, using AdamW with a peak learning rate of 7.5e-5.
  • A random 70 to 100 percent of mel frames is masked during the infilling task, and CFG dropout is applied in two stages so the model learns text alignment more aggressively.

There is no separate duration model. The system estimates output length from the character count ratio between reference and target transcripts, which sounds crude but works well in practice.

What the numbers say

On LibriSpeech-PC test-clean, the base F5-TTS with 32 NFE hits 2.42 WER and 0.66 speaker similarity, compared to 2.95 WER for the reproduced E2 TTS baseline. At 16 NFE it still holds 2.53 WER while dropping RTF to 0.15. On the Seed-TTS test sets, F5-TTS matches or beats several systems trained on far larger corpora, including CosyVoice trained on 170K hours and FireRedTTS trained on 248K hours.

The comparison against E2 TTS is where the design choices pay off most clearly. Flow matching avoids the iterative refinement loops required by diffusion, cutting inference cost while holding output quality and prosody steady, which makes F5-TTS practical for real-time applications where latency is critical.

Running it

The GitHub repo ships everything needed to reproduce the results locally, including a Gradio interface, a CLI, and Docker images. Checkpoints on the Hub include F5TTS_v1_Base (1.25M steps), the original F5TTS_Base (1.2M steps), and an E2TTS_Base reproduction, each around 1.35 GB. A Triton and TensorRT-LLM deployment stack is also included, with benchmarks on a single L20 GPU reporting offline batch latency well under real-time.

Installation is straightforward for anyone who has run a PyTorch model before:

conda create -n f5-tts python=3.11
conda activate f5-tts
conda install ffmpeg
pip install torch torchaudio
pip install f5-tts

Strengths, and where it falls short

Zero-shot voice cloning from a few seconds of prompt audio is the headline capability. The model handles code-switching between English and Chinese, speed control by varying the target sequence length, and generates smooth, expressive speech without any speaker-specific fine-tuning. It also generalizes to smaller datasets: the paper shows the same architecture trains stably on LibriTTS at 585 hours and even LJSpeech at 24 hours.

The limits are worth flagging. The authors call out two:

  1. The mel spectrogram sequence is still much longer than the text modality, leaving efficiency on the table until someone finds a better continuous speech representation.
  2. The model has no fine-grained control over paralinguistic details like emotion, so directing performance beyond what is implicit in the reference audio is not really possible.

One more consideration before shipping anything with it: the weights are released under CC-BY-NC-4.0, which permits research and educational use but not commercial deployment. A growing ecosystem of finetunes and adapters has appeared on the Hub, and they inherit the same license. For anyone experimenting with open-source voice cloning without touching a paid API, F5-TTS is currently one of the strongest starting points available.