# Seedream 5.5 Layerize

> Seedream 5.5 decomposes an image into a base image and independently editable PNG layers, with layer positions, stacking order, and optional text recognition.


## Overview

- **Endpoint**: `https://fal.run/bytedance/seedream/v5.5/layerize`
- **Model ID**: `bytedance/seedream/v5.5/layerize`
- **Category**: image-to-image
- **Kind**: inference
**Tags**: image-layers, image-decomposition, transparency



## Pricing

Billing is calculated per returned output image, including the base image and every separated layer, plus **$0.012** for the input image once per request. Each output costs **$0.03** at **1K** or **1.5K**, or **$0.0405** at **2K**. With **auto** resolution, the base image determines the rate for all outputs: **$0.03** each up to and including **2,610,000 pixels**, or **$0.0405** each above that area. For example, a request returning **3 images total** (one base image and two layers) costs **$0.102** at 1.5K or **$0.1335** at 2K.

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`, _optional_):
  Optional instructions describing which elements to separate. When empty, the model automatically separates the major elements. Normalized `<bbox>left top right bottom</bbox>` tags may be used for precise coordinate targeting. Default value: `""`
  - Default: `""`
  - Examples: "Return name and description in english."

- **`image_url`** (`string`, _required_):
  URL of the image to decompose into a base image and independently editable layers. The image must contain between 512x512 and 6000x6000 total pixels, have an aspect ratio between 1/16 and 16, and be no larger than 30 MB.
  - Examples: "https://storage.googleapis.com/falserverless/example_inputs/kontext_example_input.webp"

- **`image_size`** (`ImageSizeEnum`, _optional_):
  Resolution tier for the output base image and layers. `auto` adapts to the input image while preserving each element's aspect ratio. Default value: `"auto"`
  - Default: `"auto"`
  - Options: `"auto"`, `"auto_1K"`, `"auto_1.5K"`, `"auto_2K"`
  - Examples: "auto"

- **`max_images`** (`integer`, _optional_):
  Maximum number of output images, including the base image. Higher values usually produce a finer decomposition. Above 30, images are always returned as URLs and `sync_mode` is ignored. Default value: `30`
  - Default: `30`
  - Range: `2` to `100`

- **`enable_text_recognition`** (`boolean`, _optional_):
  If `True`, formatted text layers include a rich-text OCR result in `text_recognition`.
  - Default: `false`

- **`output_format`** (`OutputFormatEnum`, _optional_):
  Format of the base image. Separated layers always use PNG. Default value: `"png"`
  - Default: `"png"`
  - Options: `"jpeg"`, `"png"`

- **`watermark`** (`boolean`, _optional_):
  Whether to add the provider's visible watermark.
  - Default: `false`

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

- **`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. Default value: `true`
  - Default: `true`
  - Examples: true



**Required Parameters Example**:

```json
{
  "image_url": "https://storage.googleapis.com/falserverless/example_inputs/kontext_example_input.webp"
}
```

**Full Example**:

```json
{
  "prompt": "Return name and description in english.",
  "image_url": "https://storage.googleapis.com/falserverless/example_inputs/kontext_example_input.webp",
  "image_size": "auto",
  "max_images": 30,
  "output_format": "png",
  "enable_safety_checker": true
}
```


### Output Schema

The API returns the following output format:

- **`images`** (`list<Image>`, _required_):
  The same images as `layers`, in the same order, flattened for gallery rendering.
  - Array of Image

- **`layers`** (`list<SeedDream55Layer>`, _required_):
  The base image followed by up to 99 separated layers, ordered by increasing z_index.
  - Array of SeedDream55Layer



**Example Response**:

```json
{
  "images": [
    {
      "url": "",
      "content_type": "image/png",
      "file_name": "z9RV14K95DvU.png",
      "file_size": 4404019,
      "width": 1024,
      "height": 1024
    }
  ],
  "layers": [
    {
      "image": {
        "url": "",
        "content_type": "image/png",
        "file_name": "z9RV14K95DvU.png",
        "file_size": 4404019,
        "width": 1024,
        "height": 1024
      }
    }
  ]
}
```


## Usage Examples

### cURL

```bash
curl --request POST \
  --url https://fal.run/bytedance/seedream/v5.5/layerize \
  --header "Authorization: Key $FAL_KEY" \
  --header "Content-Type: application/json" \
  --data '{
     "image_url": "https://storage.googleapis.com/falserverless/example_inputs/kontext_example_input.webp"
   }'
```

### 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(
    "bytedance/seedream/v5.5/layerize",
    arguments={
        "image_url": "https://storage.googleapis.com/falserverless/example_inputs/kontext_example_input.webp"
    },
    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("bytedance/seedream/v5.5/layerize", {
  input: {
    image_url: "https://storage.googleapis.com/falserverless/example_inputs/kontext_example_input.webp"
  },
  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);
```


## Deploy your own model

To run your own weights, a fine-tune or a custom pipeline on the GPUs that serve this API, deploy it on fal Serverless. GPUs from H100 (80GB) to B300 (288GB), billed per second; an H100 is $4.50/h list, as low as $2.49/h. Prices, GPU specs and deploy steps: [fal Serverless](https://fal.ai/serverless.md).

## Additional Resources

### Documentation

- [Model Playground](https://fal.ai/models/bytedance/seedream/v5.5/layerize)
- [API Documentation](https://fal.ai/models/bytedance/seedream/v5.5/layerize/api)
- [OpenAPI Schema](https://fal.ai/api/openapi/queue/openapi.json?endpoint_id=bytedance/seedream/v5.5/layerize)

### 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
- [Pricing](https://fal.ai/pricing.md): Model API and Serverless GPU prices
- [fal Serverless](https://fal.ai/serverless.md): Deploy your own models: GPU prices, specs and steps
- Any other model: `https://fal.ai/models/<endpoint-id>/llms.txt`
