★ Reading this for free? Get 25 structured AI courses + per-chapter AI tutor — the first chapter of every course free, no card.Start free in 30 secondsOr own every course: $149 once
Multimodal

F5-TTS Setup Guide: Install, Voice Cloning, CLI & API (2026)

May 1, 2026
14 min read
Barsha Mohapatra

Want to go deeper than this article?

Free account unlocks the first chapter of all 25 courses — RAG, agents, MCP, voice AI, MLOps, real GitHub repos.

📚AI Learning Path

Voice working locally? Build the whole pipeline. Whisper, TTS, and voice cloning wired into real projects — hands-on courses. First chapter free, no card.

Start free
Or own it for life — Lifetime $149, pay once

F5-TTS is an open-source text-to-speech and zero-shot voice-cloning model from the SWivid team: MIT-licensed code, CC-BY-NC (non-commercial) pretrained weights, installed with pip install f5-tts after you install PyTorch for your GPU. The current default checkpoint is F5TTS_v1_Base (released March 12, 2025 per the README), a 1.35 GB safetensors file that downloads from Hugging Face on first run. Every command on this page was checked against the SWivid/F5-TTS README and the inference docs on September 22, 2026 (latest release 1.1.22, July 23, 2026).

What you need to run F5-TTS

RequirementWhat the project documents
Python3.10 or newer (README: "python_version>=3.10"; the example env uses 3.11)
PyTorchInstalled separately, matched to your device (see the exact commands below)
NVIDIA GPUAny CUDA card; README example pins torch==2.8.0+cu128 (or 2.4.0+cu124 for older stacks)
AMD GPULinux only, ROCm build of PyTorch; RDNA 3.5 / RDNA 4 cards (Radeon 8050S/8060S, RX 9060/9070) need ROCm 7.x — ROCm 6.x gives HIP error: invalid device function
Intel GPUXPU build of PyTorch (needs Intel oneAPI Base Toolkit or Deep Learning Essentials) or IPEX
Apple SiliconStock pip install torch torchaudio; the API auto-selects mps when CUDA and XPU are absent
CPU onlyWorks — the API falls back to cpu — but the README publishes no CPU speed figures
FFmpegRequired (conda install ffmpeg or your package manager)
Disk~1.35 GB for F5TTS_v1_Base, plus the Vocos vocoder, cached under ~/.cache/huggingface/hub
VRAMThe project publishes no minimum. Two documented memory notes: leaving --ref_text empty loads an ASR model ("extra GPU memory usage"), and generation is capped at 30 seconds of audio per pass, so long texts are chunked automatically

The last row matters: the README and the inference docs do not state a VRAM figure, so any "needs X GB" number you see elsewhere is somebody's measurement, not the project's. The weights are 1.35 GB; budget for that plus the vocoder, activations and, if you skip the transcript, the ASR model.

Reading articles is good. Building is better.

Free account = the first chapter of all 25 courses, with a per-chapter AI tutor. No card.

Table of Contents

  1. What F5-TTS Is
  2. Installation (verified commands)
  3. Your First Voice Clone (CLI)
  4. Reference Audio Rules From the Docs
  5. CLI Options That Matter
  6. Python API
  7. Gradio Web UI
  8. Docker
  9. Other Languages: Community Checkpoints
  10. ComfyUI Node
  11. Fine-Tuning
  12. F5-TTS vs XTTS v2, Chatterbox, Kokoro and Others
  13. Licence and Ethics
  14. Troubleshooting
  15. FAQ

What F5-TTS Is

F5-TTS ("A Fairytaler that Fakes Fluent and Faithful Speech with Flow Matching", arXiv 2410.06885, October 2024) is a non-autoregressive TTS model. The README describes the pieces:

  • F5-TTS — a Diffusion Transformer with ConvNeXt V2 text conditioning, "faster trained and inference"
  • E2 TTS — a Flat-UNet Transformer, the repo's reproduction of Microsoft's E2 TTS paper, shipped as the E2TTS_Base checkpoint
  • Sway Sampling — an inference-time flow-step sampling strategy the authors say "greatly improves performance"
  • Vocoder — mel-spectrograms are turned into audio by Vocos (default) or BigVGAN; F5-TTS is not vocoder-free

