soujanyaporia commited on
Commit
511d525
·
verified ·
1 Parent(s): 3d0386b

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +78 -0
README.md ADDED
@@ -0,0 +1,78 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: mit
3
+ datasets:
4
+ - cvssp/WavCaps
5
+ cite: arxiv.org/abs/2412.21037
6
+ ---
7
+
8
+ <h1 align="center">✨
9
+ <br/>
10
+ TangoFlux: Super Fast and Faithful Text to Audio Generation with Flow Matching and Clap-Ranked Preference Optimization
11
+ <br/>
12
+ ✨✨✨
13
+
14
+
15
+ </h1>
16
+
17
+ <div align="center">
18
+ <img src="https://raw.githubusercontent.com/declare-lab/TangoFlux/refs/heads/main/assets/tf_teaser.png" alt="TangoFlux" width="1000" />
19
+
20
+ <br/>
21
+
22
+ <div style="display: flex; gap: 10px; align-items: center;">
23
+ <a href="https://openreview.net/attachment?id=tpJPlFTyxd&name=pdf">
24
+ <img src="https://img.shields.io/badge/Read_the_Paper-blue?link=https%3A%2F%2Fopenreview.net%2Fattachment%3Fid%3DtpJPlFTyxd%26name%3Dpdf" alt="arXiv">
25
+ </a>
26
+ <a href="https://huggingface.co/declare-lab/TangoFlux">
27
+ <img src="https://img.shields.io/badge/TangoFlux-Huggingface-violet?logo=huggingface&link=https%3A%2F%2Fhuggingface.co%2Fdeclare-lab%2FTangoFlux" alt="Static Badge">
28
+ </a>
29
+ <a href="https://tangoflux.github.io/">
30
+ <img src="https://img.shields.io/badge/Demos-declare--lab-brightred?style=flat" alt="Static Badge">
31
+ </a>
32
+ <a href="https://huggingface.co/spaces/declare-lab/TangoFlux">
33
+ <img src="https://img.shields.io/badge/TangoFlux-Huggingface_Space-8A2BE2?logo=huggingface&link=https%3A%2F%2Fhuggingface.co%2Fspaces%2Fdeclare-lab%2FTangoFlux" alt="Static Badge">
34
+ </a>
35
+ <a href="https://huggingface.co/datasets/declare-lab/CRPO">
36
+ <img src="https://img.shields.io/badge/TangoFlux_Dataset-Huggingface-red?logo=huggingface&link=https%3A%2F%2Fhuggingface.co%2Fdatasets%2Fdeclare-lab%2FTangoFlux" alt="Static Badge">
37
+ </a>
38
+ <a href="https://github.com/declare-lab/TangoFlux">
39
+ <img src="https://img.shields.io/badge/Github-brown?logo=github&link=https%3A%2F%2Fgithub.com%2Fdeclare-lab%2FTangoFlux" alt="Static Badge">
40
+ </a>
41
+ </div>
42
+
43
+
44
+
45
+ </div>
46
+
47
+ ## Model Overview
48
+
49
+ 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.
50
+
51
+
52
+ ## Getting Started
53
+ Download TangoFlux from our github https://github.com/declare-lab/TangoFlux
54
+ The model will be automatically downloaded and saved in cache. Subsequent runs will load the model directly from cache.
55
+
56
+ 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.
57
+
58
+ ```python
59
+ import torchaudio
60
+ from tangoflux import TangoFluxInference
61
+ from IPython.display import Audio
62
+
63
+ model = TangoFluxInference(name='declare-lab/TangoFlux-base')
64
+ audio = model.generate('Hammer slowly hitting the wooden table', steps=50, duration=10)
65
+
66
+ Audio(data=audio, rate=44100)
67
+ ```
68
+ ## Citation
69
+
70
+ ```bibtex
71
+ @article{Hung2025TangoFlux,
72
+ title = {TangoFlux: Super Fast and Faithful Text to Audio Generation with Flow Matching and Clap-Ranked Preference Optimization},
73
+ author = {Chia-Yu Hung and Navonil Majumder and Zhifeng Kong and Ambuj Mehrish and Rafael Valle and Bryan Catanzaro and Soujanya Poria},
74
+ year = {2025},
75
+ url = {https://openreview.net/attachment?id=tpJPlFTyxd&name=pdf},
76
+ note = {Available at OpenReview}
77
+ }
78
+ ```