F5TTSInference
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 setInstallation
Install the published package using pip or uv.
pip install sinapsis-f5-tts==1.0.0uv pip install sinapsis-f5-tts==1.0.0uv add sinapsis-f5-tts==1.0.0Configuration
Effective fields from the inspector schema, including nested Pydantic model fields.
The model name to use for synthesis. Options include 'F5TTS_v1_Base', 'F5TTS_Base', 'E2TTS_Base', etc. Default is 'F5TTS_v1_Base'.
Optional
Default: "F5TTS_v1_Base"
The speed of the generated audio. Values > 1.0 speed up the audio, values < 1.0 slow it down. Default is 1.0.
Optional
Default: 1
Specify the device to run inference on (e.g., 'cuda:0', 'cpu'). Default is None, which uses the system's default device.
Optional
Default: null
Optional
Default: null
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.
Optional
Default: 32
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.
Optional
Default: " "
Optional
Default: null
Path to model checkpoint file (.pt). If None, the default checkpoint will be used.
Optional
Default: null
Path to the F5-TTS model config file (.yaml). If None, the default configuration will be used.
Optional
Default: null
Path to the reference audio file. This is required to clone the voice characteristics.
Required
Default: null
Whether to save each audio chunk during inference. Useful for debugging or analyzing the generation process. Default is False.
Optional
Default: false
Target output speech loudness normalization value. Controls the volume of the output. Default is None.
Optional
Default: null
Path to vocabulary file (.txt). If None, the default vocabulary will be used.
Optional
Default: null
Classifier-free guidance strength. Controls how closely the output follows the reference voice. Default is 2.0.
Optional
Default: 2
Fix the total duration (reference and generated audios) in seconds. Default is None.
Optional
Default: null
The vocoder to use for audio generation. Options are 'vocos' or 'bigvgan'. Default is 'vocos'.
Optional
Default: "vocos"
Whether to remove long silence found in the output. Default is False.
Optional
Default: false
Sway Sampling coefficient for controlling variability in the generated speech. Default is -1.0.
Optional
Default: -1
Duration of cross-fade between audio segments in seconds. Used when generating longer audio that requires multiple segments. Default is 0.15.
Optional
Default: 0.15
Whether to load the vocoder from a local directory (default: ../checkpoints/vocos-mel-24khz) instead of downloading it. Default is False.
Optional
Default: false
Configuration example
Example from the Python docstring:
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: nullShow schema-based configuration skeleton
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
sinapsis_core.template_base.template.TemplateEnvironment variables
Environment definitions belong to their canonical Python modules.