YUYU_M6 全能參考影片

YUYU_M6 只需要 1 張參考圖,會以圖中的角色為主角,依照 prompt 生成全新的畫面。影片長度固定 5 秒,畫面比例跟著參考圖,適合單一角色、規格固定的短片。

POST /api/tasks/reference2video
X-Api-Key: sk-live-xxxx
Content-Type: application/json
Idempotency-Key: 選填,見〈全能參考影片〉的說明

完整範例

images 要放 base64 格式的 data URI,支援 PNG、JPEG、WebP。範例中省略了實際的 base64 內容。duration 固定是 5,但仍然要填:

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-00043" \
  -d '{
    "model": "YUYU_M6",
    "prompt": "she walks along the beach at sunset, the wind gently blowing her hair, cinematic",
    "images": ["data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA..."],
    "duration": 5,
    "seed": 1234567,
    "payload": { "external_order_id": "order-20261001-00043" },
    "callback_url": "https://example.com/webhooks/yuyu-video"
  }'

建立成功會回傳 201 Created 和任務資料。這時任務還在排隊,files 是空的。credits 是這次扣除的積分,範例中的數字僅供參考:

{
  "public_id": "01K6A1B2C3D4E5F6G7H8J9K0LN",
  "type": 4,
  "status": 0,
  "credits": 10,
  "params": {
    "model": "YUYU_M6",
    "prompt": "she walks along the beach at sunset, the wind gently blowing her hair, cinematic",
    "images": ["data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA..."],
    "duration": 5,
    "seed": 1234567,
    "prompt_enhance": false,
    "payload": { "external_order_id": "order-20261001-00043" },
    "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_M6
prompt string 是 影片描述,最多 10000 字
images string[] 是 只能放 1 張參考圖,0 張或 2 張以上都會回傳 422。格式為 base64 data URI(data:image/{png|jpeg|webp};base64,...)
duration integer 是 只能填 5,不能省略,填其他值會回傳 422
seed integer 否 隨機種子,1–2147483647。不帶的話每次隨機
prompt_enhance boolean 否 提示詞優化,預設 false。設為 true 時,系統會先把你的 prompt 補成完整的鏡頭、動作與聲音描述再生成影片,prompt 寫得比較簡短時特別有用;引號內的台詞會原字保留。會多扣積分,實際金額以回應中的 credits 為準
payload object 否 自訂資料,例如你的訂單編號。系統不會讀取或修改,查詢任務和 Webhook 通知時會原樣帶回
callback_url string 否 任務結束時要通知的網址,需以 https:// 開頭,最多 2000 字。詳見〈回呼(Webhook)〉

YUYU_M6 不支援 resolution、aspect_ratio、audio,帶了會回傳 422。畫面比例會跟著參考圖:想要直式影片就用直式的圖,想要橫式就用橫式的圖。

model 填了不存在的模型會回傳 422:Unknown model alias: {model}。

表格沒有列出的參數(age_declared 除外,詳見〈生成前年齡檢查〉)帶了會回傳 422,不會被忽略。

錯誤情境

狀態碼 原因 回應內容
422 參數有誤,例如缺少必填欄位、型別錯誤、images 不是 1 張、duration 不是 5、seed 超出範圍 errors 欄位會列出每個欄位的錯誤原因
422 設定了 prompt_enhance: true,但提示詞優化暫時無法使用 { "message": "Prompt enhancement is temporarily unavailable", "errors": { "prompt_enhance": ["Prompt enhancement is temporarily unavailable"] } }。不會建立任務,也不會扣積分,可以改成 false 或不帶這個參數再送一次
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 決定多久後再試

扣款規則請見〈積分與計費〉。