LiteFocus
1.0.0
LiteFocus:用於長音頻合成的加速擴散推理
譚振雄、馬欣銀、方功凡、王新超
新加坡國立大學學習與視覺實驗室
LiteFocus 是一款旨在加速基於擴散的 TTA 模型的工具,現已透過基礎模型 AudioLDM2 實現。它使處理速度加倍並提高音訊品質。
conda create -n litefocus python=3.10
conda activate litefocus
pip3 install git+https://github.com/haoheliu/AudioLDM2.git
from audioldm2 import text_to_audio, build_model
import scipy
+ from litefocus import inject_lite_focus, disable_lite_focus
model = build_model(model_name='audioldm2-full')
+ inject_lite_focus(model)
waveform = text_to_audio(
latent_diffusion=model,
duration=40,
text='Musical constellations twinkling in the night sky, forming a cosmic melody.',
)
scipy.io.wavfile.write("out.wav", rate=16000, data=waveform)
disable_lite_focus ( model )
config = {
'same_frequency' : True ,
'cross_frequency' : True ,
'sparse_ratio' : 0.1
}
inject_lite_focus ( model , config )
範圍 | 描述 | 預設值 |
---|---|---|
same_frequency | 使人們能夠關注共享相同頻率的代幣。 | True |
cross_frequency | 能夠關注跨頻補償中的令牌。 | True |
sparse_ratio | 指定cross_frequency 的稀疏率。 | 0.1 |
@article{
tan2024lite,
title={LiteFocus: Accelerated Diffusion Inference for Long Audio Synthesis},
author={Zhenxiong Tan, Xinyin Ma, Gongfan Fang, and Xinchao Wang},
journal={arXiv preprint arXiv:2407.10468},
year={2024}
}