## Basic model info
- Model name: bytedance/bytedance seedream-5.0-pro
- Model description: Flagship Seedream 5.0 Pro model with deep-thinking prompt understanding, supporting high quality text-to-image generation and multi-reference image editing.
- Endpoint name: layerize
## Model schema
The model schema is defined in the OpenAPI schema: [OpenAPI Schema](https://oapi.sunra.ai/main/bytedance/seedream-5.0-pro/latest.json)
### Model input schema
The model input schema is:
```json
{
"description": "Input model for decomposing an image into editable layers using Seedream 5.0 Pro.",
"properties": {
"prompt": {
"default": "",
"description": "Optional instructions describing which elements to separate. When empty, the model automatically separates the major elements. Normalized left top right bottom tags may be used for precise coordinate targeting.",
"title": "Prompt",
"type": "string",
"x-sr-order": 201
},
"enable_safety_checker": {
"default": true,
"description": "If set to true, the safety checker will be enabled.",
"title": "Enable Safety Checker",
"type": "boolean",
"x-sr-order": 501
},
"enhance_prompt_mode": {
"default": "standard",
"description": "Prompt optimization mode. standard prioritizes image quality; fast reduces generation time.",
"enum": [
"standard",
"fast"
],
"title": "Enhance Prompt Mode",
"type": "string",
"x-sr-order": 402
},
"image": {
"anyOf": [
{
"format": "uri",
"maxLength": 2083,
"minLength": 1,
"type": "string"
},
{
"type": "string"
}
],
"description": "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.",
"title": "Image",
"x-sr-order": 301
},
"resolution": {
"default": "auto",
"description": "Resolution tier for the output base image and layers. auto adapts to the input image while preserving each element's aspect ratio.",
"enum": [
"auto",
"1K",
"1.5K",
"2K"
],
"title": "Resolution",
"type": "string",
"x-sr-order": 401
}
},
"required": [
"image"
],
"title": "LayerizeInput",
"type": "object"
}
```
### Model output schema
The model output schema is:
```json
{
"anyOf": [
{
"properties": {
"images": {
"items": {
"properties": {
"content_type": {
"description": "The mime type of the file.",
"title": "Content Type",
"type": "string"
},
"file_name": {
"description": "The name of the file. It will be auto-generated if not provided.",
"title": "File Name",
"type": "string"
},
"file_size": {
"description": "The size of the file in bytes.",
"title": "File Size",
"type": "integer"
},
"url": {
"description": "The URL where the file can be downloaded from.",
"title": "Url",
"type": "string"
}
},
"required": [
"content_type",
"file_name",
"file_size",
"url"
],
"title": "SunraFile",
"type": "object"
},
"title": "Images",
"type": "array"
}
},
"required": [
"images"
],
"title": "ImagesOutput",
"type": "object"
},
{
"description": "Layerize output, extended with usage field for post-calculated billing.",
"properties": {
"layers": {
"description": "The base image followed by up to 16 separated transparent-PNG layers, ordered by increasing z_index.",
"items": {
"description": "A generated base image or separated transparent-PNG layer.",
"properties": {
"bounding_box": {
"anyOf": [
{
"description": "Layer bounds in the output base image coordinate system.",
"properties": {
"absolute": {
"description": "[left, top, right, bottom] pixel coordinates in the output base image coordinate system.",
"items": {
"type": "integer"
},
"maxItems": 4,
"minItems": 4,
"title": "Absolute",
"type": "array"
},
"normalized": {
"description": "[left, top, right, bottom] coordinates normalized to the integer range [0, 1000].",
"items": {
"type": "integer"
},
"maxItems": 4,
"minItems": 4,
"title": "Normalized",
"type": "array"
}
},
"required": [
"absolute",
"normalized"
],
"title": "LayerBoundingBox",
"type": "object"
},
{
"type": "null"
}
],
"description": "The layer's position in the base image coordinate system. Omitted for the base image."
},
"description": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "Model-generated description of the layer. Omitted for the base image.",
"title": "Description"
},
"image": {
"properties": {
"content_type": {
"description": "The mime type of the file.",
"title": "Content Type",
"type": "string"
},
"file_name": {
"description": "The name of the file. It will be auto-generated if not provided.",
"title": "File Name",
"type": "string"
},
"file_size": {
"description": "The size of the file in bytes.",
"title": "File Size",
"type": "integer"
},
"url": {
"description": "The URL where the file can be downloaded from.",
"title": "Url",
"type": "string"
}
},
"required": [
"content_type",
"file_name",
"file_size",
"url"
],
"title": "SunraFile",
"type": "object"
},
"name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "Model-generated label for the layer. Omitted for the base image.",
"title": "Name"
},
"z_index": {
"description": "Stacking order from bottom to top. The base image always has z_index 0.",
"maximum": 16,
"minimum": 0,
"title": "Z Index",
"type": "integer"
}
},
"required": [
"image",
"z_index"
],
"title": "ImageLayer",
"type": "object"
},
"title": "Layers",
"type": "array"
},
"units": {
"description": "Billable units: number of generated layers, counted double when the base image exceeds 1536x1536 total pixels.",
"title": "Units",
"type": "number"
}
},
"required": [
"layers",
"units"
],
"title": "LayerizeOutput",
"type": "object"
}
],
"title": "Response Get Request Result Requests Request Id Get"
}
```
## Example inputs and outputs
Use the following example inputs and outputs to understand the model.
### Input example
```json
{
"prompt": "",
"enable_safety_checker": true,
"enhance_prompt_mode": "standard",
"image": "",
"resolution": "auto"
}
```
### Output example
```json
{
}
```
## Model code examples
### JavaScript
```javascript
import { sunra } from "@sunra/client";
const result = await sunra.subscribe("bytedance/seedream-5.0-pro/layerize", {
input: {
prompt: '',
image: '',
resolution: 'auto',
enhance_prompt_mode: 'standard',
enable_safety_checker: true
},
logs: true,
onQueueUpdate: (update) => {
console.log(`Status Update: ${update.status}, Request ID: ${update.request_id}`);
},
});
console.log(result.data);
console.log(result.requestId);
```
### Python
```python
import sunra_client
result = sunra_client.subscribe(
"bytedance/seedream-5.0-pro/layerize",
arguments={
"prompt": "",
"image": "",
"resolution": "auto",
"enhance_prompt_mode": "standard",
"enable_safety_checker": True
},
with_logs=True,
on_enqueue=print,
on_queue_update=print,
)
print(result)
```
### Java
```java
import ai.sunra.client.*;
import java.util.Map;
import com.google.gson.JsonObject;
var client = SunraClient.withEnvCredentials();
var response = client.subscribe(
"bytedance/seedream-5.0-pro/layerize",
SubscribeOptions.builder()
.input(Map.of(
"prompt", "",
"image", "",
"resolution", "auto",
"enhance_prompt_mode", "standard",
"enable_safety_checker", true))
.resultType(JsonObject.class)
.onQueueUpdate(update -> System.out.printf(
"\nStatus Update: %s, Request ID: %s%n",
update.getStatus(),
update.getRequestId()
))
.logs(true)
.build()
);
System.out.println("Completed!");
System.out.println(response.getData());
```
### Kotlin
```kotlin
import ai.sunra.client.kt.*
import com.google.gson.JsonObject
val client = createSunraClient()
val response = client.subscribe(
endpointId = "bytedance/seedream-5.0-pro/layerize",
input = mapOf(
"prompt" to "",
"image" to "",
"resolution" to "auto",
"enhance_prompt_mode" to "standard",
"enable_safety_checker" to true),
options = ai.sunra.client.kt.SubscribeOptions(logs = true),
onUpdate = { update ->
println("\nStatus Update: ${update.status}, Request ID: ${update.requestId}")
}
)
println("Completed!")
println(response.data)
```
### Curl
```bash
curl --request POST \
--url https://api.sunra.ai/v1/queue/bytedance/seedream-5.0-pro/layerize \
--header "Authorization: Key $SUNRA_KEY" \
--header "Content-Type: application/json" \
--data '{"prompt":"","image":"","resolution":"auto","enhance_prompt_mode":"standard","enable_safety_checker":true}'
```
## Model readme
>