# stable-audio-open

Stability AI's Stable Audio Open 1.0 — text-to-audio latent diffusion.
Strong on SFX, foley, ambience, short loops. Not a music model — it
does not generate intelligible vocals or structured songs (use
`ace-step` for that).

| | |
|---|---|
| host | `irv-ml1` |
| port | `8211` |
| GPU | A6000 (`device_ids: ["1"]`) |
| VRAM | ~6 GB in fp16 |
| max clip | 47 s at 44.1 kHz |
| upstream | https://github.com/Stability-AI/stable-audio-tools |
| model | `stabilityai/stable-audio-open-1.0` (gated) |
| license | Stability AI Community (non-commercial / personal / research) |

## API surface

`server.py` (custom FastAPI shim) exposes:

- `GET /health` — returns 200 once the model is loaded.
- `POST /v1/audio/sfx` — returns a `audio/wav` blob.

```jsonc
{
  "prompt": "a vintage typewriter clacking in a quiet room",
  "negative_prompt": "Low quality.",   // optional, default "Low quality."
  "duration": 10.0,                     // seconds, 0.5 – 47
  "steps": 100,                         // 10 – 300, more = better quality
  "seed": 42,                           // optional
  "cfg_scale": 7.0                      // 0 – 20
}
```

Why a custom shim: there's no upstream Docker image and no upstream
HTTP server for Stable Audio Open. Diffusers exposes
`StableAudioPipeline` cleanly — the shim is ~70 lines.

## Deploy

```bash
scripts/elway irv-ml1 --playbook playbooks/deploy-stable-audio-open.yaml
```

Pre-deploy: visit https://huggingface.co/stabilityai/stable-audio-open-1.0
once and accept the Community License (HF token alone is not enough —
the gate is per-model). Then put the token in `SAO_HF_TOKEN` in `.env`
on the host.

## Tunables

See `.env.example` — copy to `.env` on the host (lives at
`/opt/docker/compose/stable-audio-open/.env`, gitignored).
