# 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`。