Seedream 5.5 Pro · Image to image
curl --request POST \
--url https://api.gravitex.ai/v1/images/generationsimport requests
url = "https://api.gravitex.ai/v1/images/generations"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.gravitex.ai/v1/images/generations', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.gravitex.ai/v1/images/generations",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.gravitex.ai/v1/images/generations"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.gravitex.ai/v1/images/generations")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gravitex.ai/v1/images/generations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_bodySeedream 5.5 Pro
Seedream 5.5 Pro · Image to image
Seedream 5.5 Pro Image to image parameters, limits, and copyable examples
POST
/
v1
/
images
/
generations
Seedream 5.5 Pro · Image to image
curl --request POST \
--url https://api.gravitex.ai/v1/images/generationsimport requests
url = "https://api.gravitex.ai/v1/images/generations"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.gravitex.ai/v1/images/generations', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.gravitex.ai/v1/images/generations",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.gravitex.ai/v1/images/generations"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.gravitex.ai/v1/images/generations")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gravitex.ai/v1/images/generations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_bodyIntroduction
Provide reference images and editing instructions for single-image editing, multi-image fusion, interactive editing, transparency, or layer decomposition. Ordinary editing returns one image; decomposition returns a base image and multiple layers. Regular printed text layers can also return rich-text OCR.Endpoint and authentication
POST https://api.gravitex.ai/v1/images/generations
Authorization: Bearer sk-xxxxxxxxxx and Content-Type: application/json. Image editing also accepts /v1/images/edits with the same JSON body. Parameters and pricing
Request parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
model | string | Yes | dola-seedream-5-5-261028 |
prompt | string | Editing: yes; decomposition: optional | Generation or editing instruction; specify elements to separate for decomposition |
image | string / string[] | Yes | Reference URL or Base64; up to 10 images for editing, exactly one for decomposition |
size | string | No | Default 2K; 1K, 1.5K, 2K, or custom WIDTHxHEIGHT; decomposition defaults to auto |
output_format | string | No | Default: png. jpeg / png; in decomposition, controls the base image only. Layers are always PNG. |
response_format | string | No | Default: url. url (valid for 24 hours) or b64_json |
watermark | boolean | No | Default: true. Add an AI-generated watermark in the bottom-right corner |
background | string | No | Default: auto. auto / transparent / opaque |
optimize_prompt_options | object | No | Default: {"mode":"standard"}. Only standard is supported |
layer_decomposition | boolean | No | Default: false. Enable layer decomposition |
layer_decomposition_options | object | No | Decomposition configuration; active only when decomposition is enabled |
n or use 1; send separate requests for multiple results. See shared parameters for full defaults and safety_identifier. Neither model supports quality, sequential generation, streaming, or web search.
prompt
Required for editing. Describe how to use or change the reference images. Optional for decomposition: specify elements to separate, or omit to let the model identify the main elements. Keep Chinese prompts within 300 characters and English prompts within 600 words; overly long prompts may dilute details. For interactive editing, identify a region with<bbox>x1 y1 x2 y2</bbox> using normalized [0, 1000] coordinates, with the origin at the top-left. Alternatively, draw boxes, arrows, or sketches on the reference and describe the intended changes.
image
Accepts one string or an array of strings. Each entry is a server-accessible public URL or Base64 data URI in the formdata:image/<format>;base64,<data>; use lowercase format names, for example data:image/png;base64,iVBORw0....
| Limit | Ordinary editing | Layer decomposition |
|---|---|---|
| Count | Required, up to 10 | Required, exactly one |
| Formats | jpeg, png, webp, bmp, tiff, gif, heic, heif | png, jpeg |
| Width/height ratio | [1/16, 16] | [1/16, 16] |
| Width and height | Both greater than 14 px | Subject to total-pixel and aspect-ratio limits |
| Size per image | ≤ 30 MB | ≤ 30 MB |
| Total pixels | [196, 6000×6000] | [512×512, 6000×6000] |
Total pixels means width × height, not independent minimum dimensions. Transparency constraints are listed separately below.
size
Full size rules and dimension table Decomposition supports only1K, 1.5K, 2K, and auto (default); custom pixel dimensions are not supported.
background
| Value | Description |
|---|---|
auto | Default; model decides from the prompt and output format. JPEG has no alpha channel. |
opaque | RGB output without an alpha channel |
transparent | RGBA output with an alpha channel; use PNG |
Native transparency works for text-to-image and image-to-image. Editing accepts up to 10 references without requiring alpha channels. Check
data[].background for actual output transparency; it may differ from the request.Never combine
background: "transparent" with JPEG output. Do not pass background in decomposition mode.layer_decomposition
Setlayer_decomposition: true to split one image into one base image and up to 99 independent PNG layers with alpha channels. Default: false.
imageis required; exactly one input is accepted.- Any layer failure fails the entire request; partial success is not supported.
- Requested layers beyond the limit may be omitted.
- The response includes
z_index,name,description, andbounding_box. - The base image and all layers are counted in
usage.generated_images.
layer_decomposition_options
Active only whenlayer_decomposition is true.
| Field | Type | Default | Range | Description |
|---|---|---|---|---|
max_images | integer | 30 | [2, 100] | Maximum output count, including the base image |
text_recognition | boolean | false | true / false | Return rich-text OCR for regular printed text layers |
{
"layer_decomposition_options": {
"max_images": 20,
"text_recognition": true
}
}
max_images; higher limits usually give finer layers. The upstream service reserves IPM (images per minute) quota using max_images and releases unused quota afterward. Non-text layers and irregular text such as handwriting or artistic lettering do not return OCR. Supported fonts: Seedream 5.5 OCR fonts
Request examples
Each example includes a complete JSON body and matching cURL. Replacesk-xxxxxxxxxx with your API Key. Input URLs are public and need no login. Response URLs illustrate structure only.
Single-image editing
{
"model": "dola-seedream-5-5-261028",
"prompt": "Keep the appearance of the dog in the reference image and replace the background with snowy mountains",
"image": "https://images.unsplash.com/photo-1517849845537-4d257902454a?w=1024&fm=jpg",
"size": "2K"
}
curl --location 'https://api.gravitex.ai/v1/images/generations' \
--header 'Authorization: Bearer sk-xxxxxxxxxx' \
--header 'Content-Type: application/json' \
--data '{
"model": "dola-seedream-5-5-261028",
"prompt": "Keep the appearance of the dog in the reference image and replace the background with snowy mountains",
"image": "https://images.unsplash.com/photo-1517849845537-4d257902454a?w=1024&fm=jpg",
"size": "2K"
}'
Multi-image fusion
{
"model": "dola-seedream-5-5-261028",
"prompt": "Place the dog from image 1 in the lakeside scene of image 2, preserving its appearance and matching lighting and perspective",
"image": [
"https://images.unsplash.com/photo-1517849845537-4d257902454a?w=1024&fm=jpg",
"https://images.unsplash.com/photo-1501785888041-af3ef285b470?w=1024&fm=jpg"
],
"size": "2K"
}
curl --location 'https://api.gravitex.ai/v1/images/generations' \
--header 'Authorization: Bearer sk-xxxxxxxxxx' \
--header 'Content-Type: application/json' \
--data '{
"model": "dola-seedream-5-5-261028",
"prompt": "Place the dog from image 1 in the lakeside scene of image 2, preserving its appearance and matching lighting and perspective",
"image": [
"https://images.unsplash.com/photo-1517849845537-4d257902454a?w=1024&fm=jpg",
"https://images.unsplash.com/photo-1501785888041-af3ef285b470?w=1024&fm=jpg"
],
"size": "2K"
}'
Interactive editing
{
"model": "dola-seedream-5-5-261028",
"prompt": "Edit only <bbox>0 0 1000 300</bbox>: make the background in that region light blue; keep the dog and all other regions unchanged",
"image": "https://images.unsplash.com/photo-1517849845537-4d257902454a?w=1024&fm=jpg",
"size": "2K"
}
curl --location 'https://api.gravitex.ai/v1/images/generations' \
--header 'Authorization: Bearer sk-xxxxxxxxxx' \
--header 'Content-Type: application/json' \
--data '{
"model": "dola-seedream-5-5-261028",
"prompt": "Edit only <bbox>0 0 1000 300</bbox>: make the background in that region light blue; keep the dog and all other regions unchanged",
"image": "https://images.unsplash.com/photo-1517849845537-4d257902454a?w=1024&fm=jpg",
"size": "2K"
}'
Transparent image editing
{
"model": "dola-seedream-5-5-261028",
"prompt": "Extract the dog from the reference image, remove the background, and output an image with a transparent background",
"image": "https://images.unsplash.com/photo-1517849845537-4d257902454a?w=1024&fm=jpg",
"background": "transparent",
"output_format": "png",
"size": "2K"
}
curl --location 'https://api.gravitex.ai/v1/images/generations' \
--header 'Authorization: Bearer sk-xxxxxxxxxx' \
--header 'Content-Type: application/json' \
--data '{
"model": "dola-seedream-5-5-261028",
"prompt": "Extract the dog from the reference image, remove the background, and output an image with a transparent background",
"image": "https://images.unsplash.com/photo-1517849845537-4d257902454a?w=1024&fm=jpg",
"background": "transparent",
"output_format": "png",
"size": "2K"
}'
Layer decomposition and OCR
{
"model": "dola-seedream-5-5-261028",
"prompt": "Separate the regular printed text in the image into independent paragraph layers and recognize the text and its styles",
"image": "https://raw.githubusercontent.com/tesseract-ocr/tessdoc/main/images/eurotext.png",
"layer_decomposition": true,
"layer_decomposition_options": {
"max_images": 20,
"text_recognition": true
},
"size": "2K",
"output_format": "jpeg"
}
curl --location 'https://api.gravitex.ai/v1/images/generations' \
--header 'Authorization: Bearer sk-xxxxxxxxxx' \
--header 'Content-Type: application/json' \
--data '{
"model": "dola-seedream-5-5-261028",
"prompt": "Separate the regular printed text in the image into independent paragraph layers and recognize the text and its styles",
"image": "https://raw.githubusercontent.com/tesseract-ocr/tessdoc/main/images/eurotext.png",
"layer_decomposition": true,
"layer_decomposition_options": {
"max_images": 20,
"text_recognition": true
},
"size": "2K",
"output_format": "jpeg"
}'
Automatic layer decomposition
{
"model": "dola-seedream-5-5-261028",
"image": "https://images.unsplash.com/photo-1501785888041-af3ef285b470?w=1024&fm=jpg",
"layer_decomposition": true,
"safety_identifier": "5f4dcc3b5aa765d61d8327deb882cf99"
}
curl --location 'https://api.gravitex.ai/v1/images/generations' \
--header 'Authorization: Bearer sk-xxxxxxxxxx' \
--header 'Content-Type: application/json' \
--data '{
"model": "dola-seedream-5-5-261028",
"image": "https://images.unsplash.com/photo-1501785888041-af3ef285b470?w=1024&fm=jpg",
"layer_decomposition": true,
"safety_identifier": "5f4dcc3b5aa765d61d8327deb882cf99"
}'
prompt to identify and split the main elements automatically. Defaults: size: "auto", max_images: 30.
Success response
Ordinary editing uses the shared response;usage.input_images reflects actual reference count. The excerpt below shows only the base image and one layer, while usage describes the full result. Therefore its generated_images exceeds the number of entries shown. URLs are illustrative. Shared response
{
"model": "dola-seedream-5-5-261028",
"created": 1784696685,
"data": [
{
"url": "https://example.com/base.jpeg",
"size": "2048x2048",
"output_format": "jpeg",
"z_index": 0
},
{
"url": "https://example.com/layer-1.png",
"size": "1273x265",
"output_format": "png",
"z_index": 1,
"bounding_box": {
"absolute": [383, 120, 1655, 384],
"normalized": [187, 59, 808, 188]
},
"name": "Seedream title text",
"description": "Large yellow serif Seedream title text",
"text_recognition": {
"text": "Seedream",
"lines": [
{
"bounding_box": {
"absolute": [383, 120, 1655, 384],
"normalized": [187, 59, 808, 188]
},
"runs": [
{
"text": "Seedream",
"style": {
"similar_font_family": "Playfair Display",
"foreground_color": "#F5C518",
"bold": true,
"italic": false,
"underline": false,
"strikethrough": false,
"shadow": false,
"translucent": false
}
}
]
}
]
}
}
],
"usage": {
"input_images": 1,
"generated_images": 8,
"output_tokens": 23107,
"total_tokens": 23107
}
}
Response fields
Shared response fields| Additional field | Type | Description |
|---|---|---|
data[].z_index | integer | Stacking order: base image is 0, layers start at 1; higher means above |
data[].name | string | Model-generated layer name |
data[].description | string | Detailed layer description |
data[].bounding_box.absolute | integer[4] | Layer pixel coordinates on the output base image: [left, top, right, bottom]; absent on the base image |
data[].bounding_box.normalized | integer[4] | Same coordinates normalized to [0, 1000]; absent on the base image |
data[].text_recognition | object | Rich-text OCR; only when enabled and the layer contains regular printed text |
text_recognition
| OCR field | Type | Description |
|---|---|---|
text | string | Full plain text, top-to-bottom and left-to-right; lines separated by \n |
lines[] | array | One entry per text line |
lines[].bounding_box.absolute / .normalized | integer[4] | Line coordinates on the base image, following the same bounding-box rules |
lines[].runs[] | array | Style runs; one entry if the entire line has the same style |
lines[].runs[].text | string | Run text without newline characters |
lines[].runs[].style.similar_font_family | string | Closest matching font, or unknown if recognition/confidence is insufficient |
lines[].runs[].style.foreground_color | string | Uppercase #RRGGBB, without alpha |
lines[].runs[].style.bold | boolean | Bold |
lines[].runs[].style.italic | boolean | Italic glyphs; whole-layer rotation or perspective does not count |
lines[].runs[].style.underline | boolean | Underline; excludes standalone rules and table borders |
lines[].runs[].style.strikethrough | boolean | Strikethrough |
lines[].runs[].style.shadow | boolean | Visible shadow, projection, or offset glow |
lines[].runs[].style.translucent | boolean | Text itself is semitransparent; solid pale text does not count |
Styles are recognized automatically and may differ from exact original attributes.
Reconstruct layers: resize each layer to
(right - left) × (bottom - top) using absolute coordinates, then place it at (left, top) on the base image. For normalized coordinates on a W × H canvas, the top-left position is (left / 1000 × W, top / 1000 × H). Stack layers in ascending z_index order.Result URLs expire after 24 hours. Download and persist them immediately.
