LuxTTS README

The project's README from github.com/ysharma3501/LuxTTS. As one markdown file: README.md.

LuxTTS

Hugging Face Model   Hugging Face Space   Colab Notebook

LuxTTS is an lightweight zipvoice based text-to-speech model designed for high quality voice cloning and realistic generation at speeds exceeding 150x realtime.

https://github.com/user-attachments/assets/a3b57152-8d97-43ce-bd99-26dc9a145c29

The main features are

Usage

You can try it locally, colab, or spaces.

Open In Colab Open in Spaces

Simple installation:

git clone https://github.com/ysharma3501/LuxTTS.git
cd LuxTTS
pip install -r requirements.txt

Load model:

from zipvoice.luxvoice import LuxTTS

# load model on GPU
lux_tts = LuxTTS('YatharthS/LuxTTS', device='cuda')

# load model on CPU
# lux_tts = LuxTTS('YatharthS/LuxTTS', device='cpu', threads=2)

# load model on MPS for macs
# lux_tts = LuxTTS('YatharthS/LuxTTS', device='mps')

Simple inference

import soundfile as sf
from IPython.display import Audio

text = "Hey, what's up? I'm feeling really great if you ask me honestly!"

## change this to your reference file path, can be wav/mp3
prompt_audio = 'audio_file.wav'

## encode audio(takes 10s to init because of librosa first time)
encoded_prompt = lux_tts.encode_prompt(prompt_audio, rms=0.01)

## generate speech
final_wav = lux_tts.generate_speech(text, encoded_prompt, num_steps=4)

## save audio
final_wav = final_wav.numpy().squeeze()
sf.write('output.wav', final_wav, 48000)

## display speech
if display is not None:
  display(Audio(final_wav, rate=48000))

Inference with sampling params:

import soundfile as sf
from IPython.display import Audio

text = "Hey, what's up? I'm feeling really great if you ask me honestly!"

## change this to your reference file path, can be wav/mp3
prompt_audio = 'audio_file.wav'

rms = 0.01 ## higher makes it sound louder(0.01 or so recommended)
t_shift = 0.9 ## sampling param, higher can sound better but worse WER
num_steps = 4 ## sampling param, higher sounds better but takes longer(3-4 is best for efficiency)
speed = 1.0 ## sampling param, controls speed of audio(lower=slower)
return_smooth = False ## sampling param, makes it sound smoother possibly but less cleaner
ref_duration = 5 ## Setting it lower can speedup inference, set to 1000 if you find artifacts.

## encode audio(takes 10s to init because of librosa first time)
encoded_prompt = lux_tts.encode_prompt(prompt_audio, duration=ref_duration, rms=rms)

## generate speech
final_wav = lux_tts.generate_speech(text, encoded_prompt, num_steps=num_steps, t_shift=t_shift, speed=speed, return_smooth=return_smooth)

## save audio
final_wav = final_wav.numpy().squeeze()
sf.write('output.wav', final_wav, 48000)

## display speech
if display is not None:
  display(Audio(final_wav, rate=48000))

Tips

Community

Thanks to all community contributions!

Info

Q: How is this different from ZipVoice?

A: LuxTTS uses the same architecture but distilled to 4 steps with an improved sampling technique. It also uses a custom 48khz vocoder instead of the default 24khz version.

Q: Can it be even faster?

A: Yes, currently it uses float32. Float16 should be significantly faster(almost 2x).

Roadmap

Acknowledgments

Final Notes

The model and code are licensed under the Apache-2.0 license. See LICENSE for details.

Stars/Likes would be appreciated, thank you.

Email: [email protected]

LuxTTS (ysharma3501/LuxTTS)

Searching Database…

5.5K ·GitHub
这是什么?LuxTTS 是一个基于 ZipVoice 架构构建的轻量级文本转语音模型,专为高质量的声音克隆和快速语音生成而设计。
这是独立应用,还是需要我自己集成的模型/库?这是一个需要你自行加载和运行的模型及代码库(可在本地、Colab 或 Spaces 上运行);社区还提供了独立的 Gradio 和 ComfyUI 前端。
我该怎么让它运行起来?用类似 pip 的简单方式安装,然后加载模型并运行推理,也可以选择自定义采样参数。
任何音频片段都能用来做声音克隆吗?参考音频至少需要 3 秒;如果克隆出的语音听起来有金属感,可以开启平滑选项;此外,'tshift' 参数可以在发音准确度和音质之间进行权衡。
它能在 Apple Silicon 芯片的 Mac 上运行吗?可以,除了默认的 GPU/CPU 运行方式外,现已发布 MPS(Apple Silicon GPU)支持。
LuxTTS 和 ZipVoice 有什么不同?LuxTTS 采用相同的架构,但经过蒸馏,只需 4 个采样步骤,并使用了改进的采样技术;另外,它将默认的 24kHz 声码器替换为定制的 48kHz 声码器,以获得更清晰的音质。
推理还能更快吗?可以。目前它以 float32 运行;切换到 float16 应该能带来近 2 倍的加速,这一点已列入路线图计划。
它能生成什么样的音质?它可以输出清晰的 48kHz 语音,保真度高于大多数通常限于 24kHz 的文本转语音模型。
有没有不用写代码就能试用 LuxTTS 的现成应用?有。社区开发了 Lux-TTS-Gradio、OptiSpeech(一款界面简洁的应用)、LuxTTS-Comfyui 节点、ONNX 版本,以及 FalAI 上的托管演示。
What are similar projects?MOSS-TTS-Nano, OpenVoice, dia, MOSS-TTS, csm, bark, DramaBox, FireRedAudio
Size
0.1 MB
Stars
5.5K
Updated
CommitJun 05
Age
8mo
Commits · 90 Days