# DreamO

> DreamO is an image customization framework designed to support a wide range of tasks while facilitating seamless integration of multiple conditions.


## Overview

- **Endpoint**: `https://fal.run/fal-ai/dreamo`
- **Model ID**: `fal-ai/dreamo`
- **Category**: text-to-image
- **Kind**: inference
**Tags**: stylized, realism



## Pricing

- **Price**: $0.05 per megapixels

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 generate an image from.
  - Examples: "Two people hugging inside a forest"

- **`first_image_url`** (`string`, _optional_):
  URL of first reference image to use for generation.
  - Examples: "https://v3.fal.media/files/rabbit/I3exImt_zOYaiZv8caeGP_Pz4CnQ12tCUuDIhEQkmbD_ae4193792924495e89c516e6b492ed2b_1.jpg"

- **`second_image_url`** (`string`, _optional_):
  URL of second reference image to use for generation.
  - Examples: "https://v3.fal.media/files/penguin/F3Yqprwlv-yaeusxAS0bS_image.webp"

- **`first_reference_task`** (`FirstReferenceTaskEnum`, _optional_):
  Task for first reference image (ip/id/style). Default value: `"ip"`
  - Default: `"ip"`
  - Options: `"ip"`, `"id"`, `"style"`

- **`second_reference_task`** (`SecondReferenceTaskEnum`, _optional_):
  Task for second reference image (ip/id/style). Default value: `"ip"`
  - Default: `"ip"`
  - Options: `"ip"`, `"id"`, `"style"`

- **`image_size`** (`ImageSize | Enum`, _optional_):
  The size of the generated image. Default value: `square_hd`
  - Default: `"square_hd"`
  - One of: ImageSize | Enum

- **`num_inference_steps`** (`integer`, _optional_):
  The number of inference steps to perform. Default value: `12`
  - Default: `12`
  - Range: `1` to `50`

- **`seed`** (`integer`, _optional_):
  The same seed and the same prompt given to the same version of the model
  will output the same image every time.

- **`guidance_scale`** (`float`, _optional_):
  The CFG (Classifier Free Guidance) scale is a measure of how close you want
  the model to stick to your prompt when looking for a related image to show you. Default value: `3.5`
  - Default: `3.5`
  - Range: `0` to `20`

- **`negative_prompt`** (`string`, _optional_):
  The prompt to generate an image from. Default value: `""`
  - Default: `""`
  - Examples: "bad quality, worst quality, text, signature, watermark, extra limbs"

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

- **`ref_resolution`** (`integer`, _optional_):
  Resolution for reference images. Default value: `512`
  - Default: `512`
  - Range: `512` to `1024`

- **`true_cfg`** (`float`, _optional_):
  The weight of the CFG loss. Default value: `1`
  - Default: `1`
  - Range: `1` to `5`

- **`enable_safety_checker`** (`boolean`, _optional_):
  If set to true, the safety checker will be enabled. Disabling it requires account authorization; unauthorized requests are always checked, and images flagged as unsafe are returned as black images. Default value: `true`
  - Default: `true`



**Required Parameters Example**:

```json
{
  "prompt": "Two people hugging inside a forest"
}
```

**Full Example**:

```json
{
  "prompt": "Two people hugging inside a forest",
  "first_image_url": "https://v3.fal.media/files/rabbit/I3exImt_zOYaiZv8caeGP_Pz4CnQ12tCUuDIhEQkmbD_ae4193792924495e89c516e6b492ed2b_1.jpg",
  "second_image_url": "https://v3.fal.media/files/penguin/F3Yqprwlv-yaeusxAS0bS_image.webp",
  "first_reference_task": "ip",
  "second_reference_task": "ip",
  "image_size": "square_hd",
  "num_inference_steps": 12,
  "guidance_scale": 3.5,
  "negative_prompt": "bad quality, worst quality, text, signature, watermark, extra limbs",
  "ref_resolution": 512,
  "true_cfg": 1,
  "enable_safety_checker": true
}
```


### Output Schema

The API returns the following output format:

- **`images`** (`list<Image>`, _required_):
  The URLs of the generated images.
  - Array of Image
  - Examples: [{"content_type":"image/jpeg","height":1024,"width":1024,"url":"https://v3.fal.media/files/elephant/Qqd29dv20375fBbN1233_.png"}]

- **`timings`** (`Timings`, _required_)

- **`seed`** (`integer`, _required_):
  Seed of the generated Image. It will be the same value of the one passed in the
  input or the randomly generated that was used in case none was passed.

- **`has_nsfw_concepts`** (`list<boolean>`, _required_):
  Whether the generated images contain NSFW concepts.
  - Array of boolean

- **`prompt`** (`string`, _required_):
  The prompt used to generate the image.
  - Examples: "Two people hugging inside a forest"



**Example Response**:

```json
{
  "images": [
    {
      "content_type": "image/jpeg",
      "height": 1024,
      "width": 1024,
      "url": "https://v3.fal.media/files/elephant/Qqd29dv20375fBbN1233_.png"
    }
  ],
  "prompt": "Two people hugging inside a forest"
}
```


## Usage Examples

### cURL

```bash
curl --request POST \
  --url https://fal.run/fal-ai/dreamo \
  --header "Authorization: Key $FAL_KEY" \
  --header "Content-Type: application/json" \
  --data '{
     "prompt": "Two people hugging inside a forest"
   }'
```

### 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/dreamo",
    arguments={
        "prompt": "Two people hugging inside a forest"
    },
    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/dreamo", {
  input: {
    prompt: "Two people hugging inside a forest"
  },
  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/dreamo)
- [API Documentation](https://fal.ai/models/fal-ai/dreamo/api)
- [OpenAPI Schema](https://fal.ai/api/openapi/queue/openapi.json?endpoint_id=fal-ai/dreamo)

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