Image Editing
Doubao Seedream image editing API
Doubao Seedream image editing uses /v1/images/edits. It supports reference-image editing, multi-image blending, and visual repainting. Reference images are passed through the JSON image field, not the OpenAI-style file-upload protocol.
curl -X POST "https://api.routescope.ai/v1/images/edits" \ -H "Content-Type: application/json" \ -d '{ "model": "gpt-image-2", "prompt": "Generate a new image based on these two reference images.", "images": [ { "image_url": "https://example.com/a.png" }, { "image_url": "https://example.com/b.png" } ], "size": "1024x1024" }'{
"created": 1,
"data": {}
}Authorization
BearerAuth
Model relay endpoint authentication. Header: Authorization: Bearer .
In: header
Request Body
application/json
Model name. The Tencent TokenHub channel maps it inside the gateway to the upstream model name.
"gpt-image-2"Image editing prompt.
Recommended JSON URL image input. Each item is a single image URL object.
Compatibility field: accepts a single URL string, a URL array, or an object. Prefer images[].image_url.
Compatibility field: a URL string array. Prefer images[].image_url.
Optional. Mask image URL; transparent areas mark the regions to edit.
uriNumber of images to generate.
int321 <= valueOutput image size.
"1024x1024"Image quality. Allowed values depend on the upstream model.
Response format. Supports url or b64_json; can be omitted by default and support varies across upstream channels.
"url" | "b64_json"Background fill mode. Support depends on the model.
"auto""transparent" | "opaque" | "auto"Output format. Allowed values depend on the upstream model.
Output compression level. Applies to jpeg and webp only.
90int320 <= value <= 100Moderation strength. Support depends on the model.
"auto""auto" | "low"Whether to add a watermark. Support depends on the upstream channel.
falseEnd-user identifier; useful for abuse monitoring.
Response Body
application/json
Model Selection
| Model ID | Typical Use |
|---|---|
doubao-seedream-4-0-250828 | Reference-image editing, multi-image blending, and image repainting. |
doubao-seedream-4-5-251128 | High-quality reference-image editing, multi-image blending, and high-consistency edits. |
doubao-seedream-5-0-260128 | High-quality reference-image editing, multi-image blending, and complex visual repainting. |
doubao-seedream-5-0-lite-260128 | Lightweight editing, low-latency revisions, and batch sketch iteration. |
Common Parameters
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
model | string | Yes | None | Seedream editing model ID. |
prompt | string | Yes | None | Editing instruction. Clearly specify what to keep, what to modify, and the target style. |
image | string or string[] | Yes | None | Source/reference image URL or Base64. Recommended maximum is 14 images. |
size | string | No | 1920x1920 | Edit output size. Prefer <width>x<height>. Total pixels must not be below 3686400. |
response_format | string | No | None | Response format, supporting url or b64_json. Usually no need to pass it. |
watermark | boolean | No | true | Whether to add an AI-generated watermark. |
stream | boolean | No | false | Whether to enable streaming output. Seedream 5.0 Lite editing does not list stream. |
Model-Specific Parameters
| Field | Applicable Models | Default / Range | Description |
|---|---|---|---|
size | Seedream 4.0 / 4.5 / 5.0 / 5.0 Lite | Default 1920x1920 | Prefer <width>x<height>. Total pixels must not be below 3686400. Actual availability depends on the channel. |
stream | Seedream 4.0 / 4.5 / 5.0 | Default false | Seedream 5.0 Lite editing does not list stream, so do not include it in Lite editing examples. |
Example Code
curl https://api.routescope.ai/v1/images/edits \
-H "Authorization: Bearer $ROUTESCOPE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "doubao-seedream-5-0-260128",
"prompt": "Keep the main building, change the scene to a cyberpunk night view with neon lights and high detail",
"image": "https://example.com/building.png",
"size": "1920x1920"
}'import requests
response = requests.post(
"https://api.routescope.ai/v1/images/edits",
headers={"Authorization": "Bearer YOUR_ROUTESCOPE_API_KEY"},
json={
"model": "doubao-seedream-5-0-260128",
"prompt": "Keep the main building, change the scene to a cyberpunk night view with neon lights and high detail",
"image": "https://example.com/building.png",
"size": "1920x1920",
},
)
print(response.json())Response Example
{
"created": 1777432320,
"data": [
{
"url": "https://api.routescope.ai/assets/images/seedream-5-0-edit.png",
"b64_json": null,
"revised_prompt": "Keep the main building, cyberpunk night style, neon lights, high detail."
}
]
}Notes
- Billing follows the model and channel ratios configured in the Routescope backend.
- Lite models are better for lightweight editing. Prefer non-Lite models for complex consistency editing.
- High-resolution edits take longer than standard text-to-image generation.
How is this guide?
Last updated on