Files
vllm-omni/examples/offline_inference/fish_speech
3158e9d28f [Entrypoint][Refactor] vLLM-Omni Entrypoint Refactoring (#1908)
Signed-off-by: yinpe <11810305@mail.sustech.edu.cn>
Signed-off-by: Peiqi Yin <yinpeiqi809@gmail.com>
Signed-off-by: yinpeiqi <yinpeiqi809@gmail.com>
Signed-off-by: wuhang <whlbx@hotmail.com>
Signed-off-by: linyueqian <linyueqian@outlook.com>
Signed-off-by: princepride <wangzhipeng628@gmail.com>
Signed-off-by: lishunyang <lishunyang12@163.com>
Signed-off-by: Chenguang ZHENG <645327136@qq.com>
Signed-off-by: Peiqi Yin <60515999+yinpeiqi@users.noreply.github.com>
Co-authored-by: yinpe <11810305@mail.sustech.edu.cn>
Co-authored-by: Peiqi Yin <yinpeiqi809@gmail.com>
Co-authored-by: wuhang <whlbx@hotmail.com>
Co-authored-by: Peiqi Yin <60515999+yinpeiqi@users.noreply.github.com>
Co-authored-by: linyueqian <linyueqian@outlook.com>
Co-authored-by: princepride <wangzhipeng628@gmail.com>
Co-authored-by: lishunyang <lishunyang12@163.com>
2026-03-18 17:33:53 +08:00
..

Fish Speech S2 Pro

This directory contains an offline demo for running Fish Speech S2 Pro (fishaudio/s2-pro) with vLLM Omni. It supports text-only synthesis and voice cloning with reference audio.

Model Overview

Fish Speech S2 Pro is a 4B dual-AR text-to-speech model by FishAudio. It uses:

  • Slow AR: Generates semantic tokens autoregressively (Qwen3-based backbone)
  • Fast AR: Predicts residual codebook tokens from semantic tokens
  • DAC Decoder: Converts codec codes to 44.1 kHz audio waveform

The model produces high-quality speech with voice cloning capabilities.

Prerequisites

Install the fish-speech package for the DAC codec:

pip install fish-speech

Setup

Please refer to the stage configuration documentation to configure memory allocation appropriately for your hardware setup.

Quick Start

Text-Only Synthesis

python end2end.py --text "Hello, this is a test of the Fish Speech text to speech system."

Generated audio files are saved to output_audio/ by default.

Voice Cloning

Provide a reference audio file and its transcript to clone a voice:

python end2end.py \
    --text "Hello, this is a cloned voice." \
    --ref-audio /path/to/reference.wav \
    --ref-text "Transcript of the reference audio."

Streaming Mode

Add --streaming to stream audio chunks progressively via AsyncOmni (requires async_chunk: true in the stage config):

python end2end.py --text "Hello, this is a test." --streaming

Each DAC decoder chunk is logged as it arrives. The final WAV file is written once generation completes.

Configuration

Argument Default Description
--text "Hello, this is a test..." Text to synthesize
--ref-audio None Path to reference audio for voice cloning
--ref-text None Transcript of the reference audio
--model fishaudio/s2-pro HuggingFace model path
--stage-configs-path fish_speech_s2_pro.yaml Path to stage configs YAML
--output-dir output_audio Output directory for WAV files
--streaming False Enable streaming via AsyncOmni
--stage-init-timeout 600 Stage initialization timeout (seconds)

Notes

  • Output audio is 44.1 kHz mono WAV.
  • The DAC codec weights (codec.pth) are loaded lazily from the model directory.
  • Voice cloning encodes the reference audio using the DAC codec to extract semantic codes, then prepends them as a system message.