Three checkpoints live in the official Hugging Face repos: F5TTS_v1_Base (current default, 1.348 GB), F5TTS_Base (the original, 1.349 GB, the only one that supports the BigVGAN vocoder) and E2TTS_Base (in the separate SWivid/E2-TTS repo). All were trained on the Emilia dataset in Chinese and English, which is why the weights are CC-BY-NC: the README says the models are "licensed under the CC-BY-NC license due to the training data Emilia, which is an in-the-wild dataset". The code itself is MIT.


Installation (verified commands)

The README's install is three steps: an environment, PyTorch for your device, then the package. These are the README's own commands.

1. Environment

# 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

2. PyTorch matched to your GPU

# NVIDIA GPU — 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
# (older stacks: pip install torch==2.4.0+cu124 torchaudio==2.4.0+cu124 --extra-index-url https://download.pytorch.org/whl/cu124)

# AMD GPU — Linux only, install pytorch with your ROCm version, 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
# older RDNA1/2/3 cards 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

# Intel GPU — needs Intel Deep Learning Essentials or oneAPI Base Toolkit
pip install torch torchaudio --index-url https://download.pytorch.org/whl/test/xpu

# Apple Silicon — the stable pytorch
pip install torch torchaudio

The README's AMD note is worth repeating verbatim in spirit: RDNA 3.5 and RDNA 4 GPUs (Radeon 8050S/8060S, RX 9060/9070 series) are not in ROCm 6.x, and using ROCm 6.x on them "causes HIP error: invalid device function" (tracked in issue #1236). Use the ROCm 7.2 build for those cards. For the broader picture of running voice models on Radeon, see our voice AI VRAM requirements by GPU.

3. F5-TTS itself

# As a pip package (if just for inference)
pip install f5-tts

# Or local editable (if also doing training / finetuning)
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 .

Check it worked with f5-tts_infer-cli --help. The console commands installed are f5-tts_infer-cli, f5-tts_infer-gradio and f5-tts_finetune-gradio.


Own it instead of renting it

Run this on your own machine and stop paying every month

Pay once and keep it. No renewal, no per-token bill, and nothing you feed it ever leaves your hardware.

Your First Voice Clone (CLI)

The README's own inference example, with F5TTS_v1_Base as the model:

# Leave --ref_text "" will have ASR model transcribe (extra GPU memory usage)
f5-tts_infer-cli --model F5TTS_v1_Base \
  --ref_audio "provide_prompt_wav_path_here.wav" \
  --ref_text "The content, subtitle or transcription of reference audio." \
  --gen_text "Some text you want TTS model generate for you."

What the flags mean (from infer_cli.py):

  • --ref_audio (-r) — the reference clip whose voice you want
  • --ref_text (-s) — its transcript. Pass "" to let the bundled ASR model transcribe it, at the cost of extra GPU memory
  • --gen_text (-t) — the new text to speak
  • --output_dir (-o) and --output_file (-w) — where the WAV goes; the default is tests/infer_cli_<timestamp>.wav

You can also run f5-tts_infer-cli with no flags to use the bundled basic.toml example, or f5-tts_infer-cli -c custom.toml with your own config.


Reference Audio Rules From the Docs

The inference README lists concrete rules that decide clone quality. In its words, or close to them:

  • Keep the reference under 12 seconds and "leave proper silence space (e.g. 1s) at the end" — otherwise there is a risk of truncating mid-word. Long reference audio is automatically clipped to ~12 s.
  • 30 seconds per generation is the current limit for a single pass, counting both prompt and output; the CLI and Gradio app chunk longer text automatically.
  • Uppercase letters are read letter by letter ("best with form like K.F.C."); use lowercase for ordinary words.
  • Add spaces or punctuation to force pauses. If an English sentence-ending punctuation mark is not followed by a space, it is not treated as a chunk boundary.
  • Numbers are read in English unless you pre-convert them to Chinese characters.

Beyond those, the usual recording advice applies: one speaker, no music or echo, a level that is neither clipped nor faint. The same rules are the difference between a convincing clone and a flat one in every engine we cover in local AI voice cloning.


CLI Options That Matter

Every flag below exists in infer_cli.py; defaults come from the model config and the bundled basic.toml.

# Batch from a text file (ignores --gen_text)
f5-tts_infer-cli --model F5TTS_v1_Base --ref_audio ref.wav --ref_text "..." \
  --gen_file lines.txt --output_dir outputs/ --output_file book.wav

