# Reve

> Reve’s fast edit model lets you upload an existing image and then transform it via a text prompt at lightning speed!


## Overview

- **Endpoint**: `https://fal.run/fal-ai/reve/fast/edit`
- **Model ID**: `fal-ai/reve/fast/edit`
- **Category**: image-to-image
- **Kind**: inference
**Tags**: image-to-image



## Pricing

- **Price**: $0.01 per images

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 text description of how to edit the provided image.
  - Examples: "Make it nighttime with stars glistening behind the mountain"

- **`image_url`** (`string`, _required_):
  URL of the reference image to edit. Must be publicly accessible or base64 data URI. Supports PNG, JPEG, WebP, AVIF, and HEIF formats.
  - Examples: "https://v3b.fal.media/files/b/rabbit/Wi1oWbMfigpUMP0w_i5fm_-WnGcaJCtfrT6Q2oms97E.png"

- **`num_images`** (`integer`, _optional_):
  Number of images to generate Default value: `1`
  - Default: `1`
  - Range: `1` to `4`
  - Examples: 1

- **`output_format`** (`OutputFormatEnum`, _optional_):
  Output format for the generated image. Default value: `"png"`
  - Default: `"png"`
  - Options: `"png"`, `"jpeg"`, `"webp"`
  - Examples: "png"

- **`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`



**Required Parameters Example**:

```json
{
  "prompt": "Make it nighttime with stars glistening behind the mountain",
  "image_url": "https://v3b.fal.media/files/b/rabbit/Wi1oWbMfigpUMP0w_i5fm_-WnGcaJCtfrT6Q2oms97E.png"
}
```

**Full Example**:

```json
{
  "prompt": "Make it nighttime with stars glistening behind the mountain",
  "image_url": "https://v3b.fal.media/files/b/rabbit/Wi1oWbMfigpUMP0w_i5fm_-WnGcaJCtfrT6Q2oms97E.png",
  "num_images": 1,
  "output_format": "png"
}
```


### Output Schema

The API returns the following output format:

- **`images`** (`list<Image>`, _required_):
  The edited images
  - Array of Image
  - Examples: [{"url":"https://v3b.fal.media/files/b/zebra/eTDkfnubKKq9S-hDxvH2g.png"}]



**Example Response**:

```json
{
  "images": [
    {
      "url": "https://v3b.fal.media/files/b/zebra/eTDkfnubKKq9S-hDxvH2g.png"
    }
  ]
}
```


## Usage Examples

### cURL

```bash
curl --request POST \
  --url https://fal.run/fal-ai/reve/fast/edit \
  --header "Authorization: Key $FAL_KEY" \
  --header "Content-Type: application/json" \
  --data '{
     "prompt": "Make it nighttime with stars glistening behind the mountain",
     "image_url": "https://v3b.fal.media/files/b/rabbit/Wi1oWbMfigpUMP0w_i5fm_-WnGcaJCtfrT6Q2oms97E.png"
   }'
```

### 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/reve/fast/edit",
    arguments={
        "prompt": "Make it nighttime with stars glistening behind the mountain",
        "image_url": "https://v3b.fal.media/files/b/rabbit/Wi1oWbMfigpUMP0w_i5fm_-WnGcaJCtfrT6Q2oms97E.png"
    },
    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/reve/fast/edit", {
  input: {
    prompt: "Make it nighttime with stars glistening behind the mountain",
    image_url: "https://v3b.fal.media/files/b/rabbit/Wi1oWbMfigpUMP0w_i5fm_-WnGcaJCtfrT6Q2oms97E.png"
  },
  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/reve/fast/edit)
- [API Documentation](https://fal.ai/models/fal-ai/reve/fast/edit/api)
- [OpenAPI Schema](https://fal.ai/api/openapi/queue/openapi.json?endpoint_id=fal-ai/reve/fast/edit)

### 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)
