官方文档:https://platform.vidu.cn/docs/reference-to-image
POST
/ent/v2/reference2image创建图片生成任务
API Key application/json
请求示例
curl -X POST https://top.qingyuntop.ai/ent/v2/reference2image \
-H "Authorization: Bearer ${QINGYUN_TOP_API_KEY}" \
-H "Content-Type: application/json" \
-d '{
"model": "viduq1",
"prompt": "一只可爱的小猫坐在窗台上,阳光洒在它的身上,温馨的画面"
}'请求参数
| 参数 | 位置 | 类型 | 必填 | 说明 | 示例 |
|---|---|---|---|---|---|
Authorization | Header | string | 否 | - | Bearer {{YOUR_API_KEY}} |
Content-Type | Header | string | 否 | - | application/json |
model | JSON body | string | 是 | 模型名称 可选值:viduq2、viduq1 viduq2:支持文生图、图片编辑、参考生图 viduq1:支持参考生图 | - |
images | JSON body | array<string> | 否 | 图像参考 viduq2:支持输入 0~7 张图片 viduq1:支持输入 1~7 张图片 模型将以此参数中传入的图片中的主题为参考,生成与图片中主体一致的视频。 注1:支持传入图片 Base64 编码或图片URL(确保可访问) 注2:图片支持 png、jpeg、jpg、webp格式 注3:图片像素不能小于 128*128,且比例需要小于1:4或者4:1 注4: 且大小不超过50M 注5:请注意,http请求的post body不超过20MB,且编码必须包含适当的内容类型字符串,例如: data:image/png;base64,{base64_encode} | - |
prompt | JSON body | string | 是 | 文本提示词 视频生成的文本描述,长度不能超过 2000 个字符 注1:viduq2模型支持文生图,在使用viduq2模型,且没有上传任何images时,模型会使用该参数的文本内容生成图片 | - |
seed | JSON body | string | 否 | 随机种子参数 当默认不传或者传0时,会使用随机数替代 手动设置则使用设置的种子 | - |
aspect_ratio | JSON body | string | 否 | 比例参数,不同模型支持不同的比例: viduq1:默认值16:9,可选值:16:9、9:16、1:1、3:4、4:3 viduq2:默认值16:9,可选值如下:16:9、9:16、1:1、3:4、4:3、21:9、2:3、3:2 - auto:表示与首张输入图保持相同比例 | - |
resolution | JSON body | string | 否 | 分辨率参数,不同模型支持的分辨率不同: viduq1:默认1080p,可选项:1080p viduq2:默认1080p,可选项:1080p、2K、4K | - |
payload | JSON body | string | 否 | 透传参数 不做任何处理,仅数据传输 注:最多 1048576个字符 | - |
callback_url | JSON body | string | 否 | Callback 协议 需要您在创建任务时主动设置 callback_url,请求方法为 POST,当视频生成任务有状态变化时,Vidu 将向此地址发送包含任务最新状态的回调请求。回调请求内容结构与查询任务API的返回体一致 回调返回的“status”包括以下状态: - processing 任务处理中 - success 任务完成(如发送失败,回调三次) - failed 任务失败(如发送失败,回调三次) Vidu采用回调签名算法进行认证,详情见:回调签名算法 | - |
返回响应 (200)
| 参数 | 位置 | 类型 | 必填 | 说明 | 示例 |
|---|---|---|---|---|---|
task_id | 响应 JSON | string | 是 | - | - |
state | 响应 JSON | string | 是 | - | - |
model | 响应 JSON | string | 是 | - | - |
prompt | 响应 JSON | string | 是 | - | - |
images | 响应 JSON | array<string> | 是 | - | - |
seed | 响应 JSON | integer | 是 | - | - |
aspect_ratio | 响应 JSON | string | 是 | - | - |
callback_url | 响应 JSON | string | 是 | - | - |
payload | 响应 JSON | string | 是 | - | - |
cus_priority | 响应 JSON | integer | 是 | - | - |
credits | 响应 JSON | integer | 是 | - | - |
created_at | 响应 JSON | string | 是 | - | - |
watermark | 响应 JSON | boolean | 是 | - | - |
响应示例
{
"task_id": "911092490931552256",
"state": "created",
"model": "viduq2",
"prompt": "一只可爱的小猫坐在窗台上,阳光洒在它的身上,温馨的画面",
"images": [],
"seed": 616519648,
"aspect_ratio": "auto",
"callback_url": "",
"payload": "",
"cus_priority": 0,
"credits": 6,
"created_at": "2026-01-20T07:08:12.262592985Z",
"watermark": false
}来源原始接口定义(用于追溯)
以下内容来自 Apifox 快照,可能包含兼容层字段或旧示例;公开调用请以本页的协议说明和当前模型列表为准。
{
"id": 495899878,
"name": "创建图片生成任务",
"type": "http",
"serverId": "",
"preProcessors": [],
"postProcessors": [],
"inheritPreProcessors": {},
"inheritPostProcessors": {},
"description": "官方文档:https://platform.vidu.cn/docs/reference-to-image",
"operationId": "",
"sourceUrl": "",
"method": "post",
"path": "/ent/v2/reference2image",
"tags": [],
"status": 1,
"requestBody": {
"type": "application/json",
"parameters": [],
"jsonSchema": {
"type": "object",
"properties": {
"prompt": {
"type": "string",
"description": "文本提示词\n视频生成的文本描述,长度不能超过 2000 个字符\n注1:viduq2模型支持文生图,在使用viduq2模型,且没有上传任何images时,模型会使用该参数的文本内容生成图片"
},
"model": {
"type": "string",
"description": "模型名称\n可选值:viduq2、viduq1\nviduq2:支持文生图、图片编辑、参考生图\nviduq1:支持参考生图"
},
"seed": {
"type": "string",
"description": "随机种子参数\n当默认不传或者传0时,会使用随机数替代\n手动设置则使用设置的种子"
},
"images": {
"type": "array",
"items": {
"type": "string"
},
"description": "图像参考\nviduq2:支持输入 0~7 张图片\nviduq1:支持输入 1~7 张图片\n模型将以此参数中传入的图片中的主题为参考,生成与图片中主体一致的视频。\n注1:支持传入图片 Base64 编码或图片URL(确保可访问)\n注2:图片支持 png、jpeg、jpg、webp格式\n注3:图片像素不能小于 128*128,且比例需要小于1:4或者4:1\n注4: 且大小不超过50M\n注5:请注意,http请求的post body不超过20MB,且编码必须包含适当的内容类型字符串,例如:\n\ndata:image/png;base64,{base64_encode}"
},
"aspect_ratio": {
"type": "string",
"description": "比例参数,不同模型支持不同的比例:\nviduq1:默认值16:9,可选值:16:9、9:16、1:1、3:4、4:3\nviduq2:默认值16:9,可选值如下:16:9、9:16、1:1、3:4、4:3、21:9、2:3、3:2\n- auto:表示与首张输入图保持相同比例"
},
"resolution": {
"type": "string",
"description": "分辨率参数,不同模型支持的分辨率不同:\nviduq1:默认1080p,可选项:1080p\nviduq2:默认1080p,可选项:1080p、2K、4K"
},
"payload": {
"type": "string",
"description": "透传参数\n不做任何处理,仅数据传输\n注:最多 1048576个字符"
},
"callback_url": {
"type": "string",
"description": "Callback 协议\n需要您在创建任务时主动设置 callback_url,请求方法为 POST,当视频生成任务有状态变化时,Vidu 将向此地址发送包含任务最新状态的回调请求。回调请求内容结构与查询任务API的返回体一致\n回调返回的“status”包括以下状态:\n- processing 任务处理中\n- success 任务完成(如发送失败,回调三次)\n- failed 任务失败(如发送失败,回调三次)\nVidu采用回调签名算法进行认证,详情见:回调签名算法"
}
},
"required": [
"model",
"prompt"
],
"x-apifox-orders": [
"model",
"images",
"prompt",
"seed",
"aspect_ratio",
"resolution",
"payload",
"callback_url"
]
},
"examples": [
{
"mediaType": "application/json",
"value": "{\r\n \"model\": \"viduq1\",\r\n \"prompt\": \"一只可爱的小猫坐在窗台上,阳光洒在它的身上,温馨的画面\"\r\n}"
}
],
"mediaType": "",
"oasExtensions": "",
"required": false,
"additionalContentTypes": []
},
"parameters": {
"path": [],
"query": [],
"cookie": [],
"header": [
{
"id": "Jsj23RwEo1",
"name": "Authorization",
"required": false,
"enable": true,
"description": "",
"type": "string",
"sampleValue": "Bearer {{YOUR_API_KEY}}"
},
{
"id": "jjYSOg2NrR",
"name": "Content-Type",
"required": false,
"enable": true,
"description": "",
"type": "string",
"sampleValue": "application/json"
}
]
},
"commonParameters": {
"query": [],
"body": [],
"cookie": [],
"header": []
},
"auth": {
"type": "inherit",
"inherit": {}
},
"responses": [
{
"id": 183038695,
"name": "成功",
"code": 200,
"contentType": "json",
"jsonSchema": {
"type": "object",
"properties": {
"task_id": {
"type": "string"
},
"state": {
"type": "string"
},
"model": {
"type": "string"
},
"prompt": {
"type": "string"
},
"images": {
"type": "array",
"items": {
"type": "string"
}
},
"seed": {
"type": "integer"
},
"aspect_ratio": {
"type": "string"
},
"callback_url": {
"type": "string"
},
"payload": {
"type": "string"
},
"cus_priority": {
"type": "integer"
},
"credits": {
"type": "integer"
},
"created_at": {
"type": "string"
},
"watermark": {
"type": "boolean"
}
},
"required": [
"task_id",
"state",
"model",
"prompt",
"images",
"seed",
"aspect_ratio",
"callback_url",
"payload",
"cus_priority",
"credits",
"created_at",
"watermark"
],
"x-apifox-orders": [
"task_id",
"state",
"model",
"prompt",
"images",
"seed",
"aspect_ratio",
"callback_url",
"payload",
"cus_priority",
"credits",
"created_at",
"watermark"
]
},
"itemSchema": {},
"description": "",
"mediaType": "",
"headers": [],
"oasExtensions": ""
}
],
"responseExamples": [
{
"name": "成功示例",
"responseId": 183038695,
"data": "{\r\n \"task_id\": \"911092490931552256\",\r\n \"state\": \"created\",\r\n \"model\": \"viduq2\",\r\n \"prompt\": \"一只可爱的小猫坐在窗台上,阳光洒在它的身上,温馨的画面\",\r\n \"images\": [],\r\n \"seed\": 616519648,\r\n \"aspect_ratio\": \"auto\",\r\n \"callback_url\": \"\",\r\n \"payload\": \"\",\r\n \"cus_priority\": 0,\r\n \"credits\": 6,\r\n \"created_at\": \"2026-01-20T07:08:12.262592985Z\",\r\n \"watermark\": false\r\n}",
"description": "",
"oasKey": "",
"oasExtensions": "",
"id": "019fc09b-0b30-7549-bf4d-6b1fd9e9c3b8"
}
],
"codeSamples": [],
"projectId": 8662722,
"moduleId": 8310462,
"folderId": 92436088,
"ordering": 12,
"responsibleId": 0,
"commonResponseStatus": {},
"advancedSettings": {
"disabledSystemHeaders": {}
},
"customApiFields": {},
"oasExtensions": "",
"mockScript": {},
"createdAt": "2026-08-02T03:53:34.000Z",
"updatedAt": "2026-08-06T12:15:55.000Z",
"creatorId": 2863449,
"editorId": 2863449,
"creatorUserId": 2863449,
"editorUserId": 2863449,
"responseChildren": [],
"visibility": "INHERITED",
"securityScheme": {},
"callbacks": ""
}