# Pixverse C1 API Pixverse C1 影片生成模型的完整 API 參考。所有變體都使用統一的影片任務端點。 ## 模型變體 | 模型 | ID | 說明 | | ----- | --- | ----------- | | **Pixverse C1 Text to Video** | `pixverse-c1-text-to-video` | 根據文字提示詞生成影片 | | **Pixverse C1 Image to Video** | `pixverse-c1-image-to-video` | 從單張首幀圖片生成動畫 | | **Pixverse C1 Transition** | `pixverse-c1-transition` | 在首幀和末幀圖片之間生成轉場 | ## 快速對比 | 功能 | Text to Video | Image to Video | Transition | | ------- | ------------- | -------------- | ---------- | | `prompt` | 必填 | 必填 | 必填 | | `aspect_ratio` | 可選(預設 `16:9`);見下方支援的比例 | 不使用(跟隨輸入圖片) | 不使用(跟隨輸入圖片) | | `image_url` | — | 必填 | 必填(首幀) | | `image_end_url` | — | — | 必填(末幀) | | 時長 | 1–15 秒 | 1–15 秒 | 1–15 秒 | | 解析度 | `360p`, `540p`, `720p`, `1080p` | 相同 | 相同 | | 音訊 | 可透過 `sound` 啟用 | 可透過 `sound` 啟用 | 可透過 `sound` 啟用 | Text-to-video 模型支援以下長寬比:`21:9`, `16:9`, `9:16`, `1:1`, `4:3`, `3:4`, `3:2`, `2:3`。 ## Pixverse C1 Text to Video ### 端點 ``` POST /api/v1/video/task ``` ### 請求參數 #### 必填 | 參數 | 類型 | 說明 | | --------- | ---- | ----------- | | `model_name` | string | 必須為 `"pixverse-c1-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-c1-text-to-video', prompt: 'A drone shot over coastline at golden hour', duration: 5, resolution: '720p', aspect_ratio: '16:9', sound: true, }), }); const { data } = await response.json(); const taskId = data.task_id; ``` ## Pixverse C1 Image to Video ### 請求參數 #### 必填 | 參數 | 類型 | 說明 | | --------- | ---- | ----------- | | `model_name` | string | 必須為 `"pixverse-c1-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-c1-image-to-video', prompt: 'Slow zoom in; soft natural motion', duration: 5, resolution: '720p', image_url: 'https://example.com/first-frame.jpg', sound: false, }), }); const { data } = await response.json(); const taskId = data.task_id; ``` ## Pixverse C1 Transition 在**首幀**和**末幀**關鍵幀圖片之間生成動作。 ### 請求參數 #### 必填 | 參數 | 類型 | 說明 | | --------- | ---- | ----------- | | `model_name` | string | 必須為 `"pixverse-c1-transition"` | | `prompt` | string | 描述兩幀之間的動作 | | `duration` | integer | 影片時長,單位為秒(`1`–`15`) | | `resolution` | string | `360p`, `540p`, `720p`, `1080p` 之一 | | `image_url` | string | 首幀圖片的 URL | | `image_end_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-c1-transition', prompt: 'Smooth cinematic morph between the two scenes', duration: 6, resolution: '720p', image_url: 'https://example.com/start.jpg', image_end_url: 'https://example.com/end.jpg', sound: true, }), }); 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. **解析度**:使用 `720p` 或 `1080p` 在品質和生成時間之間取得平衡;使用 `360p` 或 `540p` 可更快迭代。 2. **轉場**:使用清晰、光線充足的首幀和末幀,幫助模型可靠地插值動作。 3. **音訊**:需要同步環境音時設定 `sound`;靜音輸出則省略或設為 `false`。 4. **輪詢**:每 5–10 秒輪詢一次,直到 `task_status` 為 `succeed` 或 `failed`。