# Quality / speed knobs
f5-tts_infer-cli ... --nfe_step 32            # denoising steps (API default 32)
f5-tts_infer-cli ... --cfg_strength 2         # classifier-free guidance (API default 2)
f5-tts_infer-cli ... --speed 1.0              # playback speed of the generated audio
f5-tts_infer-cli ... --cross_fade_duration 0.15   # seconds of cross-fade between chunks (API default 0.15)
f5-tts_infer-cli ... --remove_silence         # strip long silences from the output
f5-tts_infer-cli ... --save_chunk             # also save each chunk

# Vocoder: BigVGAN is only supported with F5TTS_Base
f5-tts_infer-cli --model F5TTS_Base --vocoder_name bigvgan --load_vocoder_from_local

# Custom checkpoint (local path, or hf:// which the CLI resolves for you)
f5-tts_infer-cli --ckpt_file ckpts/F5TTS_v1_Base/model_1250000.safetensors

Multi-voice generation uses a .toml file with named [voices.<name>] sections and [name] markers in the text; the repo ships a worked example at src/f5_tts/infer/examples/multi/story.toml.


Python API

This is the class as it exists in src/f5_tts/api.py today. Note the argument is ref_file, not ref_audio, and infer() returns the waveform, sample rate and spectrogram:

from f5_tts.api import F5TTS

f5tts = F5TTS(model="F5TTS_v1_Base")   # also: ckpt_file="", vocab_file="", device=None (auto: cuda > xpu > mps > cpu)

wav, sr, spec = f5tts.infer(
    ref_file="reference.wav",
    ref_text="Transcript of the reference clip.",
    gen_text="New text to generate in that voice.",
    nfe_step=32,          # denoising steps
    cfg_strength=2,       # classifier-free guidance
    speed=1.0,
    cross_fade_duration=0.15,
    remove_silence=False,
    file_wave="output.wav",   # optional: write the WAV for you
    seed=None,                # None picks a random seed; f5tts.seed holds the one used
)

There is no streaming generator on this class. If you want progressive playback, split the text into sentences yourself, call infer() per sentence and play each result as it returns — which is what the CLI's chunking does internally.


Gradio Web UI

# Launch a Gradio app (web interface)
f5-tts_infer-gradio

# Specify the port/host
f5-tts_infer-gradio --port 7860 --host 0.0.0.0

# Launch a share link
f5-tts_infer-gradio --share

The README lists what the app supports: basic TTS with chunk inference, multi-style / multi-speaker generation, a voice chat mode powered by Qwen2.5-3B-Instruct, and custom inference with the community language checkpoints. Models load from Hugging Face on first use; the ASR model is only loaded if you leave the transcript empty, and the LLM only if you open voice chat.


Docker

The README publishes an image on GitHub Container Registry, tagged main:

# Run from GitHub Container Registry
docker container run --rm -it --gpus=all --mount 'type=volume,source=f5-tts,target=/root/.cache/huggingface/hub/' -p 7860:7860 ghcr.io/swivid/f5-tts:main

# Quickstart if you want to just run the web interface (not CLI)
docker container run --rm -it --gpus=all --mount 'type=volume,source=f5-tts,target=/root/.cache/huggingface/hub/' -p 7860:7860 ghcr.io/swivid/f5-tts:main f5-tts_infer-gradio --host 0.0.0.0

The named volume keeps the downloaded checkpoints between runs. A docker-compose example for NVIDIA is in the README, and if --gpus=all fails, our Docker GPU not detected page covers the container-toolkit fix.


Other Languages: Community Checkpoints

The official checkpoints are Chinese and English only. Other languages come from community fine-tunes listed in the repo's SHARED.md. As of this check it lists Arabic (SILMA AI, Apache-2.0), Finnish, French, German, Hindi (SPRINGLab, CC-BY-4.0), Italian, Japanese, Latvian (CC0), Russian and Spanish (CC0); most of the rest carry the same CC-BY-NC as the base model. There is no model named F5TTS_v1_japanese — each card gives a Hugging Face checkpoint, a vocab file and the architecture config, and you load them with the generic flags. For example, the Japanese card (Jmica) points at:

