# Pixverse V6 API Pixverse V6 影片生成模型的完整 API 參考。所有變體都使用統一的影片任務端點。 ## 模型變體 | 模型 | ID | 說明 | | ----- | --- | ----------- | | **Pixverse V6 Text to Video** | `pixverse-v6-text-to-video` | 根據文字提示詞生成影片 | | **Pixverse V6 Image to Video** | `pixverse-v6-image-to-video` | 從單張首幀圖片生成動畫 | | **Pixverse V6 Transition** | `pixverse-v6-transition` | 在首幀和末幀圖片之間生成轉場 | | **Pixverse V6 Extend** | `pixverse-v6-extend` | 根據 `prompt` 引導,用新幀延展現有影片 | ## 快速對比 | 功能 | Text to Video | Image to Video | Transition | Extend | | ------- | ------------- | -------------- | ---------- | ------ | | `prompt` | 必填 | 必填 | 必填 | 必填 | | `aspect_ratio` | 可選(預設 `16:9`);見下方支援的比例 | 不使用(跟隨輸入圖片) | 不使用(跟隨輸入圖片) | 不使用(跟隨輸入影片) | | `image_url` | — | 必填 | 必填(首幀) | — | | `image_end_url` | — | — | 必填(末幀) | — | | `video_url` | — | — | — | 必填(來源影片) | | `negative_prompt` | — | — | 可選 | 可選 | | `seed` | — | — | 可選(`0` 按產品預設值處理) | 可選 | | 時長 | 1–15 秒 | 1–15 秒 | 1–15 秒 | 1–15 秒 | | 解析度 | `360p`, `540p`, `720p`, `1080p` | 相同 | 相同 | 相同 | | 音訊 | 可透過 `sound` 啟用 | 可透過 `sound` 啟用 | 可透過 `sound` 啟用 | 可透過 `sound` 啟用 | Text-to-video 模型支援以下長寬比:`21:9`, `16:9`, `9:16`, `1:1`, `4:3`, `3:4`, `3:2`, `2:3`。 ## Pixverse V6 Text to Video ### 端點 ``` POST /api/v1/video/task ``` ### 請求參數 #### 必填 | 參數 | 類型 | 說明 | | --------- | ---- | ----------- | | `model_name` | string | 必須為 `"pixverse-v6-text-to-video"` | | `prompt` | string | 影片生成提示詞 | | `duration` | integer | 影片時長,單位為秒(`1`–`15`) | | `resolution` | string | `360p`, `540p`, `720p`, `1080p` 之一 | #### 可選 | 參數 | 類型 | 說明 | | --------- | ---- | ----------- | | `aspect_ratio` | string | 預設 `16:9`。可選 `21:9`, `16:9`, `9:16`, `1:1`, `4:3`, `3:4`, `3:2`, `2:3` | | `sound` | boolean | 是否為影片生成音訊 | ### 請求範例 ```javascript const response = await fetch('https://api.flaq.ai/api/v1/video/task', { method: 'POST', headers: { Authorization: 'Bearer YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ model_name: 'pixverse-v6-text-to-video', prompt: 'A cinematic street scene at night with neon reflections', duration: 8, resolution: '1080p', aspect_ratio: '16:9', sound: true, }), }); const { data } = await response.json(); const taskId = data.task_id; ``` ## Pixverse V6 Image to Video ### 請求參數 #### 必填 | 參數 | 類型 | 說明 | | --------- | ---- | ----------- | | `model_name` | string | 必須為 `"pixverse-v6-image-to-video"` | | `prompt` | string | 影片生成提示詞 | | `duration` | integer | 影片時長,單位為秒(`1`–`15`) | | `resolution` | string | `360p`, `540p`, `720p`, `1080p` 之一 | | `image_url` | string | 首幀圖片的 URL | #### 可選 | 參數 | 類型 | 說明 | | --------- | ---- | ----------- | | `sound` | boolean | 是否為影片生成音訊 | ### 請求範例 ```javascript const response = await fetch('https://api.flaq.ai/api/v1/video/task', { method: 'POST', headers: { Authorization: 'Bearer YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ model_name: 'pixverse-v6-image-to-video', prompt: 'Fluid camera pan; maintain subject identity', duration: 6, resolution: '720p', image_url: 'https://example.com/first-frame.jpg', sound: true, }), }); const { data } = await response.json(); const taskId = data.task_id; ``` ## Pixverse V6 Transition 在**首幀**和**末幀**關鍵幀圖片之間生成動作。支援可選的 negative prompting 和 seed。 ### 請求參數 #### 必填 | 參數 | 類型 | 說明 | | --------- | ---- | ----------- | | `model_name` | string | 必須為 `"pixverse-v6-transition"` | | `prompt` | string | 描述兩幀之間的動作 | | `duration` | integer | 影片時長,單位為秒(`1`–`15`) | | `resolution` | string | `360p`, `540p`, `720p`, `1080p` 之一 | | `image_url` | string | 首幀圖片的 URL | | `image_end_url` | string | 末幀圖片的 URL | #### 可選 | 參數 | 類型 | 說明 | | --------- | ---- | ----------- | | `sound` | boolean | 是否為影片生成音訊 | | `negative_prompt` | string | 希望在輸出中避免的內容 | | `seed` | integer | 隨機種子;`0` 遵循平台預設隨機行為 | ### 請求範例 ```javascript const response = await fetch('https://api.flaq.ai/api/v1/video/task', { method: 'POST', headers: { Authorization: 'Bearer YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ model_name: 'pixverse-v6-transition', prompt: 'Seamless blend with natural lighting continuity', duration: 6, resolution: '720p', image_url: 'https://example.com/start.jpg', image_end_url: 'https://example.com/end.jpg', sound: true, negative_prompt: 'blur, watermark, text overlay', seed: 0, }), }); const { data } = await response.json(); const taskId = data.task_id; ``` ## Pixverse V6 Extend 延續現有片段。提供來源影片 URL 和描述故事應如何推進的提示詞。 ### 請求參數 #### 必填 | 參數 | 類型 | 說明 | | --------- | ---- | ----------- | | `model_name` | string | 必須為 `"pixverse-v6-extend"` | | `prompt` | string | 描述影片應如何繼續 | | `duration` | integer | 影片時長,單位為秒(`1`–`15`) | | `resolution` | string | `360p`, `540p`, `720p`, `1080p` 之一 | | `video_url` | string | 要延展的來源影片 URL | #### 可選 | 參數 | 類型 | 說明 | | --------- | ---- | ----------- | | `sound` | boolean | 是否為影片生成音訊 | | `negative_prompt` | string | 希望在輸出中避免的內容 | | `seed` | integer | 隨機種子;`0` 遵循平台預設隨機行為 | ### 請求範例 ```javascript const response = await fetch('https://api.flaq.ai/api/v1/video/task', { method: 'POST', headers: { Authorization: 'Bearer YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ model_name: 'pixverse-v6-extend', prompt: 'Continue the walk into the forest clearing', duration: 5, resolution: '720p', video_url: 'https://example.com/source-clip.mp4', sound: false, negative_prompt: 'low quality, jitter', seed: 0, }), }); const { data } = await response.json(); const taskId = data.task_id; ``` ## 回應格式 ### 初始回應 ```json { "code": 0, "message": "success", "data": { "task_id": "{task_id}", "response_url": "https://api.flaq.ai/api/v1/video/{task_id}", "task_status": "submitted" } } ``` ### 輪詢回應 輪詢 `GET /api/v1/video/{taskId}` 以檢查狀態: ```json { "code": 0, "message": "success", "data": { "task_id": "{task_id}", "response_url": "https://api.flaq.ai/api/v1/video/{task_id}", "task_status": "succeed", "task_status_msg": null, "task_result": { "credit": 0.2, "videos": [ { "url": "https://example.com/generated-video.mp4" } ] } } } ``` ### 狀態值 - `submitted`: 任務已接受,等待處理 - `processing`: 影片生成進行中 - `succeed`: 影片生成完成 - `failed`: 影片生成失敗 ## 最佳實務 1. **Extend**:使用乾淨、穩定的來源影片,幫助模型在沒有偽影的情況下延續動作。 2. **Transition**:需要可重複的轉場測試時,將 `negative_prompt` 與 `seed` 搭配使用。 3. **解析度**:讓 `resolution` 匹配交付目標;更高解析度需要更長處理時間。 4. **輪詢**:每 5–10 秒輪詢一次,直到 `task_status` 為 `succeed` 或 `failed`。