stability-ai/stable-audio-2.5

Generate high-quality music and sound from text prompts, with optional audio continuation/inpainting 🎵🛠️

Public
131 runs

Stable Audio 2.5 on Replicate 🎵

Overview 🔊

Stable Audio 2.5 turns plain‑text prompts into high‑quality audio. It can also continue from an input clip (inpainting/continuation), letting you extend ideas or fill gaps seamlessly.

Quick start (Python) 🐍

1) Install the client and set your API token

pip install replicate
export REPLICATE_API_TOKEN={{REPLICATE_API_TOKEN}}

2) Generate audio from a text prompt

import replicate

MODEL = "stability-ai/stable-audio-2.5:sha256:46a2601577d0e31aa99b03c9d7fd2142fa3b96a282338758f794b620e35c75b7"  # pinned for reproducibility

out = replicate.run(
    MODEL,
    input={
        "prompt": "A beautiful piano melody in C major",
        "duration": 10,      # seconds
        "steps": 8,          # quality vs speed
        "cfg_scale": 6       # prompt adherence
    }
)
print(out)  # URL or list of URLs to the generated audio

3) Save the first URL to disk (if output is a list)

import requests
url = out[0] if isinstance(out, (list, tuple)) else out
with requests.get(url, stream=True) as r:
    r.raise_for_status()
    with open("output.wav", "wb") as f:
        for chunk in r.iter_content(chunk_size=8192):
            f.write(chunk)
print("Saved to output.wav")

Inputs (common)

  • prompt (string): description of the audio you want
  • duration (number): output duration in seconds
  • steps (int): inference steps (higher can improve quality but is slower)
  • cfg_scale (number): prompt adherence (higher = stricter)
  • seed (int, optional): set for reproducible results
  • audio (file/url, optional): provide an input clip for continuation/inpainting

Tip: For quick iteration, try duration 5–10s and steps ~8.

Terms of Use 📚

Use responsibly. Do not generate or share unlawful, harmful, or infringing content, including: - Illegal content or content that violates others’ rights - Non‑consensual impersonation or deepfakes - Content intended to harass or incite harm

Disclaimer ‼️

Provided “as is,” without warranties. You are responsible for complying with all applicable laws, third‑party rights, and licenses. The underlying weights and project may include additional license restrictions from Stability AI.