{"id":51190242,"url":"https://github.com/sandst1/stable-audio-mlx","last_synced_at":"2026-06-27T14:30:54.298Z","repository":{"id":355798826,"uuid":"1112943182","full_name":"sandst1/stable-audio-mlx","owner":"sandst1","description":"MLX port of the stable-audio-open-small model + a sampler and cmd-line app built on top of it","archived":false,"fork":false,"pushed_at":"2026-01-28T08:28:50.000Z","size":9789,"stargazers_count":7,"open_issues_count":0,"forks_count":2,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-05T10:51:54.908Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sandst1.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2025-12-09T10:05:35.000Z","updated_at":"2026-03-07T20:18:39.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/sandst1/stable-audio-mlx","commit_stats":null,"previous_names":["sandst1/stable-audio-mlx"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/sandst1/stable-audio-mlx","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sandst1%2Fstable-audio-mlx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sandst1%2Fstable-audio-mlx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sandst1%2Fstable-audio-mlx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sandst1%2Fstable-audio-mlx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sandst1","download_url":"https://codeload.github.com/sandst1/stable-audio-mlx/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sandst1%2Fstable-audio-mlx/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34857480,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-27T02:00:06.362Z","response_time":126,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2026-06-27T14:30:53.251Z","updated_at":"2026-06-27T14:30:54.284Z","avatar_url":"https://github.com/sandst1.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Stable Audio MLX\n\nText-to-audio generation using Stability AI's [stable-audio-open-small](https://huggingface.co/stabilityai/stable-audio-open-small) model, optimized for Apple Silicon using the MLX framework.\n\n![Sampler UI](sampler.png)\n\n## Features\n\n- **CLI Audio Generation** (`generate.py`) - Generate audio from text prompts via command line\n- **Interactive Sampler UI** (`sampler.py`) - PyQt6-based keyboard sampler for real-time playback\n\n## Setup\n\n### 1. Create Virtual Environment\n\n```bash\npython -m venv .venv\nsource .venv/bin/activate\n```\n\n### 2. Install Dependencies\n\n```bash\npip install -r requirements.txt\n```\n\n### 3. Get Model Access\n\nThe model requires accepting the license on Hugging Face:\n\n1. Visit [stable-audio-open-1.0](https://huggingface.co/stabilityai/stable-audio-open-1.0) and accept the license (name + email required)\n2. Visit [stable-audio-open-small](https://huggingface.co/stabilityai/stable-audio-open-small) and accept the license\n\n### 4. Login to Hugging Face\n\n```bash\nhuggingface-cli login\n```\n\nEnter your Hugging Face access token when prompted.\n\n### 5. Download and Convert Model\n\n```bash\npython src/conversion/convert.py\n```\n\nThis will:\n- Download `model.safetensors` and `model_config.json` from Hugging Face\n- Download T5 text encoder weights\n- Convert weights to MLX format (`model/stable_audio_small.npz`)\n\n## Usage\n\n### CLI Audio Generation\n\nGenerate audio from a text prompt:\n\n```bash\npython generate.py --prompt \"warm arpeggios on house beats 120BPM with drums\"\n```\n\n#### Options\n\n| Option | Default | Description |\n|--------|---------|-------------|\n| `--prompt` | (required) | Text description of the audio to generate |\n| `--negative-prompt` | `\"\"` | Negative prompt for CFG guidance |\n| `--seconds` | `5.0` | Audio duration in seconds |\n| `--steps` | `8` | Inference steps (8-30 recommended) |\n| `--cfg-scale` | `6.0` | Classifier-free guidance scale |\n| `--seed` | random | Random seed for reproducibility |\n| `--sampler` | `euler` | Sampler method: `euler` (faster) or `rk4` (higher quality) |\n| `--cpu` | false | Force CPU inference |\n\n#### Examples\n\n```bash\n# Basic generation\npython generate.py --prompt \"ambient pad with reverb\"\n\n# Longer duration with more steps\npython generate.py --prompt \"techno kick drum loop\" --seconds 10 --steps 30\n\n# Reproducible output with seed\npython generate.py --prompt \"jazz piano chords\" --seed 42\n\n# Higher quality with RK4 sampler\npython generate.py --prompt \"orchestral strings\" --sampler rk4 --steps 20\n```\n\nOutput files are saved as `{prompt}_seed_{seed}.wav` (44.1kHz stereo WAV).\n\n### Interactive Sampler UI\n\nLaunch the keyboard sampler interface:\n\n```bash\npython sampler.py\n```\n\n#### Controls\n\n1. **Set BPM** - Adjust the tempo slider (60-200 BPM)\n2. **Set Duration** - Choose audio length (2-10 seconds)\n3. **Enter Prompt** - Describe the sound you want\n4. **Click Generate** - Wait for audio generation\n5. **Play with Keyboard** - Hold keys to play, release to stop\n\n#### Keyboard Layout\n\n| Key | Note | Key | Note |\n|-----|------|-----|------|\n| `a` | C4 | `w` | C#4 |\n| `s` | D4 | `e` | D#4 |\n| `d` | E4 | | |\n| `f` | F4 | `t` | F#4 |\n| `g` | G4 | `y` | G#4 |\n| `h` | A4 | `u` | A#4 |\n| `j` | B4 | | |\n| `k` | C5 | | |\n\n#### MIDI Input\n\nConnect a MIDI keyboard and select it from the **MIDI Input** dropdown. Notes C4-C5 (MIDI notes 60-72) map to the same notes as the computer keyboard. Click **Refresh** to rescan for newly connected devices.\n\n#### Keyboard Modes\n\n- **Position Mode** - Each key plays from a different position in the sample\n- **Pitch Mode** - Each key plays from the start with chromatic pitch shifting\n\n## Requirements\n\n- macOS with Apple Silicon (M1/M2/M3)\n- Python 3.10+\n- ~4-6GB RAM for inference\n\n## License\n\nModel weights are subject to [Stability AI's license](https://huggingface.co/stabilityai/stable-audio-open-small).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsandst1%2Fstable-audio-mlx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsandst1%2Fstable-audio-mlx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsandst1%2Fstable-audio-mlx/lists"}