feat: add Stable Audio 3 text-to-audio model#746
Draft
shreyaskarnik wants to merge 5 commits into
Draft
Conversation
Adds support for Stability AI's Stable Audio 3 diffusion-based text-to-audio model, capable of generating stereo 44.1kHz audio (sound effects and music up to 30s) from text prompts. Architecture: DiT backbone (20 layers, 1024d) + SAME autoencoder (4096x downsampling) + T5Gemma text encoder (768d conditioning). Supports Euler and ping-pong samplers with classifier-free guidance. Converted weights uploaded to: - mlx-community/stable-audio-3-small-sfx - mlx-community/stable-audio-3-small-music
Collaborator
|
@shreyaskarnik What's the status here? Are you still working on this? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
model_config.jsonfallback toload_config()(SA3's HF repo uses this instead ofconfig.json)--duration,--sampler, and--seedCLI args togenerate.pyConverted weights
Uploaded to HuggingFace:
mlx-community/stable-audio-3-small-sfx— sound effectsmlx-community/stable-audio-3-small-music— music generationUsage
Python API
Architecture notes
sanitize(): Handles weight normalization merging (weight_g + weight_v → weight), Conv1d transposition (PyTorch → MLX layout), and is idempotent for already-converted weightsTest plan
mlx_audio.convertpipelinemlx_audio.convertpipelinepython -m mlx_audio.tts.generate)load()+generate_audio())mlx-community/stable-audio-3-small-sfx)model.sanitize()is idempotent (runs on already-converted weights without corruption)