Seedream 3.0 图片生成
说明
异步任务接口,用于提交 Seedream 3.0 文生图任务,具体生成进度与结果请通过任务查询接口获取。
请求地址
http
POST /open/v1/ai_creation/task/submitHeader
http
access_token: {{access_token}}
Content-Type: application/json请求参数 Body
json
{
"ref_prompt": "赛博朋克城市夜景,霓虹灯,雨夜,电影镜头",
"creation_type": 3,
"aspect_ratio": "16:9",
"clarity": 2048,
"number_of_images": 1,
"model_code": "doubao-seedream-3.0-t2i"
}参数说明
| 字段 | 类型 | 是否必传 | 示例 | 说明 |
|---|---|---|---|---|
| ref_prompt | string | 是 | 赛博朋克城市夜景,霓虹灯,雨夜,电影镜头 | 图片生成提示词 |
| creation_type | int | 是 | 3 | 创作类型,图片生成为 3 |
| aspect_ratio | string | 否 | 16:9 | 输出图片宽高比,支持 1:1、3:4、4:3、9:16、16:9,默认1:1 |
| clarity | int | 否 | 2048 | 图片清晰度档位,支持 1024、2048、4096 ,默认 2048 |
| number_of_images | int | 是 | 1 | 本次任务生成图片数量,1-4 张 |
| model_code | string | 是 | doubao-seedream-3.0-t2i | 模型编码,固定为 doubao-seedream-3.0-t2i |
注意:Seedream 3.0 为文生图模型,不支持
ref_img_url参考图输入。
响应示例
json
{
"trace_id": "96afa792520b0e6a86d72e89435bc0a7",
"code": 0,
"msg": "success",
"data": "a60747d7-dc05-4afc-b2ef-ee4370ed53c6"
}响应字段说明
| 字段 | 说明 |
|---|---|
| code | 响应状态码 |
| msg | 响应信息 |
| trace_id | 请求链路追踪 ID |
| data | 提交的创作 ID |
响应状态码说明
| code | 说明 |
|---|---|
| 0 | 响应成功 |
| 400 | 传入参数格式错误 |
| 10400 | AccessToken 验证失败 |
| 40000 | 参数错误 |
| 40001 | 超出 QPS 限制 |
| 50000 | 系统内部错误 |
示例代码
shell
curl --location --request POST 'https://www.chanjing.cc/open/v1/ai_creation/task/submit' \
--header 'access_token: {{access_token}}' \
--header 'Content-Type: application/json' \
--data-raw '{
"ref_prompt": "赛博朋克城市夜景,霓虹灯,雨夜,电影镜头",
"creation_type": 3,
"aspect_ratio": "16:9",
"clarity": 2048,
"number_of_images": 1,
"model_code": "doubao-seedream-3.0-t2i"
}'go
payload := strings.NewReader(`{
"ref_prompt": "赛博朋克城市夜景,霓虹灯,雨夜,电影镜头",
"creation_type": 3,
"aspect_ratio": "16:9",
"clarity": 2048,
"number_of_images": 1,
"model_code": "doubao-seedream-3.0-t2i"
}`)java
RequestBody body = RequestBody.create(mediaType, "{\n \"ref_prompt\": \"赛博朋克城市夜景,霓虹灯,雨夜,电影镜头\",\n \"creation_type\": 3,\n \"aspect_ratio\": \"16:9\",\n \"clarity\": 2048,\n \"number_of_images\": 1,\n \"model_code\": \"doubao-seedream-3.0-t2i\"\n}");py
payload = json.dumps({
"ref_prompt": "赛博朋克城市夜景,霓虹灯,雨夜,电影镜头",
"creation_type": 3,
"aspect_ratio": "16:9",
"clarity": 2048,
"number_of_images": 1,
"model_code": "doubao-seedream-3.0-t2i"
})