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