Docs /Templates/ sinapsis-f5-tts

F5TTSInference

sinapsis-f5-ttsF5TTSaudioaudio_generationf5ttsspeech

Python template · sinapsis_f5_tts.templates.f5_tts_inference

Overview

Template for performing text-to-speech synthesis using the F5TTS model.

This template uses the F5TTS CLI tool to generate speech from text input. It processes text packets from the input container, generates corresponding audio using F5TTS, and adds the resulting audio packets to the container.

Capabilities

Capabilities: not set

Installation

Install the published package using pip or uv.

Terminalbash
pip install sinapsis-f5-tts==1.0.0
uv pip install sinapsis-f5-tts==1.0.0
uv add sinapsis-f5-tts==1.0.0

Configuration

Effective fields from the inspector schema, including nested Pydantic model fields.

model

The model name to use for synthesis. Options include 'F5TTS_v1_Base', 'F5TTS_Base', 'E2TTS_Base', etc. Default is 'F5TTS_v1_Base'.

str
Optional
Default: "F5TTS_v1_Base"
speed

The speed of the generated audio. Values > 1.0 speed up the audio, values < 1.0 slow it down. Default is 1.0.

float
Optional
Default: 1
device

Specify the device to run inference on (e.g., 'cuda:0', 'cpu'). Default is None, which uses the system's default device.

str | None
Optional
Default: null
metadata
sinapsis_core.template_base.base_models.TemplateMetadata | None
Optional
Default: null
nfe_step

The number of function evaluation steps (denoising steps) to perform during inference. Higher values may produce better quality at the cost of speed. Default is 32.

int
Optional
Default: 32
ref_text

The transcript/subtitle for the reference audio. Default is a space character. When left empty, the system will attempt to extract text from the audio automatically. It's recommended to leave this empty for automatic extraction.

str
Optional
Default: " "
root_dir
str | None
Optional
Default: null
ckpt_file

Path to model checkpoint file (.pt). If None, the default checkpoint will be used.

str | None
Optional
Default: null
model_cfg

Path to the F5-TTS model config file (.yaml). If None, the default configuration will be used.

str | None
Optional
Default: null
ref_audioRequired

Path to the reference audio file. This is required to clone the voice characteristics.

str
Required
Default: null
save_chunk

Whether to save each audio chunk during inference. Useful for debugging or analyzing the generation process. Default is False.

bool
Optional
Default: false
target_rms

Target output speech loudness normalization value. Controls the volume of the output. Default is None.

float | None
Optional
Default: null
vocab_file

Path to vocabulary file (.txt). If None, the default vocabulary will be used.

str | None
Optional
Default: null
cfg_strength

Classifier-free guidance strength. Controls how closely the output follows the reference voice. Default is 2.0.

float
Optional
Default: 2
fix_duration

Fix the total duration (reference and generated audios) in seconds. Default is None.

float | None
Optional
Default: null
vocoder_name

The vocoder to use for audio generation. Options are 'vocos' or 'bigvgan'. Default is 'vocos'.

typing.Literal['vocos', 'bigvgan']
Optional
Default: "vocos"
remove_silence

Whether to remove long silence found in the output. Default is False.

bool
Optional
Default: false
sway_sampling_coef

Sway Sampling coefficient for controlling variability in the generated speech. Default is -1.0.

float
Optional
Default: -1
cross_fade_duration

Duration of cross-fade between audio segments in seconds. Used when generating longer audio that requires multiple segments. Default is 0.15.

float
Optional
Default: 0.15
load_vocoder_from_local

Whether to load the vocoder from a local directory (default: ../checkpoints/vocos-mel-24khz) instead of downloading it. Default is False.

bool
Optional
Default: false

Configuration example

Example from the Python docstring:

yaml
agent:
  name: my_test_agent
templates:
- template_name: InputTemplate
  class_name: InputTemplate
  attributes: {}
- template_name: F5TTSInference
  class_name: F5TTSInference
  template_input: InputTemplate
  attributes:
    model: F5TTS_v1_Base
    model_cfg: null
    ckpt_file: null
    vocab_file: null
    ref_audio: '`replace_me:<class ''str''>`'
    ref_text: ' '
    vocoder_name: vocos
    load_vocoder_from_local: false
    nfe_step: 32
    cfg_strength: 2.0
    cross_fade_duration: 0.15
    speed: 1.0
    sway_sampling_coef: -1.0
    target_rms: null
    fix_duration: null
    remove_silence: false
    save_chunk: false
    device: null
Show schema-based configuration skeleton
yaml
templates:
  - template_name: "F5TTSInference"
    class_name: "F5TTSInference"
    attributes:
      model: "F5TTS_v1_Base"
      speed: 1
      device: null
      nfe_step: 32
      ref_text: " "
      root_dir: null
      ckpt_file: null
      model_cfg: null
      ref_audio: "<required>"
      save_chunk: false
      target_rms: null
      vocab_file: null
      cfg_strength: 2
      fix_duration: null
      vocoder_name: "vocos"
      remove_silence: false
      sway_sampling_coef: -1
      cross_fade_duration: 0.15
      load_vocoder_from_local: false

Inheritance

Immediate parent: sinapsis_core.template_base.template.Template

Environment variables

Environment definitions belong to their canonical Python modules.

SINAPSIS_CACHE_DIR · defined elsewhere