StableAudioPipeline isn't reentrant — concurrent requests share the scheduler's step_index counter and corrupt each other mid-run (observed: IndexError in cosine_dpmsolver_multistep when two requests overlap). Wrap the pipeline call + audio decode in a single asyncio.Lock created at startup, and run the (sync, GPU-bound) pipeline call via asyncio.to_thread so the event loop stays responsive. Concurrent requests now queue cleanly instead of racing. Verified: 5 parallel POSTs at steps=50 all return 200, clear ~4s serialization spacing (4, 8, 12, 16, 20s wall time), distinct output hashes per seed.
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 aaudio/wavblob.
{
"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
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).