> ## Documentation Index
> Fetch the complete documentation index at: https://docs.comfy.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Use Seedream 5.5 261028 with Comfy Router

> Call byteplus/seedream-5-5-261028 through Comfy Router: endpoint, request shape and the response Router returns.

API Reference for `byteplus/seedream-5-5-261028`, served by Comfy Router from BytePlus.

**Input:** Text, Image · **Output:** Image

## Quick start

Create a key in [your Comfy workspace](https://platform.comfy.org/profile/api-keys?onboarding=router) and export it as `COMFY_API_KEY`. The Python and TypeScript snippets use the Comfy SDKs (`pip install comfy-sdk` and `npm install @comfyorg/sdk`); the cURL snippet is the same call over raw HTTP.

**Model ID:** `byteplus/seedream-5-5-261028`

**Endpoint:** `POST https://api.comfy.org/v2/models/byteplus/seedream-5-5-261028`

> [tab] Wait for the result
>
> ```python Python theme={null}
> from comfy_sdk import Comfy
>
> # Reads COMFY_API_KEY from the environment.
> # The SDK automatically creates an idempotency key and reuses it for automatic retries.
> with Comfy() as client:
>     result = client.models.run(
>         "byteplus/seedream-5-5-261028",
>         {
>             "prompt": "A red fox trotting through a snowy pine forest, cinematic lighting",
>             "response_format": "url",
>             "watermark": False,
>         },
>     )
>
> print(result)
> ```
>
> ```typescript TypeScript theme={null}
> import { comfy } from "@comfyorg/sdk";
>
> // Reads COMFY_API_KEY from the environment.
> // The SDK automatically creates an idempotency key and reuses it for automatic retries.
> const { data } = await comfy.models.run("byteplus/seedream-5-5-261028", {
>   prompt: "A red fox trotting through a snowy pine forest, cinematic lighting",
>   response_format: "url",
>   watermark: false,
> });
>
> console.log(data);
> ```
>
> ```bash cURL theme={null}
> curl https://api.comfy.org/v2/models/byteplus/seedream-5-5-261028 \
>   -H "X-API-Key: $COMFY_API_KEY" \
>   -H "Idempotency-Key: $(uuidgen)" \
>   -H "Content-Type: application/json" \
>   -d "{\"prompt\": \"A red fox trotting through a snowy pine forest, cinematic lighting\", \"response_format\": \"url\", \"watermark\": false}"
> ```

> [tab] Queue and collect later
>
> The same body, sent to `POST https://api.comfy.org/v2/models/byteplus/seedream-5-5-261028/requests`. Router answers `201` with a `request_id` as soon as the run is admitted, and the result is collected once it is ready, from this process or another one. [Queued delivery](https://docs.comfy.org/development/comfy-router/queue.md) walks through status, cancellation and collection.
>
> ```python Python theme={null}
> import asyncio
> from comfy_sdk import AsyncComfy
>
> # Reads COMFY_API_KEY from the environment.
> # Each submit() call mints its own Idempotency-Key and reuses it for automatic retries.
> async def main():
>     async with AsyncComfy() as client:
>         handle = await client.models.submit(
>             "byteplus/seedream-5-5-261028",
>             {
>                 "prompt": "A red fox trotting through a snowy pine forest, cinematic lighting",
>                 "response_format": "url",
>                 "watermark": False,
>             },
>         )
>         print("request_id:", handle.request_id)  # with the model ID, all another process needs
>
>         # Poll until the request completes, waiting the Retry-After the server names.
>         async for update in handle.iter_events():
>             print(update.status, update.queue_position)
>
>         # The provider's own payload, the same value models.run() returns.
>         # A request that failed or was cancelled raises the typed Router error here.
>         result = await handle.get()
>
>     print(result)
>
> asyncio.run(main())
> ```
>
> ```typescript TypeScript theme={null}
> import { comfy } from "@comfyorg/sdk";
>
> // Reads COMFY_API_KEY from the environment.
> // Each submit() call mints its own Idempotency-Key and reuses it for automatic retries.
> const handle = await comfy.models.submit("byteplus/seedream-5-5-261028", {
>   prompt: "A red fox trotting through a snowy pine forest, cinematic lighting",
>   response_format: "url",
>   watermark: false,
> });
> console.log("requestId:", handle.requestId); // with the model ID, all another process needs
>
> // Poll until the request completes, waiting the Retry-After the server names.
> for await (const update of handle.events()) {
>   console.log(update.status, update.queuePosition);
> }
>
> // The same result models.run() returns. A request that failed or was cancelled rejects here.
> const result = await handle.get();
>
> console.log(result.data);
> ```
>
> ```bash cURL theme={null}
> # 1. Submit. Router answers 201 with request_id, status_url, response_url and cancel_url.
> curl https://api.comfy.org/v2/models/byteplus/seedream-5-5-261028/requests \
>   -H "X-API-Key: $COMFY_API_KEY" \
>   -H "Idempotency-Key: $(uuidgen)" \
>   -H "Content-Type: application/json" \
>   -d "{\"prompt\": \"A red fox trotting through a snowy pine forest, cinematic lighting\", \"response_format\": \"url\", \"watermark\": false}"
>
> # 2. Poll until status is COMPLETED, waiting the Retry-After seconds each response names.
> REQUEST_ID="<request_id from the 201 body>"
> curl -i https://api.comfy.org/v2/models/byteplus/seedream-5-5-261028/requests/$REQUEST_ID/status \
>   -H "X-API-Key: $COMFY_API_KEY"
>
> # 3. Collect. 200 with the model's native output, 202 with the status body while it is still running.
> curl https://api.comfy.org/v2/models/byteplus/seedream-5-5-261028/requests/$REQUEST_ID \
>   -H "X-API-Key: $COMFY_API_KEY"
> ```

## Schema

### Input

**background** `string`

Controls whether the generated image has a transparent background (alpha channel). Supported by seedream-5.0-pro, 5.0-flash and the newer Seedream models whose own schema documents it.
auto: The model decides from the prompt and output\_format. With output\_format jpeg, the output is always opaque.
transparent: Output an RGBA image with a transparent background. output\_format jpeg returns an error.
opaque: Output an RGB image with an opaque background. The seedream-5.0-pro default.
seedream-5.0-pro supports transparent output for image-to-image only, with one png input image that has an alpha channel.
Not supported in the layer-separation scenario: passing it with layer\_decomposition enabled returns an error.

Possible values: `auto`, `transparent`, `opaque`

**guidance\_scale** `number`

Controls how closely the output image aligns with the input prompt. Range \[1, 10]. Higher values result in stronger prompt adherence. Not supported by seedream-5.0-pro, 5.0-lite, 4.5 and 4.0.

Range: `1` to `10`

Format: `float`

**image** `string | string[]`

The image or images to edit, as an accessible URL or a data-URI-prefixed Base64 payload. Identical to the shared Seedream field except for the reference-image ceiling, which is 10 on this model rather than 14.

**layer\_decomposition** `boolean` (default: false)

Controls whether layer separation is enabled. Only seedream-5.0-pro, 5.0-flash and 5.5 support this parameter.
true: Layer-separation mode. The model decomposes the single input image into one base image plus multiple layers (up to 16; up to 99 on seedream-5.5), and returns the position and content information of each produced layer, including the stacking order (z\_index), bounding box (bounding\_box), name (name) and description (description).
false: Standard image-generation mode; no layer separation is performed.
Notes on layer-separation mode: only a single input image is supported (passing multiple images returns an error); if any single layer fails to generate, the whole request fails — partial success is not supported; at most 17 images are returned (1 base image + 16 layers). seedream-5.5 returns at most layer\_decomposition\_options.max\_images images (1 base image + up to 99 layers). sequential\_image\_generation, sequential\_image\_generation\_options, tools and stream return an error if passed.

**layer\_decomposition\_options** `object`

Options for layer-separation mode. Only seedream-5.5 supports this parameter, and it applies only when layer\_decomposition is true.

**layer\_decomposition\_options.max\_images** `integer` (default: 30)

The maximum total number of images this request returns, the base image and the layers together. Range: \[2, 100]. When the prompt does not say how to split the image, the model plans the layers from max\_images and the complexity of the input image; a larger value usually gives finer layers.

Range: `2` to `100`

**model** `string`

Model identifier. Supported models: seedream-4-0-250828, seedream-4-5-251128, seedream-5-0-260128, seedream-5-0-pro-260628, seedream-5-0-flash-260915 and seedream-5-5-261028. A direct v1 call to POST /proxy/byteplus/api/v3/images/generations MUST supply it — the proxy refuses any other value, and an omitted one, with a 400. It is NOT in this schema's `required` list because Comfy Router fills it from the `{model}` path segment of /v2/models/byteplus/\{model}, so a Router caller omits it.

**optimize\_prompt\_options** `object`

Configuration for prompt optimization feature. Only seedream-5.0-pro/5.0-lite/4.5/5.5 (only support standard mode; seedream-5.5 returns an error for fast) and seedream-4.0 support this parameter.

**optimize\_prompt\_options.mode** `string` (default: "standard")

Set the mode for the prompt optimization feature. standard = Higher quality, longer generation time. fast = Faster but at a more average quality.

Possible values: `standard`, `fast`

**output\_format** `string` (default: "jpeg")

Specifies the format of the output image. Only seedream-5.0-pro, 5.0-flash, 5.0-lite and 5.5 support this parameter. seedream-5.5 defaults to png. In the layer-separation scenario, output\_format only controls the format of the base image; every layer is always output as png.

Possible values: `png`, `jpeg`

**prompt** `string`

Text description for image generation or transformation.
Optional in the layer-separation scenario (seedream-5.0-pro, 5.0-flash or 5.5 with layer\_decomposition enabled): if a prompt is provided, the model recognizes and separates the elements you specify according to the prompt intent; if no prompt is provided, the model automatically detects all major elements in the image and separates them into independent layers.

**response\_format** `string` (default: "url")

Specifies the format of the generated image returned in the response

Possible values: `url`, `b64_json`

**seed** `integer` (default: -1)

Random seed to control the stochasticity of image generation. Range: \[-1, 2147483647]. If not specified, a seed will be automatically generated. To reproduce the same output, use the same seed value.

Range: `-1` to `2147483647`

**sequential\_image\_generation** `string`

Controls whether to disable the batch generation feature. This parameter is only supported on seedream-5.0-lite, 4.5 and 4.0 (not supported by seedream-5.0-pro, 5.0-flash or 5.5). Valid values:
auto: In automatic mode, the model automatically determines whether to return multiple images and how many images it will contain based on the user's prompt.
disabled: Disables batch generation feature. The model will only generate one image.

Possible values: `auto`, `disabled`

**sequential\_image\_generation\_options** `object`

Only seedream-5.0-lite, 4.5 and 4.0 support this parameter (not supported by seedream-5.0-pro, 5.0-flash or 5.5).
Configuration for the batch image generation feature. This parameter is only effective when sequential\_image\_generation is set to auto.

**sequential\_image\_generation\_options.max\_images** `integer` (default: 15)

Specifies the maximum number of images to generate in this request. Number of input reference images + Number of generated images ≤ 15.

Range: `1` to `15`

**size** `string`

"seedream-4-0-250828": Set the specification for the generated image. Two methods are available but cannot be used together.
Method 1 | Specify the resolution. Optional values: 1K, 2K, 4K
Method 2 | Specify width and height in pixels. Default: 2048x2048, total pixels: \[1024x1024, 4096x4096], aspect ratio: \[1/16, 16]
"seedream-4-5-251128": Two methods available.
Method 1 | Specify the resolution. Optional values: 2K, 4K
Method 2 | Specify width and height in pixels. Default: 2048x2048, total pixels: \[2560x1440, 4096x4096], aspect ratio: \[1/16, 16]
"seedream-5-0-260128": Two methods available.
Method 1 | Specify the resolution. Optional values: 2K, 3K
Method 2 | Specify width and height in pixels. Default: 2048x2048, total pixels: \[2560x1440, \~3072x3072], aspect ratio: \[1/16, 16]
"seedream-5-0-pro-260628": Two methods available (cannot be used together).
Method 1 | Specify the resolution and describe the aspect ratio, shape or purpose of the image in the prompt; the model decides the final size. Optional values: 1K, 2K
Method 2 | Specify width and height in pixels. Default: 1024x1024, total pixels: \[1024x1024 (1048576), 2048x2048 (4194304)], aspect ratio: \[1/16, 16]
"seedream-5-0-flash-260915": Two methods available (cannot be used together).
Method 1 | Specify the resolution and describe the aspect ratio, shape or purpose of the image in the prompt; the model decides the final size. Optional values: 1K, 1.5K, 2K. Default: 2K
Method 2 | Specify width and height in pixels. Total pixels: \[1280x720 (921600), 2048x2048x1.1025 (4624220)], aspect ratio: \[1/16, 16]
"seedream-5-5-261028": Two methods available (cannot be used together).
Method 1 | Specify the resolution. Optional values: 1K, 1.5K, 2K. Default: 2K
Method 2 | Specify width and height in pixels. Total pixels: \[1280x720 (921600), 2048x2048x1.1025 (4624220)], aspect ratio: \[1/16, 16]
"seedream-5-0-pro-260628", "seedream-5-0-flash-260915" and "seedream-5-5-261028" with layer\_decomposition enabled: Only the resolution-level method is supported. Optional values: 1K, 1.5K, 2K, auto. Default: auto.
The base image is output at the specified resolution with the aspect ratio of the original input image; each layer is output close to the specified resolution, keeping the aspect ratio it had in the original image.
auto: Output is based on the size and aspect ratio of the input image. Inputs within \[1280x720, \~2048x2048] are output at the original input size; inputs smaller than 1K are output at 1K; inputs larger than 2K are output at 2K.

**stream** `boolean` (default: false)

Comfy Router settles an explicitly supplied stream flag to false because it captures a complete JSON result. On the v1 proxy, this field controls whether to enable streaming output mode. Only seedream-5.0-lite, 4.5 and 4.0 support this parameter (not supported by seedream-5.0-pro, 5.0-flash or 5.5). false = All output images are returned at once. true = Each output image is returned immediately after generated.

**watermark** `boolean` (default: true)

Specifies whether to add a watermark to the generated image. false = No watermark, true = Adds watermark with 'AI generated' label

Generated from the schema Router serves at `GET /v2/models/byteplus/seedream-5-5-261028/openapi.json`, the same document it validates a call against before the request reaches the provider.

### Output

**created** `integer`

Unix timestamp (in seconds) indicating the time when the request was created

**data** `object[]`

Contains information about the generated image(s).
In the layer-separation scenario, the first element of the array is the base image (z\_index=0), and the following elements are the layers, ordered by increasing z\_index.

**data\[].b64\_json** `string`

Base64-encoded image data (if response\_format is "b64\_json")

**data\[].background** `string`

The background type the image actually has: transparent or opaque. In the layer-separation scenario, the base image is always opaque and every layer is transparent. Only seedream-5.5 returns this field.

**data\[].bounding\_box** `object`

The bounding-box information of the region that the current layer occupies within the base image. Only layers return this field; the base image covers the whole canvas and does not return bounding\_box. Returned only when layer\_decomposition is true.

**data\[].bounding\_box.absolute** `integer[]`

The absolute pixel coordinates of the layer's bounding box, in the output base image's coordinate system with the top-left corner at (0, 0). Coordinate format: \[left, top, right, bottom].

**data\[].bounding\_box.normalized** `integer[]`

The per-mille quantized (normalized) coordinates of the layer's bounding box, proportionally mapped to a discrete integer range of \[0, 1000] based on the base image size, truncated at a maximum of 1000. Coordinate format: \[left, top, right, bottom].

**data\[].description** `string`

A detailed description of the current separated element, providing richer layer characteristics (such as color, state, material) than name. Only layers return this field; the base image does not. Returned only when layer\_decomposition is true.

**data\[].name** `string`

The name/label of the current separated element, automatically generated by the model from the characteristics of the separated subject. Only layers return this field; the base image does not. Returned only when layer\_decomposition is true.

**data\[].output\_format** `string`

The file format of the output image. Only seedream-5.0-pro and 5.5 support this field.

**data\[].size** `string`

The width and height of the image in pixels, in the format \<width>x\<height>. Only seedream-5.0-pro, 5.0-lite, 5.5, 4.5 and 4.0 support this parameter.

**data\[].url** `string (uri)`

URL for image download (if response\_format is "url")

Format: `uri`

**data\[].z\_index** `integer`

The stacking order of the layer, increasing from bottom to top: 0 is the bottom-most layer (the base image); larger values sit higher. Use it to recompose the layers into the complete image at the correct stacking order. Returned only when layer\_decomposition is true.

**error** `object`

Error information (if any)

**error.code** `string`

Upstream ModelArk error code. SensitiveContentDetected, InputTextSensitiveContentDetected, InputImageSensitiveContentDetected, InputVideoSensitiveContentDetected, InputAudioSensitiveContentDetected, OutputTextSensitiveContentDetected, OutputImageSensitiveContentDetected, OutputVideoSensitiveContentDetected and OutputAudioSensitiveContentDetected identify content-policy refusals. A family may have a dot-separated reason, such as InputImageSensitiveContentDetected.PrivacyInformation, OutputVideoSensitiveContentDetected.PolicyViolation or OutputImageSensitiveContentDetected.DeepFake. This is an open string, not an enum: other codes describe validation and provider failures. Router recognizes policy families in HTTP 400 error envelopes and HTTP 200 failed-task responses without overriding transport failures.

**error.message** `string`

Error message

**model** `string`

The model ID used for the request

**usage** `object`

**usage.generated\_images** `integer`

Number of images generated by the model

**usage.input\_images** `integer`

The number of images input to the model. Only seedream-5.0-pro and 5.5 support this field.

**usage.output\_tokens** `integer`

The number of tokens used for the picture generated by the model.

**usage.total\_tokens** `integer`

The total number of tokens consumed by this request.

## Examples

### Input

```json theme={null}
{
  "prompt": "A red fox trotting through a snowy pine forest, cinematic lighting",
  "response_format": "url",
  "watermark": false
}
```

### Output

```json theme={null}
{
  "created": 1767225600,
  "data": [
    {
      "size": "1024x1024",
      "url": "https://example.invalid/byteplus/seedream-4-0-250828/generated.png"
    }
  ],
  "model": "seedream-5-5-261028",
  "usage": {
    "generated_images": 1
  }
}
```

## Before you ship

The SDKs create an `Idempotency-Key` and reuse it for automatic retries. For manual retries, reuse the original key. Router can hold the connection for up to 10 minutes.

When a request fails, Router sends an `X-Comfy-Error-Type` response header explaining why. A `422` means Router rejected the input before calling the provider, and a `413` means the request body was larger than Router accepts. Download generated assets promptly because [result URLs can expire](https://docs.comfy.org/development/comfy-router/reference.md#result-assets).

Any size limit named in a field description above is the provider's own bound on that field, quoted from the provider's specification. Router applies a separate cap to the whole request body, which base64-encoded media counts against: see [request body size](https://docs.comfy.org/development/comfy-router/limitations.md#request-bodies-are-capped).

This page documents one partner model called through Comfy Router. The same `comfy-sdk` / `@comfyorg/sdk` package also ships a second client, for running a whole ComfyUI workflow graph on Comfy Cloud: `Comfy(api_key=...)` / `new Comfy({ apiKey })`, with `client.workflows`, `client.assets` and `client.jobs`. See [Comfy SDKs](https://docs.comfy.org/development/api-development/sdks.md).

> [card] [Headers](https://docs.comfy.org/development/comfy-router/headers.md)
>
> Authentication, idempotency, request IDs, error buckets, retry pacing, spend limits.

> [card] [Using the Router API](https://docs.comfy.org/development/comfy-router/api.md)
>
> Model discovery, validation errors, retries, and billing.

> [card] [Limitations](https://docs.comfy.org/development/comfy-router/limitations.md)
>
> What Router does not do today, and what to use instead.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.