# Stable Audio 25

> Generate high quality music and sound effects using Stable Audio 2.5 from StabilityAI


## Overview

- **Endpoint**: `https://fal.run/fal-ai/stable-audio-25/inpaint`
- **Model ID**: `fal-ai/stable-audio-25/inpaint`
- **Category**: audio-to-audio
- **Kind**: inference
**Tags**: audio



## Pricing

- **Price**: $0.2 per audios

For more details, see [fal.ai pricing](https://fal.ai/pricing).

## API Information

This model can be used via our HTTP API or more conveniently via our client libraries.
See the input and output schema below, as well as the usage examples.


### Input Schema

The API accepts the following input parameters:


- **`prompt`** (`string`, _required_):
  The prompt to guide the audio generation
  - Examples: "Lofi hip hop beat, chillhop"

- **`audio_url`** (`string`, _required_):
  The audio clip to inpaint
  - Examples: "https://v3.fal.media/files/elephant/t0ZrzW_ueetXrr3NUa87F_a2a_in.mp3"

- **`seconds_total`** (`integer`, _optional_):
  The duration of the audio clip to generate. If not provided, it will be set to the duration of the input audio. Default value: `190`
  - Default: `190`
  - Range: `1` to `190`
  - Examples: 45

- **`guidance_scale`** (`float`, _optional_):
  How strictly the diffusion process adheres to the prompt text (higher values make your audio closer to your prompt). Default value: `1`
  - Default: `1`
  - Range: `1` to `25`

- **`mask_start`** (`integer`, _optional_):
  The start point of the audio mask Default value: `30`
  - Default: `30`
  - Range: `0` to `190`
  - Examples: 15

- **`mask_end`** (`integer`, _optional_):
  The end point of the audio mask Default value: `190`
  - Default: `190`
  - Range: `0` to `190`
  - Examples: 40

- **`num_inference_steps`** (`integer`, _optional_):
  The number of steps to denoise the audio for Default value: `8`
  - Default: `8`
  - Range: `4` to `8`

- **`sync_mode`** (`boolean`, _optional_):
  If `True`, the media will be returned as a data URI and the output data won't be available in the request history.
  - Default: `false`

- **`seed`** (`integer`, _optional_)



**Required Parameters Example**:

```json
{
  "prompt": "Lofi hip hop beat, chillhop",
  "audio_url": "https://v3.fal.media/files/elephant/t0ZrzW_ueetXrr3NUa87F_a2a_in.mp3"
}
```

**Full Example**:

```json
{
  "prompt": "Lofi hip hop beat, chillhop",
  "audio_url": "https://v3.fal.media/files/elephant/t0ZrzW_ueetXrr3NUa87F_a2a_in.mp3",
  "seconds_total": 45,
  "guidance_scale": 1,
  "mask_start": 15,
  "mask_end": 40,
  "num_inference_steps": 8
}
```


### Output Schema

The API returns the following output format:

- **`audio`** (`File`, _required_):
  The generated audio clip
  - Examples: "https://v3.fal.media/files/elephant/5F2Oour2tH_EHZrFUEmM-_tmp75kuha71.wav"

- **`seed`** (`integer`, _required_):
  The random seed used for generation



**Example Response**:

```json
{
  "audio": "https://v3.fal.media/files/elephant/5F2Oour2tH_EHZrFUEmM-_tmp75kuha71.wav"
}
```


## Usage Examples

### cURL

```bash
curl --request POST \
  --url https://fal.run/fal-ai/stable-audio-25/inpaint \
  --header "Authorization: Key $FAL_KEY" \
  --header "Content-Type: application/json" \
  --data '{
     "prompt": "Lofi hip hop beat, chillhop",
     "audio_url": "https://v3.fal.media/files/elephant/t0ZrzW_ueetXrr3NUa87F_a2a_in.mp3"
   }'
```

### Python

Ensure you have the Python client installed:

```bash
pip install fal-client
```

Then use the API client to make requests:

```python
import fal_client

def on_queue_update(update):
    if isinstance(update, fal_client.InProgress):
        for log in update.logs:
           print(log["message"])

result = fal_client.subscribe(
    "fal-ai/stable-audio-25/inpaint",
    arguments={
        "prompt": "Lofi hip hop beat, chillhop",
        "audio_url": "https://v3.fal.media/files/elephant/t0ZrzW_ueetXrr3NUa87F_a2a_in.mp3"
    },
    with_logs=True,
    on_queue_update=on_queue_update,
)
print(result)
```

### JavaScript

Ensure you have the JavaScript client installed:

```bash
npm install --save @fal-ai/client
```

Then use the API client to make requests:

```javascript
import { fal } from "@fal-ai/client";

const result = await fal.subscribe("fal-ai/stable-audio-25/inpaint", {
  input: {
    prompt: "Lofi hip hop beat, chillhop",
    audio_url: "https://v3.fal.media/files/elephant/t0ZrzW_ueetXrr3NUa87F_a2a_in.mp3"
  },
  logs: true,
  onQueueUpdate: (update) => {
    if (update.status === "IN_PROGRESS") {
      update.logs.map((log) => log.message).forEach(console.log);
    }
  },
});
console.log(result.data);
console.log(result.requestId);
```


## Additional Resources

### Documentation

- [Model Playground](https://fal.ai/models/fal-ai/stable-audio-25/inpaint)
- [API Documentation](https://fal.ai/models/fal-ai/stable-audio-25/inpaint/api)
- [OpenAPI Schema](https://fal.ai/api/openapi/queue/openapi.json?endpoint_id=fal-ai/stable-audio-25/inpaint)

### fal.ai Platform

- [Platform Documentation](https://fal.ai/docs/documentation)
- [Python Client](https://fal.ai/docs/api-reference/client-libraries/python)
- [JavaScript Client](https://fal.ai/docs/api-reference/client-libraries/javascript)

### Other agent-readable surfaces

This file covers one model. To find anything else:

- [Platform overview](https://fal.ai/llms.txt): Entry points and representative endpoint IDs
- [Documentation index](https://fal.ai/docs/llms.txt): Every documentation page
- [Full documentation text](https://fal.ai/docs/llms-full.txt): The whole documentation inlined
- Any other model: `https://fal.ai/models/<endpoint-id>/llms.txt`
