Generate or edit an image
curl --request POST \
--url https://www.anyfast.ai/v1/images/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "doubao-seedream-5-0-pro",
"prompt": "在标记区域添加一个带杯碟的陶瓷咖啡杯,并保持原始构图。",
"image": [
"https://example.com/source.png",
"https://example.com/target.png"
],
"size": "<string>",
"response_format": "url",
"output_format": "jpeg",
"watermark": true,
"optimize_prompt_options": {
"mode": "standard"
}
}
'import requests
url = "https://www.anyfast.ai/v1/images/generations"
payload = {
"model": "doubao-seedream-5-0-pro",
"prompt": "在标记区域添加一个带杯碟的陶瓷咖啡杯,并保持原始构图。",
"image": ["https://example.com/source.png", "https://example.com/target.png"],
"size": "<string>",
"response_format": "url",
"output_format": "jpeg",
"watermark": True,
"optimize_prompt_options": { "mode": "standard" }
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'doubao-seedream-5-0-pro',
prompt: '在标记区域添加一个带杯碟的陶瓷咖啡杯,并保持原始构图。',
image: ['https://example.com/source.png', 'https://example.com/target.png'],
size: '<string>',
response_format: 'url',
output_format: 'jpeg',
watermark: true,
optimize_prompt_options: {mode: 'standard'}
})
};
fetch('https://www.anyfast.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://www.anyfast.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",
CURLOPT_POSTFIELDS => json_encode([
'model' => 'doubao-seedream-5-0-pro',
'prompt' => '在标记区域添加一个带杯碟的陶瓷咖啡杯,并保持原始构图。',
'image' => [
'https://example.com/source.png',
'https://example.com/target.png'
],
'size' => '<string>',
'response_format' => 'url',
'output_format' => 'jpeg',
'watermark' => true,
'optimize_prompt_options' => [
'mode' => 'standard'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://www.anyfast.ai/v1/images/generations"
payload := strings.NewReader("{\n \"model\": \"doubao-seedream-5-0-pro\",\n \"prompt\": \"在标记区域添加一个带杯碟的陶瓷咖啡杯,并保持原始构图。\",\n \"image\": [\n \"https://example.com/source.png\",\n \"https://example.com/target.png\"\n ],\n \"size\": \"<string>\",\n \"response_format\": \"url\",\n \"output_format\": \"jpeg\",\n \"watermark\": true,\n \"optimize_prompt_options\": {\n \"mode\": \"standard\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://www.anyfast.ai/v1/images/generations")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"doubao-seedream-5-0-pro\",\n \"prompt\": \"在标记区域添加一个带杯碟的陶瓷咖啡杯,并保持原始构图。\",\n \"image\": [\n \"https://example.com/source.png\",\n \"https://example.com/target.png\"\n ],\n \"size\": \"<string>\",\n \"response_format\": \"url\",\n \"output_format\": \"jpeg\",\n \"watermark\": true,\n \"optimize_prompt_options\": {\n \"mode\": \"standard\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.anyfast.ai/v1/images/generations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"doubao-seedream-5-0-pro\",\n \"prompt\": \"在标记区域添加一个带杯碟的陶瓷咖啡杯,并保持原始构图。\",\n \"image\": [\n \"https://example.com/source.png\",\n \"https://example.com/target.png\"\n ],\n \"size\": \"<string>\",\n \"response_format\": \"url\",\n \"output_format\": \"jpeg\",\n \"watermark\": true,\n \"optimize_prompt_options\": {\n \"mode\": \"standard\"\n }\n}"
response = http.request(request)
puts response.read_body{
"model": "doubao-seedream-5-0-pro",
"created": 1775029815,
"data": [
{
"url": "https://ark-content-generation-v2-cn-beijing.example.com/image.png",
"b64_json": "<string>",
"output_format": "png",
"size": "2048x2048",
"error": {
"code": "<string>",
"message": "<string>"
}
}
],
"usage": {
"generated_images": 1,
"input_images": 2,
"output_tokens": 16384,
"total_tokens": 16384
},
"error": {
"code": "<string>",
"message": "<string>"
}
}ByteDance
seedream-5.0-pro
使用 doubao-seedream-5-0-pro 生成或编辑单张图片。该模型支持文生图、单图图生图,以及最多 10 张参考图。不支持组图生成、联网搜索和流式输出。
POST
/
v1
/
images
/
generations
Generate or edit an image
curl --request POST \
--url https://www.anyfast.ai/v1/images/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "doubao-seedream-5-0-pro",
"prompt": "在标记区域添加一个带杯碟的陶瓷咖啡杯,并保持原始构图。",
"image": [
"https://example.com/source.png",
"https://example.com/target.png"
],
"size": "<string>",
"response_format": "url",
"output_format": "jpeg",
"watermark": true,
"optimize_prompt_options": {
"mode": "standard"
}
}
'import requests
url = "https://www.anyfast.ai/v1/images/generations"
payload = {
"model": "doubao-seedream-5-0-pro",
"prompt": "在标记区域添加一个带杯碟的陶瓷咖啡杯,并保持原始构图。",
"image": ["https://example.com/source.png", "https://example.com/target.png"],
"size": "<string>",
"response_format": "url",
"output_format": "jpeg",
"watermark": True,
"optimize_prompt_options": { "mode": "standard" }
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'doubao-seedream-5-0-pro',
prompt: '在标记区域添加一个带杯碟的陶瓷咖啡杯,并保持原始构图。',
image: ['https://example.com/source.png', 'https://example.com/target.png'],
size: '<string>',
response_format: 'url',
output_format: 'jpeg',
watermark: true,
optimize_prompt_options: {mode: 'standard'}
})
};
fetch('https://www.anyfast.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://www.anyfast.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",
CURLOPT_POSTFIELDS => json_encode([
'model' => 'doubao-seedream-5-0-pro',
'prompt' => '在标记区域添加一个带杯碟的陶瓷咖啡杯,并保持原始构图。',
'image' => [
'https://example.com/source.png',
'https://example.com/target.png'
],
'size' => '<string>',
'response_format' => 'url',
'output_format' => 'jpeg',
'watermark' => true,
'optimize_prompt_options' => [
'mode' => 'standard'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://www.anyfast.ai/v1/images/generations"
payload := strings.NewReader("{\n \"model\": \"doubao-seedream-5-0-pro\",\n \"prompt\": \"在标记区域添加一个带杯碟的陶瓷咖啡杯,并保持原始构图。\",\n \"image\": [\n \"https://example.com/source.png\",\n \"https://example.com/target.png\"\n ],\n \"size\": \"<string>\",\n \"response_format\": \"url\",\n \"output_format\": \"jpeg\",\n \"watermark\": true,\n \"optimize_prompt_options\": {\n \"mode\": \"standard\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://www.anyfast.ai/v1/images/generations")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"doubao-seedream-5-0-pro\",\n \"prompt\": \"在标记区域添加一个带杯碟的陶瓷咖啡杯,并保持原始构图。\",\n \"image\": [\n \"https://example.com/source.png\",\n \"https://example.com/target.png\"\n ],\n \"size\": \"<string>\",\n \"response_format\": \"url\",\n \"output_format\": \"jpeg\",\n \"watermark\": true,\n \"optimize_prompt_options\": {\n \"mode\": \"standard\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.anyfast.ai/v1/images/generations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"doubao-seedream-5-0-pro\",\n \"prompt\": \"在标记区域添加一个带杯碟的陶瓷咖啡杯,并保持原始构图。\",\n \"image\": [\n \"https://example.com/source.png\",\n \"https://example.com/target.png\"\n ],\n \"size\": \"<string>\",\n \"response_format\": \"url\",\n \"output_format\": \"jpeg\",\n \"watermark\": true,\n \"optimize_prompt_options\": {\n \"mode\": \"standard\"\n }\n}"
response = http.request(request)
puts response.read_body{
"model": "doubao-seedream-5-0-pro",
"created": 1775029815,
"data": [
{
"url": "https://ark-content-generation-v2-cn-beijing.example.com/image.png",
"b64_json": "<string>",
"output_format": "png",
"size": "2048x2048",
"error": {
"code": "<string>",
"message": "<string>"
}
}
],
"usage": {
"generated_images": 1,
"input_images": 2,
"output_tokens": 16384,
"total_tokens": 16384
},
"error": {
"code": "<string>",
"message": "<string>"
}
}授权
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
请求体
application/json
模型 ID。
可用选项:
doubao-seedream-5-0-pro 示例:
"doubao-seedream-5-0-pro"
图片生成或编辑提示词。如需坐标编辑,可在提示词中加入 或 标签。
示例:
"在标记区域添加一个带杯碟的陶瓷咖啡杯,并保持原始构图。"
参考图 URL/Base64 data URI,或参考图数组。图生图编辑时必填。Seedream 5.0 Pro 最多支持 10 张参考图。官方输入限制:格式支持 jpeg/png/webp/bmp/tiff/gif/heic/heif;单张图片不超过 30 MB;宽高比范围 [1/16, 16];宽和高均至少 14px;总像素不超过 36,000,000。
示例:
[ "https://example.com/source.png", "https://example.com/target.png" ]
输出图片尺寸。可使用 1K、2K,或 2048x1024 这类像素尺寸。显式像素尺寸需要满足官方总像素和宽高比限制。
示例:
{ "tier": { "value": "2K" }, "pixels": { "value": "2048x1024" } }
生成图片返回格式。URL 为临时链接,请及时保存。
可用选项:
url, b64_json 生成图片文件格式。
可用选项:
png, jpeg 是否添加 AI 生成水印。
提示词优化配置。使用标准模式。官方文档说明 Seedream 5.0 Pro 不支持快速模式。
Show child attributes
Show child attributes
此页面对您有帮助吗?
⌘I