{"id":17744952,"url":"https://github.com/lucasnewman/f5-tts-mlx","last_synced_at":"2025-05-15T20:03:05.627Z","repository":{"id":257824152,"uuid":"871838289","full_name":"lucasnewman/f5-tts-mlx","owner":"lucasnewman","description":"Implementation of F5-TTS in MLX","archived":false,"fork":false,"pushed_at":"2025-03-19T02:10:28.000Z","size":723,"stargazers_count":536,"open_issues_count":2,"forks_count":56,"subscribers_count":12,"default_branch":"main","last_synced_at":"2025-05-15T20:03:03.152Z","etag":null,"topics":["diffusion-transformer","flow-matching","mlx","text-to-speech","tts"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lucasnewman.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-10-13T04:43:17.000Z","updated_at":"2025-05-14T03:53:12.000Z","dependencies_parsed_at":"2024-10-23T04:43:36.764Z","dependency_job_id":"0bbfb05a-7986-437c-9991-03f2ed925743","html_url":"https://github.com/lucasnewman/f5-tts-mlx","commit_stats":null,"previous_names":["lucasnewman/f5-tts-mlx"],"tags_count":23,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucasnewman%2Ff5-tts-mlx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucasnewman%2Ff5-tts-mlx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucasnewman%2Ff5-tts-mlx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucasnewman%2Ff5-tts-mlx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lucasnewman","download_url":"https://codeload.github.com/lucasnewman/f5-tts-mlx/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254414493,"owners_count":22067271,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["diffusion-transformer","flow-matching","mlx","text-to-speech","tts"],"created_at":"2024-10-26T07:01:28.380Z","updated_at":"2025-05-15T20:03:04.815Z","avatar_url":"https://github.com/lucasnewman.png","language":"Python","funding_links":[],"categories":["Python","Audio \u0026 Speech"],"sub_categories":[],"readme":"![F5 TTS diagram](f5tts.jpg)\n\n# F5 TTS — MLX\n\nImplementation of [F5-TTS](https://arxiv.org/abs/2410.06885), with the [MLX](https://github.com/ml-explore/mlx) framework.\n\nF5 TTS is a non-autoregressive, zero-shot text-to-speech system using a flow-matching mel spectrogram generator with a diffusion transformer (DiT).\n\nYou can listen to a [sample here](https://s3.amazonaws.com/lucasnewman.datasets/f5tts/sample.wav) that was generated in ~4 seconds on an M3 Max MacBook Pro.\n\nF5 is an evolution of [E2 TTS](https://arxiv.org/abs/2406.18009v2) and improves performance with ConvNeXT v2 blocks for the learned text alignment. This repository is based on the original Pytorch implementation available [here](https://github.com/SWivid/F5-TTS).\n\n## Installation\n\n```bash\npip install f5-tts-mlx\n```\n\n## Basic Usage\n\n```bash\npython -m f5_tts_mlx.generate --text \"The quick brown fox jumped over the lazy dog.\"\n```\n\nYou can also use a pipe to generate speech from the output of another process, for instance from a language model:\n\n```bash\nmlx_lm.generate --model mlx-community/Llama-3.2-1B-Instruct-4bit --verbose false \\\n --temp 0 --max-tokens 512 --prompt \"Write a concise paragraph explaining wavelets.\" \\\n| python -m f5_tts_mlx.generate\n```\n\n## Voice Matching\n\nIf you want to use your own reference audio sample, make sure it's a mono, 24kHz wav file of around 5-10 seconds:\n\n```bash\npython -m f5_tts_mlx.generate \\\n--text \"The quick brown fox jumped over the lazy dog.\" \\\n--ref-audio /path/to/audio.wav \\\n--ref-text \"This is the caption for the reference audio.\"\n```\n\nYou can convert an audio file to the correct format with ffmpeg like this:\n\n```bash\nffmpeg -i /path/to/audio.wav -ac 1 -ar 24000 -sample_fmt s16 -t 10 /path/to/output_audio.wav\n```\n\nSee [here](./f5_tts_mlx) for more options to customize generation.\n\n## Quantized Models\n\nIf you're in a bandwidth or memory-limited environment, you can use the `--q` option to load a quantized version of the model. 4-bit and 8-bit variants are supported.\n\n```bash\npython -m f5_tts_mlx.generate --text \"The quick brown fox jumped over the lazy dog.\" --q 4\n```\n\n## From Python\n\nYou can load a pretrained model from Python:\n\n```python\nfrom f5_tts_mlx.generate import generate\n\naudio = generate(text = \"Hello world.\", ...)\n```\n\nPretrained model weights are also available [on Hugging Face](https://huggingface.co/lucasnewman/f5-tts-mlx).\n\n## Appreciation\n\n[Yushen Chen](https://github.com/SWivid) for the original Pytorch implementation of F5 TTS and pretrained model.\n\n[Phil Wang](https://github.com/lucidrains) for the E2 TTS implementation that this model is based on.\n\n## Citations\n\n```bibtex\n@article{chen-etal-2024-f5tts,\n      title={F5-TTS: A Fairytaler that Fakes Fluent and Faithful Speech with Flow Matching}, \n      author={Yushen Chen and Zhikang Niu and Ziyang Ma and Keqi Deng and Chunhui Wang and Jian Zhao and Kai Yu and Xie Chen},\n      journal={arXiv preprint arXiv:2410.06885},\n      year={2024},\n}\n```\n\n```bibtex\n@inproceedings{Eskimez2024E2TE,\n    title   = {E2 TTS: Embarrassingly Easy Fully Non-Autoregressive Zero-Shot TTS},\n    author  = {Sefik Emre Eskimez and Xiaofei Wang and Manthan Thakker and Canrun Li and Chung-Hsien Tsai and Zhen Xiao and Hemin Yang and Zirun Zhu and Min Tang and Xu Tan and Yanqing Liu and Sheng Zhao and Naoyuki Kanda},\n    year    = {2024},\n    url     = {https://api.semanticscholar.org/CorpusID:270738197}\n}\n```\n\n## License\n\nThe code in this repository is released under the MIT license as found in the\n[LICENSE](LICENSE) file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flucasnewman%2Ff5-tts-mlx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flucasnewman%2Ff5-tts-mlx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flucasnewman%2Ff5-tts-mlx/lists"}