Image Editing
doubao-seedream-4-5-251128 Image Editing API
Seedream 4.5 supports reference-image editing, multi-image blending, and high-consistency image revision through /v1/images/edits, with image supplied in the JSON request body.
Authorization
BearerAuth
Model relay interface recognition. Request heading: Autoration: Bearer .
In: header
Request Body
multipart/form-data
Image editing model name.
"doubao-seedream-4-5-251128"Edits a hint.
Yes. Original graphic file to edit. Current upstream requests for uploading files do not support the direct uploading of pictures URL with JSON.
binaryOptional. Covers a photo file with a transparent area indicating the area to be edited.
binaryGenerates the number of pictures.
int321 <= valueOutput picture size. Please use a clear < width > x > height, e.g. 1920 x 1920; total pixels may not be less than 3686,400, the actual usable value depends on the model and upstream channel.
"1920x1920"Picture quality. Actual available values depend on models and upstream pathways.
"auto""auto" | "standard" | "hd" | "low" | "medium" | "high"returns the format. __FD_PROTECT_0 or _FD_PROTEC_1; default does not need to transmit this field and different upstream channel support may be different.
"url" | "b64_json"Background filler. Support depends on the model.
"auto""transparent" | "opaque" | "auto"Output picture format. Support depends on the model.
"png""png" | "jpeg" | "webp"Output compression level, only applicable to _FD_PROTEC_0 and FD_PROTEC_1.
90int320 <= value <= 100Security clearance intensity. Support depends on the model.
"auto""auto" | "low"Add watermarks. Support depends on the upstream route.
falseEnd-user identification, which can be used for abuse surveillance.
Response Body
application/json
curl -X POST "https://api.tokaify.com/v1/images/edits" \ -F model="doubao-seedream-4-5-251128" \ -F prompt="Change the picture to a watercolored illustration style and keep the main picture." \ -F image="@/path/to/image.jpg" \ -F n="1" \ -F size="1920x1920" \ -F quality="auto" \ -F background="auto" \ -F output_format="png" \ -F output_compression="90" \ -F moderation="auto" \ -F watermark="false" \ -F user="user-123"{
"created": 1,
"data": {}
}Request Parameters
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
model | string | Yes | None | Fixed to doubao-seedream-4-5-251128. |
prompt | string | Yes | None | Edit instruction. Clearly specifying which elements to keep and which to modify is recommended. |
image | string or string[] | Yes | None | Source/reference image URL or Base64 for editing, blending, or subject consistency. |
size | string | No | 1920x1920 | Use an explicit <width>x<height> value such as 1920x1920; the total pixel count must be at least 3686400. |
response_format | string | No | None | Supports url or b64_json. Omit by default unless you need a specific return format. |
watermark | boolean | No | true | Whether to add an AI-generated watermark. |
stream | boolean | No | false | Whether to enable streaming output. |
Example Code
curl https://api.tokaify.com/v1/images/edits \
-H "Authorization: Bearer $TOKAIFY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "doubao-seedream-4-5-251128",
"prompt": "Keep the product appearance unchanged and generate an e-commerce hero image with a white background and premium soft lighting.",
"image": "https://example.com/product.png",
"size": "1920x1920"
}'import requests
response = requests.post(
"https://api.tokaify.com/v1/images/edits",
headers={"Authorization": "Bearer YOUR_TOKAIFY_API_KEY"},
json={
"model": "doubao-seedream-4-5-251128",
"prompt": "Keep the product appearance unchanged and generate an e-commerce hero image with a white background and premium soft lighting.",
"image": "https://example.com/product.png",
"size": "1920x1920",
},
)
print(response.json())const response = await fetch("https://api.tokaify.com/v1/images/edits", {
method: "POST",
headers: { Authorization: `Bearer ${process.env.TOKAIFY_API_KEY}`, "Content-Type": "application/json" },
body: JSON.stringify({
model: "doubao-seedream-4-5-251128",
prompt: "Keep the product appearance unchanged and generate an e-commerce hero image with a white background and premium soft lighting.",
image: "https://example.com/product.png",
size: "1920x1920",
}),
});
console.log(await response.json());Response Example
{
"created": 1777432320,
"data": [
{
"url": "https://api.tokaify.com/assets/images/seedream-4-5-edit.png",
"b64_json": null,
"revised_prompt": "Keep the product appearance, white-background e-commerce hero image, premium soft lighting."
}
]
}Notes
Billing follows the configured model and channel ratios. Seedream 4.5 is better suited for product, character, and text-consistency editing.
How is this guide?
Last updated on