Перейти к содержанию

VoiceHubf5tts

F5TTS

Supplies F5-TTS with the mandatory reference waveform and matching transcript.

Text to speechVoiceHub-nativef5ttsParameters: 337.1MLanguages: en, zhTraining: preprocessedLicense: Checkpoint-specific

Parameter metadata: Exact learned-parameter total for VoiceHub's audited native primary graph at the registered default selection; separately loaded auxiliary models are excluded.

Usage

Complete the VoiceHub installation once, then run this repository-authored example. Model pages intentionally contain no package-install command.

This example is maintained against VoiceHub's public API; it is not copied from an upstream demo or package README.

Model-specific path: Supplies F5-TTS with the mandatory reference waveform and matching transcript.

Inputs and controls: The transcript must match the reference audio exactly or alignment quality will degrade.

from pathlib import Path

from voicehub import AutoModelForTextToSpeech, TTSGenerationConfig

REFERENCE_AUDIO = Path("reference.wav")
REFERENCE_TEXT = "The reference transcript must exactly match the authorized audio."
if not REFERENCE_AUDIO.is_file():
    raise FileNotFoundError(REFERENCE_AUDIO)

model = AutoModelForTextToSpeech.from_pretrained(
    'F5TTS_v1_Base',
    model_type='f5tts',
    device="cuda",
    lazy_load=True,
)
output = model.generate(
    'VoiceHub keeps model integrations explicit and reproducible.',
    generation_config=TTSGenerationConfig(
        seed=42,
        output_file=Path("output.wav"),
    ),
    speaker_audio_path=str(REFERENCE_AUDIO),
    reference_text=REFERENCE_TEXT,
    nfe_steps=32,
    cfg_strength=2.0,
)
print(output.file_path, output.sample_rate, output.metadata)

Use authorized recordings. Verify hardware needs and pin a revision in production.

Overview

f5tts is a VoiceHub text to speech integration. This page is generated from its registry contract.

Property Value
Task Text to speech
Architecture f5tts
Runtime VoiceHub-native
Languages en, zh
Capabilities text-to-speech, voice-cloning, fine-tuning, flow-matching, safetensors, voicehub-native, native-runtime
Reusable components vocos
Normalized output TTSOutput

Language support

Supported language abbreviations

en, zh

Paper and GitHub

Configuration

Load configuration without constructing the model:

from voicehub import AutoConfig

config = AutoConfig.for_model('f5tts')
print(config.model_type)
Property Value
Canonical model type f5tts
Configuration class F5TTSConfig
Architecture class F5TTSForTextToSpeech

Processing

Create the registered processor without allocating model weights:

from voicehub import AutoProcessor

processor = AutoProcessor.from_pretrained(
    'F5TTS_v1_Base',
    model_type='f5tts',
)
print(type(processor).__name__)

Inference

The Usage example returns TTSOutput through AutoModelForTextToSpeech.

Input and output contract

Property Value
Readiness preprocessed
Data architecture diffusion
Sample rate 24,000 Hz
Contract getter get_tts_dataset_spec('f5tts')
Variant Required fields One of Boundary Other rules
waveform-vocab input_values, input_ids — Prepared —
mel-features input_ids mel / mel_spec Prepared —
native-ready inp, text — Prepared —

Conditional flow-matching, rectified-flow, or diffusion data. See the data workflow.

Training and optimization

Use available_optimization_passes() to discover reversible public passes. Unsupported runtime or hardware fails closed before mutation.

Training contract

Property Value
Support preprocessed
Family flow-matching
Recipe single-phase
Default phase flow
Training checkpoint F5TTS_v1_Base
Native training graph yes
Phase Kind Components Required inputs Loss keys
flow objective model.ema_model inp, text loss

Prepare the exact tensors listed in the data contract before this step. Call model.validate_training_support() first, then follow the training workflow.

Checkpoints, provenance, license, and limitations

Property Value
Default checkpoint F5TTS_v1_Base
Hugging Face ID SWivid/F5-TTS
Official F5-TTS repository, verified available on 2026-08-11; the registry alias selects the F5TTS_v1_Base files inside it.
Checkpoint status Registry default; pin an immutable revision for production and reproducible evidence
Optional dependency extra Core package
Hardware and runtime Usage selects cuda; verify checkpoint-specific requirements
Real-checkpoint evidence Release evidence; a registry default alone is not execution evidence
Implementation voicehub.models.f5tts.modeling_f5tts.F5TTSForTextToSpeech
Configuration voicehub.models.f5tts.configuration_f5tts.F5TTSConfig
Source provenance voicehub/models/f5tts/source/SOURCE.json
License Checkpoint-specific

No VoiceHub-specific license override is registered. Verify the checkpoint and upstream source terms before use.

Confirm the checkpoint revision, access terms, provenance, and license.

Limitations

  • No integration-specific checkpoint limitation is registered. Verify the selected checkpoint revision and its documented runtime requirements.
  • Validate memory, precision, and optional dependencies on the target system.
  • Public optimizations fail closed when the runtime or hardware cannot satisfy their validation contract; an unavailable pass is not reported as applied.
  • Contract tests do not replace the linked released-checkpoint evidence.

Public API

Use the stable configuration, processor, and task-model facades below.

Configuration

F5TTSConfig

View source

F5TTSConfig(**config_kwargs)

Parameters

  • **config_kwargs — Configuration fields validated by F5TTSConfig.

Model

F5TTSForTextToSpeech

View source

AutoModelForTextToSpeech.from_pretrained(
    pretrained_model_name_or_path,
    *,
    model_type='f5tts',
    config=None,
    **model_kwargs,
)

Parameters

  • pretrained_model_name_or_path — Hub ID or compatible local directory.
  • model_type — Canonical model type; use 'f5tts'.
  • config — Optional preloaded F5TTSConfig instance.
  • **model_kwargs — Model-specific loading arguments.
from voicehub import get_model_spec

spec = get_model_spec('f5tts')
print(spec.display_name, spec.task.value)
Purpose Public object
Discover get_model_spec('f5tts')
Load and run AutoModelForTextToSpeech
Configure F5TTSConfig
Process AutoProcessor
Model implementation F5TTSForTextToSpeech
Normalized output TTSOutput
Training contract get_training_spec('f5tts')
Optimization lifecycle available_optimization_passes, apply_optimization_plan, optimization_manifest, restore_optimization_plan

See all model guides, inference, and the training matrix.