# From SHARED.md — Japanese, F5-TTS Base architecture
# Model: hf://Jmica/F5TTS/JA_21999120/model_21999120.pt
# Vocab: hf://Jmica/F5TTS/JA_21999120/vocab_japanese.txt
f5-tts_infer-cli --model F5TTS_Base \
  --ckpt_file hf://Jmica/F5TTS/JA_21999120/model_21999120.pt \
  --vocab_file ./vocab_japanese.txt \
  --ref_audio japanese_speaker.wav --ref_text "..." --gen_text "..."

Pick --model to match the architecture on the card (the Base-config community models use F5TTS_Base), and download the vocab file locally first. Cross-lingual cloning — an English reference speaking Japanese — is not something the docs promise; use a same-language reference when you can.


ComfyUI Node

The maintained node pack is niknah/ComfyUI-F5-TTS (MIT, still receiving commits as of August 2026). Install it through ComfyUI Manager or clone it into custom_nodes/; it wraps the same checkpoints, so the reference-audio rules above still apply. If the node fails to load after install, the usual causes are covered in ComfyUI import failed.

For an OpenAI-compatible /v1/audio/speech endpoint in front of a local model, the pattern in our local TTS API server guide applies equally well to the F5-TTS Python API above.


Fine-Tuning

The repo ships a Gradio fine-tuning app and Accelerate-based training scripts:

# Quick start with Gradio web interface
f5-tts_finetune-gradio

Detailed guidance lives in src/f5_tts/train in the repo. The README gives no wall-clock estimates, and neither do we; if a community checkpoint for your language already exists in SHARED.md, it is almost always the shorter path.


F5-TTS vs XTTS v2, Chatterbox, Kokoro and Others

Licence is the column that decides most real projects, so it is the one we verified for each project:

ModelVoice cloningWeights licence (verified)Read next
F5-TTSZero-shot from a short referenceCC-BY-NC-4.0 (non-commercial); code MITThis page
XTTS v2 (Coqui)Zero-shot, 17 languagesCoqui Public Model License (non-commercial); code MPL-2.0XTTS v2 / Coqui TTS
Chatterbox (Resemble AI)Zero-shotMITChatterbox setup guide
Kokoro-82MNo (preset voices)Apache-2.0Kokoro local setup
OpenVoice (MyShell)Tone-colour cloningMIT (repo)OpenVoice v2 guide
Spark-TTSZero-shotCode Apache-2.0; Spark-TTS-0.5B weights CC-BY-NC-SA-4.0—

If you need to ship a product, Chatterbox and Kokoro are the two on this list whose weights allow it. If you are cloning for personal or research use and want the widest language coverage, XTTS v2 still has 17 languages built in. The full field, ranked, is in our best local TTS models roundup, and the emotion-first option is covered in the Orpheus TTS setup guide.


Licence and Ethics

Licence, precisely: the F5-TTS code is MIT. The pretrained checkpoints (F5TTS_v1_Base, F5TTS_Base, E2TTS_Base) are CC-BY-NC-4.0 — the Hugging Face model card carries license: cc-by-nc-4.0 and the README explains it is "due to the training data Emilia". CC-BY-NC does not permit commercial use, and the project does not advertise a paid commercial licence; if you need one, the route is training your own weights on data you are allowed to use commercially, or picking an MIT/Apache model from the table above.

Voice cloning is dual-use. Practices that hold regardless of licence:

  1. Consent — only clone voices with explicit permission
  2. Disclosure — label synthetic audio where listeners could reasonably be misled
  3. Logging — keep an audit trail of who generated what
  4. Refusals — block cloning of public figures and of living people who have not consented
  5. Local law — synthetic-media rules differ by jurisdiction; check yours before deploying

Troubleshooting

