# Mirelo SFX1.6

> Erase and replace any moment in your audio with AI-driven precision.


## Overview

- **Endpoint**: `https://fal.run/mirelo-ai/sfx1.6/inpaint-audio`
- **Model ID**: `mirelo-ai/sfx1.6/inpaint-audio`
- **Category**: audio-to-audio
- **Kind**: inference
**Tags**: audio-to-audio, sfx



## Pricing

- **Price**: $0.01 per seconds

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:


- **`audio_url`** (`string`, _required_):
  URL of the source audio. Maximum 10 seconds — longer clips are rejected. The model regenerates only the region defined by `segment`; everything outside it is preserved.
  - Examples: "https://di3otfzjg1gxa.cloudfront.net/forest-ambience-10s.wav"

- **`segment`** (`AudioSegmentSpec`, _required_):
  Region [start_s, end_s] (in seconds, 1s ≤ start < end ≤ 10s, 1–8s span) to regenerate. The audio outside this region is preserved.
  - Examples: {"start_s":2,"end_s":6}

- **`text_prompt`** (`string`, _optional_):
  Optional text prompt guiding the regenerated segment.

- **`num_samples`** (`integer`, _optional_):
  Number of variations to generate. Default value: `1`
  - Default: `1`
  - Range: `1` to `4`

- **`seed`** (`integer`, _optional_):
  Seed for generation. -1 or None for random.

- **`upload_audio_format`** (`UploadAudioFormatEnum`, _optional_):
  Audio format for the returned files. Default value: `"wav"`
  - Default: `"wav"`
  - Options: `"wav"`, `"mp3"`, `"aac"`, `"flac"`



**Required Parameters Example**:

```json
{
  "audio_url": "https://di3otfzjg1gxa.cloudfront.net/forest-ambience-10s.wav",
  "segment": {
    "start_s": 2,
    "end_s": 6
  }
}
```

**Full Example**:

```json
{
  "audio_url": "https://di3otfzjg1gxa.cloudfront.net/forest-ambience-10s.wav",
  "segment": {
    "start_s": 2,
    "end_s": 6
  },
  "num_samples": 1,
  "upload_audio_format": "wav"
}
```


### Output Schema

The API returns the following output format:

- **`audio`** (`list<Audio>`, _required_):
  Source audio with the requested segment regenerated; audio outside the segment is preserved.
  - Array of Audio
  - Examples: [{"content_type":"audio/wav","file_name":"inpainted_audio_1.wav","url":"https://di3otfzjg1gxa.cloudfront.net/forest-ambience-10s.wav"}]



**Example Response**:

```json
{
  "audio": [
    {
      "content_type": "audio/wav",
      "file_name": "inpainted_audio_1.wav",
      "url": "https://di3otfzjg1gxa.cloudfront.net/forest-ambience-10s.wav"
    }
  ]
}
```


## Usage Examples

### cURL

```bash
curl --request POST \
  --url https://fal.run/mirelo-ai/sfx1.6/inpaint-audio \
  --header "Authorization: Key $FAL_KEY" \
  --header "Content-Type: application/json" \
  --data '{
     "audio_url": "https://di3otfzjg1gxa.cloudfront.net/forest-ambience-10s.wav",
     "segment": {
       "start_s": 2,
       "end_s": 6
     }
   }'
```

### 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(
    "mirelo-ai/sfx1.6/inpaint-audio",
    arguments={
        "audio_url": "https://di3otfzjg1gxa.cloudfront.net/forest-ambience-10s.wav",
        "segment": {
            "start_s": 2,
            "end_s": 6
        }
    },
    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("mirelo-ai/sfx1.6/inpaint-audio", {
  input: {
    audio_url: "https://di3otfzjg1gxa.cloudfront.net/forest-ambience-10s.wav",
    segment: {
      start_s: 2,
      end_s: 6
    }
  },
  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/mirelo-ai/sfx1.6/inpaint-audio)
- [API Documentation](https://fal.ai/models/mirelo-ai/sfx1.6/inpaint-audio/api)
- [OpenAPI Schema](https://fal.ai/api/openapi/queue/openapi.json?endpoint_id=mirelo-ai/sfx1.6/inpaint-audio)

### fal.ai Platform

- [Platform Documentation](https://docs.fal.ai)
- [Python Client](https://docs.fal.ai/clients/python)
- [JavaScript Client](https://docs.fal.ai/clients/javascript)
