跳转到主要内容
POST
/
v1
/
images
/
generations
创建图生图任务
curl --request POST \
  --url https://www.anyfast.ai/v1/images/generations \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "model": "doubao-seedream-4-5-251128",
  "prompt": "生成女孩和奶牛玩偶在游乐园开心地坐过山车的图片",
  "image": [
    "https://example.com/ref1.png",
    "https://example.com/ref2.png"
  ],
  "sequential_image_generation": "auto",
  "sequential_image_generation_options": {
    "max_images": 3
  },
  "size": "1024x1024",
  "watermark": false,
  "seed": 123,
  "logo_info": {
    "add_logo": true,
    "position": 123,
    "language": 123,
    "opacity": 123
  }
}
'
{
  "model": "doubao-seedream-4-5-251128",
  "created": 1775029815,
  "data": [
    {
      "url": "https://ark-content-generation-v2-cn-beijing.example.com/image.png",
      "size": "2048x2048"
    }
  ],
  "usage": {
    "generated_images": 1,
    "output_tokens": 16384,
    "total_tokens": 16384
  }
}

授权

Authorization
string
header
必填

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

请求体

application/json
model
enum<string>
必填

Model ID

可用选项:
doubao-seedream-4-5-251128
示例:

"doubao-seedream-4-5-251128"

prompt
string
必填

图片生成提示词。

示例:

"生成女孩和奶牛玩偶在游乐园开心地坐过山车的图片"

image
string[]
必填

参考图片 URL 列表,用于图生图。图生图时必填。

示例:
[
  "https://example.com/ref1.png",
  "https://example.com/ref2.png"
]
sequential_image_generation
enum<string>

连续图片生成模式。设为 'auto' 可批量生成多张图片。

可用选项:
auto
sequential_image_generation_options
object

连续图片生成选项。

size
string

输出图片尺寸,支持的值因模型而异。

示例:

"1024x1024"

watermark
boolean
默认值:false

是否添加水印。

seed
integer

随机种子,用于复现结果。

logo_info
object

自定义 Logo 水印配置。

响应

图片生成成功

model
string

使用的模型。

示例:

"doubao-seedream-4-5-251128"

created
integer

创建时间戳(Unix 秒)。

示例:

1775029815

data
object[]

生成的图片列表。

usage
object

Token 用量。