SymptomCause (from the docs / issues)Fix
HIP error: invalid device function on Radeon 8050S/8060S or RX 9060/9070ROCm 6.x PyTorch on RDNA 3.5 / RDNA 4Install the rocm7.2 PyTorch build (README, issue #1236)
Word cut off at the start of the outputReference clip has no trailing silence, or is over ~12 s and was clippedTrim to under 12 s and leave ~1 s of silence at the end
Acronyms read letter by letter, or names spelled outUppercase letters are uttered letter by letterWrite ordinary words in lowercase; keep "K.F.C." style only for acronyms
Long text stops early30 s cap per generationUse the CLI / Gradio app, which chunk automatically, or split the text yourself
Higher GPU memory than expected--ref_text "" loads the ASR modelProvide the transcript
--vocoder_name bigvgan errorsBigVGAN is only supported with F5TTS_BaseUse --model F5TTS_Base, or stay on Vocos with F5TTS_v1_Base
Wrong pronunciation in another languageBase weights are Chinese + EnglishLoad a SHARED.md community checkpoint for the language

FAQ

Is F5-TTS free for commercial use? The code is MIT, but the pretrained weights are CC-BY-NC-4.0, so no — not with the official checkpoints. Chatterbox (MIT) and Kokoro (Apache-2.0) are the commercial-safe alternatives in the comparison table.

Which model name should I use? F5TTS_v1_Base is the default in both the CLI and the Python API. F5TTS_Base is the older checkpoint and the only one that works with the BigVGAN vocoder; E2TTS_Base is the E2 TTS reproduction.

How long should the reference audio be? Under 12 seconds with about a second of silence at the end, per the inference README. Longer clips are clipped to ~12 s automatically.

Does it run on a Mac? Yes: install the stable torch torchaudio, and the API selects mps automatically. The README does not publish Apple speed figures.

Does it stream? Not from the Python API; the CLI and Gradio app chunk long text and generate chunk by chunk, which you can replicate in your own code.

Where does it download the model? From SWivid/F5-TTS on Hugging Face into ~/.cache/huggingface/hub on first run; the Docker command mounts a volume there so you only download once.


Sources (all fetched September 22, 2026): SWivid/F5-TTS README | Inference README | SHARED.md community checkpoints | api.py | Hugging Face SWivid/F5-TTS | F5-TTS paper | ComfyUI-F5-TTS

Related guides:

🎯
AI Learning Path

Voice working locally? Build the whole pipeline.

Whisper, TTS, and voice cloning wired into real projects — hands-on courses. First chapter free, no card.

Or own it for life — Lifetime $149 $599, pay once
Once your hardware is sorted

Replace the speech-AI subscription

Local Speech Studio covers TTS, voice cloning and transcription end to end — including which licences actually let you sell what you make.

$149 once unlocks everything, forever — about $0.27/chapter for life. Prefer to spread it out? Pro is $79/year (saves 27%) or $8.99/month.
Secure checkout by Lemon Squeezy — your card never touches this siteInstant access the moment you payFirst chapter of every course is free — try before you buy

Liked this? 25 full AI courses are waiting.

From fundamentals to RAG, agents, MCP servers, voice AI, and production deployment with real GitHub repos. First chapter free, every course.

Reading now
Join the discussion
Tagsf5-ttsvoice cloningttsflow matchingopen sourceaudiospeech synthesis

Barsha Mohapatra

Local AI Master writes hands-on courses and hardware guides for running AI on machines you own. Content is checked against current releases and corrected when readers tell us it is wrong.

Build Real AI on Your Machine

RAG, agents, NLP, vision, and MLOps - chapters across 25 courses that take you from reading about AI to building AI.

Want the structured version?

Hands-on courses on local AI, from $8.99 a month. The first chapter of each is free.

AI Learning Path
More on Local Voice & Speech
See the full Coqui TTS & Local Voice AI guide.

Comments (0)

No comments yet. Be the first to share your thoughts!

📅 Published: May 1, 2026🔄 Last Updated: September 22, 2026✓ Manually Reviewed

Bonus kit

Ollama Docker Templates

10 one-command Docker stacks. Includes F5-TTS + LocalAI voice clone reference deploy. Included with paid plans, or free after subscribing to both Local AI Master and Little AI Master on YouTube.

See Plans →

Build Real AI on Your Machine

RAG, agents, NLP, vision, and MLOps - chapters across 25 courses that take you from reading about AI to building AI.

Was this helpful?

Barsha Mohapatra

Written by

Barsha Mohapatra

Founder and Editor, Local AI Master · Founder, Little AI Master

Founder of Little AI Master and the editor behind every course and guide on Local AI Master. Years of tutoring students taught her where AI education actually fails.

📚
Free · no account required

Grab the AI Starter Kit — career roadmap, cheat sheet, setup guide

No spam. Unsubscribe with one click.

🎯
AI Learning Path

Voice working locally? Build the whole pipeline.

Whisper, TTS, and voice cloning wired into real projects — hands-on courses. First chapter free, no card.

Or own it for life — Lifetime $149 $599, pay once
Free Tools & Calculators