# DreamOmni2

> DreamOmni2 is a unified multimodal model for text and image guided image editing.


## Overview

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


## Pricing

Your request will cost **$0.05** per image. For **$1.00**, you can run this model **20 times.**

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:


- **`image_urls`** (`list<string>`, _required_):
  List of URLs of input images for editing.
  - Array of string
  - Examples: ["https://v3b.fal.media/files/b/koala/HB33rtG0ue7KzcIdQOTTX_dreamomni_ref_0.jpg","https://v3b.fal.media/files/b/koala/BJMlXeNzOgGzyoO7XyGxr_dreamomni_ref_1.jpg"]

- **`prompt`** (`string`, _required_):
  The prompt to edit the image.
  - Examples: "Replace the first image have the same image style as the second image."



**Required Parameters Example**:

```json
{
  "image_urls": [
    "https://v3b.fal.media/files/b/koala/HB33rtG0ue7KzcIdQOTTX_dreamomni_ref_0.jpg",
    "https://v3b.fal.media/files/b/koala/BJMlXeNzOgGzyoO7XyGxr_dreamomni_ref_1.jpg"
  ],
  "prompt": "Replace the first image have the same image style as the second image."
}
```


### Output Schema

The API returns the following output format:

- **`image`** (`Image`, _required_):
  Generated image
  - Examples: {"url":"https://v3b.fal.media/files/b/koala/prmop69b1g5lNFPE4RbCb_c9ab07096fdd47269a60bc556e01132b.png","content_type":"image/png","file_size":1473707,"file_name":"c9ab07096fdd47269a60bc556e01132b.png"}



**Example Response**:

```json
{
  "image": {
    "url": "https://v3b.fal.media/files/b/koala/prmop69b1g5lNFPE4RbCb_c9ab07096fdd47269a60bc556e01132b.png",
    "content_type": "image/png",
    "file_size": 1473707,
    "file_name": "c9ab07096fdd47269a60bc556e01132b.png"
  }
}
```


## Usage Examples

### cURL

```bash
curl --request POST \
  --url https://fal.run/fal-ai/dreamomni2/edit \
  --header "Authorization: Key $FAL_KEY" \
  --header "Content-Type: application/json" \
  --data '{
     "image_urls": [
       "https://v3b.fal.media/files/b/koala/HB33rtG0ue7KzcIdQOTTX_dreamomni_ref_0.jpg",
       "https://v3b.fal.media/files/b/koala/BJMlXeNzOgGzyoO7XyGxr_dreamomni_ref_1.jpg"
     ],
     "prompt": "Replace the first image have the same image style as the second image."
   }'
```

### 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/dreamomni2/edit",
    arguments={
        "image_urls": ["https://v3b.fal.media/files/b/koala/HB33rtG0ue7KzcIdQOTTX_dreamomni_ref_0.jpg", "https://v3b.fal.media/files/b/koala/BJMlXeNzOgGzyoO7XyGxr_dreamomni_ref_1.jpg"],
        "prompt": "Replace the first image have the same image style as the second image."
    },
    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/dreamomni2/edit", {
  input: {
    image_urls: ["https://v3b.fal.media/files/b/koala/HB33rtG0ue7KzcIdQOTTX_dreamomni_ref_0.jpg", "https://v3b.fal.media/files/b/koala/BJMlXeNzOgGzyoO7XyGxr_dreamomni_ref_1.jpg"],
    prompt: "Replace the first image have the same image style as the second image."
  },
  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/dreamomni2/edit)
- [API Documentation](https://fal.ai/models/fal-ai/dreamomni2/edit/api)
- [OpenAPI Schema](https://fal.ai/api/openapi/queue/openapi.json?endpoint_id=fal-ai/dreamomni2/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)
