YUYU_N1 全能參考影片
YUYU_N1 最多可以放 5 張參考圖(角色、場景、物件都可以),再依照 prompt 生成全新的畫面。影片長度可選 3–10 秒,也可以指定畫面比例和是否有聲音,適合多個角色同框,或需要直式、橫式畫面的情境。
注意:這一頁的規格和〈YUYU_N1 圖生影片〉不同,例如影片長度最短 3 秒(圖生影片是 2 秒),兩頁的參數請不要混用。
POST /api/tasks/reference2video
X-Api-Key: sk-live-xxxx
Content-Type: application/json
Idempotency-Key: 選填,見〈全能參考影片〉的說明
完整範例
images 要放 base64 格式的 data URI,支援 PNG、JPEG、WebP。範例中省略了實際的 base64 內容。
圖片的順序就是角色的順序:第 1 張是第一個角色,第 2 張是第二個角色,prompt 裡可以照這個順序描述誰做了什麼:
curl -X POST https://yuyuvideo.com/api/tasks/reference2video \
-H "X-Api-Key: sk-live-xxxx" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: order-20261001-00042" \
-d '{
"model": "YUYU_N1",
"prompt": "the woman from image 1 and the man from image 2 walk side by side on a beach at sunset, cinematic lighting",
"images": [
"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA...",
"data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQ..."
],
"duration": 5,
"resolution": "540p",
"aspect_ratio": "9:16",
"audio": true,
"payload": { "external_order_id": "order-20261001-00042" },
"callback_url": "https://example.com/webhooks/yuyu-video"
}'
建立成功會回傳 201 Created 和任務資料。這時任務還在排隊,files 是空的;你沒帶的欄位,會在 params 裡補上預設值。credits 是這次扣除的積分,範例中的數字僅供參考:
{
"public_id": "01K6A1B2C3D4E5F6G7H8J9K0LM",
"type": 4,
"status": 0,
"credits": 20,
"params": {
"model": "YUYU_N1",
"prompt": "the woman from image 1 and the man from image 2 walk side by side on a beach at sunset, cinematic lighting",
"images": [
"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA...",
"data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQ..."
],
"duration": 5,
"resolution": "540p",
"aspect_ratio": "9:16",
"audio": true,
"payload": { "external_order_id": "order-20261001-00042" },
"callback_url": "https://example.com/webhooks/yuyu-video"
},
"error_code": null,
"error_message": null,
"created_at": "2026-10-01T08:00:00.000000Z",
"finished_at": null,
"files_expire_at": null,
"files_expired": false,
"files": []
}
接下來如何查詢進度、下載影片,請見〈任務查詢與取件〉。
參數表
| 欄位 | 型別 | 必填 | 說明 |
|---|---|---|---|
model |
string | 是 | 填 YUYU_N1 |
prompt |
string | 是 | 影片描述,最多 1500 字 |
images |
string[] | 否 | 參考圖 0–5 張,依順序對應角色,格式為 base64 data URI(data:image/{png|jpeg|webp};base64,...) |
duration |
integer | 否 | 影片長度 3–10 秒,預設 5。每 5 秒為一個計費單位,不足 5 秒以 5 秒計,詳見〈積分與計費〉 |
resolution |
string | 否 | 目前只有 540p(預設),填其他值會回傳 422 |
aspect_ratio |
string | 否 | 畫面比例:16:9 / 9:16 / 1:1 / 3:4 / 4:3,預設 16:9 |
audio |
boolean | 否 | 是否有聲音,預設 true |
payload |
object | 否 | 自訂資料,例如你的訂單編號。系統不會讀取或修改,查詢任務和 Webhook 通知時會原樣帶回 |
callback_url |
string | 否 | 任務結束時要通知的網址,需以 https:// 開頭,最多 2000 字。詳見〈回呼(Webhook)〉 |
這個 API 的 YUYU_N1 不支援 seed,帶了會回傳 422。
model 填了不存在的模型會回傳 422:Unknown model alias: {model}。
表格沒有列出的參數(age_declared 除外,詳見〈生成前年齡檢查〉)帶了會回傳 422,不會被忽略。
錯誤情境
| 狀態碼 | 原因 | 回應內容 |
|---|---|---|
422 |
參數有誤,例如缺少必填欄位、型別錯誤、images 超過 5 張、prompt 超過 1500 字、duration / resolution / aspect_ratio / audio 超出允許範圍 |
errors 欄位會列出每個欄位的錯誤原因 |
422 |
model 填了不存在的模型 |
{ "message": "Unknown model alias: {model}" } |
402 |
積分不足 | { "message": "Insufficient credits to complete this charge." } |
429 |
排隊中的全能參考影片任務太多 | { "message": "Too many pending tasks of this type; please retry later." }。可以依回應的 Retry-After header 決定多久後再試 |
扣款規則請見〈積分與計費〉。