参考生成图片
更新时间: 2026/08/27 10:13:38
该接口可以根据提示词和参考图生成图片。
请求信息
请求 URL
POST /hub/vidu/v2/reference2image
请求头
| Header | 必填 | 示例值 |
|---|---|---|
Authorization |
是 | Bearer sk-xxxxx |
Content-Type |
是 | application/json; charset=utf-8 |
请求体
请求示例
json{
"model": "viduq2",
"images": [
"https://example.com/ref-1.png",
"https://example.com/ref-2.png"
],
"prompt": "生成一张电影质感的人像海报,保留参考图主体特征。",
"seed": 0,
"aspect_ratio": "16:9",
"resolution": "2K"
}
响应信息
响应体
| 字段 | 类型 | 说明 |
|---|---|---|
task_id |
string | 任务 ID |
state |
string | 任务状态。常见值:created、queueing、processing、success、failed |
model |
string | 模型名称 |
images |
string[] | 输入图片 |
prompt |
string | 提示词 |
seed |
int | 随机种子 |
aspect_ratio |
string | 画面比例 |
resolution |
string | 分辨率 |
payload |
string | 透传字段 |
credits |
string | 消耗量 |
created_at |
string | 创建时间 |
响应示例
json{
"task_id": "tsk_1234567900",
"state": "created",
"model": "viduq2",
"images": [
"https://example.com/ref-1.png",
"https://example.com/ref-2.png"
],
"prompt": "生成一张电影质感的人像海报,保留参考图主体特征。",
"seed": 11223344,
"aspect_ratio": "16:9",
"resolution": "2K",
"payload": "",
"credits": "12.000000",
"created_at": "2026-04-16T09:40:00Z"
}
错误码
完整列表请参考客户端 API 错误码。
此文档是否对你有帮助?




