Tokaify APITokaify API
API Reference
AI Model APIImagesDoubao APIdoubao-seedream-5-0-260128

Image Editing

doubao-seedream-5-0-260128 Image Editing API

Seedream 5.0 supports high-quality reference-image editing, multi-image blending, and complex visual repainting through /v1/images/edits, with image supplied in the JSON request body.

POST
/v1/images/edits

Authorization

BearerAuth

AuthorizationBearer <token>

Model relay interface recognition. Request heading: Autoration: Bearer .

In: header

Request Body

multipart/form-data

model*string

Image editing model name.

Default"doubao-seedream-5-0-260128"
prompt*string

Edits a hint.

image*file

Yes. Original graphic file to edit. Current upstream requests for uploading files do not support the direct uploading of pictures URL with JSON.

Formatbinary
mask?file

Optional. Covers a photo file with a transparent area indicating the area to be edited.

Formatbinary
n?integer

Generates the number of pictures.

Formatint32
Range1 <= value
size?string

Output 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.

Default"1920x1920"
quality?string

Picture quality. Actual available values depend on models and upstream pathways.

Default"auto"
Value in"auto" | "standard" | "hd" | "low" | "medium" | "high"
response_format?string

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.

Value in"url" | "b64_json"
background?string

Background filler. Support depends on the model.

Default"auto"
Value in"transparent" | "opaque" | "auto"
output_format?string

Output picture format. Support depends on the model.

Default"png"
Value in"png" | "jpeg" | "webp"
output_compression?integer

Output compression level, only applicable to _FD_PROTEC_0 and FD_PROTEC_1.

Default90
Formatint32
Range0 <= value <= 100
moderation?string

Security clearance intensity. Support depends on the model.

Default"auto"
Value in"auto" | "low"
watermark?boolean

Add watermarks. Support depends on the upstream route.

Defaultfalse
user?string

End-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-5-0-260128" \  -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

FieldTypeRequiredDefaultDescription
modelstringYesNoneFixed to doubao-seedream-5-0-260128.
promptstringYesNoneEdit instruction. Clearly specifying the preserved area, modified area, and target style is recommended.
imagestring or string[]YesNoneSource/reference image URL or Base64. Up to 14 images is recommended.
sizestringNo1920x1920Use an explicit <width>x<height> value such as 1920x1920; the total pixel count must be at least 3686400.
response_formatstringNoNoneSupports url or b64_json. Omit by default unless you need a specific return format.
watermarkbooleanNotrueWhether to add an AI-generated watermark.
streambooleanNofalseWhether 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-5-0-260128",
    "prompt": "Keep the main building and restyle the scene into a nighttime cyberpunk setting with neon lights and high detail.",
    "image": "https://example.com/building.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-5-0-260128",
        "prompt": "Keep the main building and restyle the scene into a nighttime cyberpunk setting with neon lights and high detail.",
        "image": "https://example.com/building.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-5-0-260128",
    prompt: "Keep the main building and restyle the scene into a nighttime cyberpunk setting with neon lights and high detail.",
    image: "https://example.com/building.png",
    size: "1920x1920",
  }),
});
console.log(await response.json());

Response Example

{
  "created": 1777432320,
  "data": [
    {
      "url": "https://api.tokaify.com/assets/images/seedream-5-0-edit.png",
      "b64_json": null,
      "revised_prompt": "Keep the building as the subject, nighttime cyberpunk style, neon lights, high detail."
    }
  ]
}

Notes

Billing follows the configured model and channel ratios. High-resolution editing takes longer than standard text-to-image generation.

How is this guide?

Last updated on