TangoFlux
Go to file
xxl 7715eed601 first commit 2025-01-10 13:19:23 +08:00
.gitattributes Add .gitattributes 2025-01-10 12:47:19 +08:00
LICENSE.md first commit 2025-01-10 12:57:39 +08:00
README.md first commit 2025-01-10 12:57:39 +08:00
STABILITY_AI_COMMUNITY_LICENSE.md first commit 2025-01-10 12:57:39 +08:00
config.json first commit 2025-01-10 12:57:39 +08:00
handler.py first commit 2025-01-10 12:57:39 +08:00
model.py first commit 2025-01-10 12:57:39 +08:00
requirements.txt first commit 2025-01-10 12:57:39 +08:00
tangoflux first commit 2025-01-10 12:57:39 +08:00
tangoflux.safetensors first commit 2025-01-10 13:19:23 +08:00
vae.safetensors first commit 2025-01-10 12:57:39 +08:00

README.md

datasets cite pipeline_tag
cvssp/WavCaps
arxiv.org/abs/2412.21037 text-to-audio


TangoFlux: Super Fast and Faithful Text to Audio Generation with Flow Matching and Clap-Ranked Preference Optimization

  • Powered by Stability AI

Model Overview

TangoFlux consists of FluxTransformer blocks which are Diffusion Transformer (DiT) and Multimodal Diffusion Transformer (MMDiT), conditioned on textual prompt and duration embedding to generate audio at 44.1kHz up to 30 seconds. TangoFlux learns a rectified flow trajectory from audio latent representation encoded by a variational autoencoder (VAE). The TangoFlux training pipeline consists of three stages: pre-training, fine-tuning, and preference optimization. TangoFlux is aligned via CRPO which iteratively generates new synthetic data and constructs preference pairs to perform preference optimization.

Getting Started

Get TangoFlux from our GitHub repo https://github.com/declare-lab/TangoFlux with

pip install git+https://github.com/declare-lab/TangoFlux

The model will be automatically downloaded and saved in a cache. The subsequent runs will load the model directly from the cache.

The generate function uses 25 steps by default to sample from the flow model. We recommend using 50 steps for generating better quality audios. This comes at the cost of increased run-time.

import torchaudio
from tangoflux import TangoFluxInference
from IPython.display import Audio

model = TangoFluxInference(name='declare-lab/TangoFlux')
audio = model.generate('Hammer slowly hitting the wooden table', steps=50, duration=10)

Audio(data=audio, rate=44100)

License

The TangoFlux checkpoints are for non-commercial research use only. They are subject to the Stable Audio Opens license, WavCaps license, and the original licenses accompanying each training dataset.

This Stability AI Model is licensed under the Stability AI Community License, Copyright © Stability AI Ltd. All Rights Reserved

Citation

https://arxiv.org/abs/2412.21037

@misc{hung2024tangofluxsuperfastfaithful,
      title={TangoFlux: Super Fast and Faithful Text to Audio Generation with Flow Matching and Clap-Ranked Preference Optimization}, 
      author={Chia-Yu Hung and Navonil Majumder and Zhifeng Kong and Ambuj Mehrish and Rafael Valle and Bryan Catanzaro and Soujanya Poria},
      year={2024},
      eprint={2412.21037},
      archivePrefix={arXiv},
      primaryClass={cs.SD},
      url={https://arxiv.org/abs/2412.21037}, 
}