DEDUPED Hot AI repos. Real use cases. What people build. Get the Monday 5

How to generate speech in a reference voice from the CLI with F5 TTS

Install the package and run one command with your reference audio and the text you want spoken.

Short answer: Create an environment with conda create -n f5-tts python=3.11 and conda activate f5-tts, then install FFmpeg with conda install ffmpeg; then install PyTorch and torchaudio for your device as the README lists, then install the package with pip install f5-tts; run f5-tts_infer-cli --model F5TTS_v1_Base with --ref_audio, --ref_text and --gen_text set to your clip, its transcript and your text. All steps.

  • Top pick
  • Content
  • Intermediate
  • 1 hour
  • From the README
  • Claude Code
  • Codex
  • Cursor
  • Gemini CLI

Voice cloning. Only clone a voice you have permission to use.

platform. The pre-trained models are licensed CC-BY-NC because of the Emilia training data, while the code is MIT.

Who it is forA developer adding narration to a script or a build pipeline.

The problemHosted TTS costs per character and sends your text to someone else.

The outcomeAn audio file speaking your text in the reference voice.

What you need first

  • Python 3.10 or newer, for example a conda env created with `conda create -n f5-tts python=3.11`
  • PyTorch and torchaudio matched to your device, plus FFmpeg
  • A reference WAV clip of the voice you want, and its transcript if you do not want ASR to transcribe it
  • A GPU for comfortable speed; the published benchmarks use a single L20

Steps

  1. Create an environment with conda create -n f5-tts python=3.11 and conda activate f5-tts, then install FFmpeg with conda install ffmpeg
  2. Install PyTorch and torchaudio for your device as the README lists, then install the package with pip install f5-tts
  3. Run f5-tts_infer-cli --model F5TTS_v1_Base with --ref_audio, --ref_text and --gen_text set to your clip, its transcript and your text
  4. Leave --ref_text "" to have an ASR model transcribe the clip instead, at the cost of extra GPU memory

Prompt for your agent

Using SWivid/F5-TTS, set up the environment, install `pip install f5-tts` and run f5-tts_infer-cli with my reference clip and transcript to read <my script>, saving the audio.

Caveat. Read the detailed inference guidance linked in the README before tuning quality.

Use this in your AI agent

Ask your agent

Using the Deduped MCP, get the setup steps for SWivid/F5-TTS and "Generate speech in a reference voice from the CLI"

Add Deduped to Claude Code once

claude mcp add --transport http deduped https://dedupedai.com/mcp

Cursor, ChatGPT, others

Share: X LinkedIn Hacker News Email Copy link

Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer