# CF 超分

**这是什么**：CF 超分工作流：按所选比例超分输出 2K / 4K，画质更高。含 3 个取值——cf-multi-reference（多图参考）/ cf-mj（MJ 风格参考）/ cf-fl2v（首尾帧），入参分别与对应的标准工作流一致，只是清晰度档位换成 2K / 4K。

**什么时候用**：需要更高画质（2K / 4K）成片时用。⚠ CF 工作流只接受 resolution=2K/4K（传 480P/768P/1080P 返回 400），单价也高于标准档，见定价页。

## 接口地址
- POST `/v1/videos`
- GET `/v1/videos/{id}`
- GET `/v1/videos/{id}/content`

> 本页已按统一 API 改写：创建用 `POST /v1/videos`，轮询用 `GET /v1/videos/{id}`，认证用 `Authorization: Bearer <key>`，错误为 OpenAI 格式。

创建后立即返回视频对象（`status: queued`）。轮询 `GET /v1/videos/{id}`，直到 `status` 为 `completed` 或 `failed`；完成后 `url` 是成片地址，也可用 `GET /v1/videos/{id}/content` 下载。

## 请求参数
| 参数 | 类型 | 必填 | 说明 |
| --- | --- | --- | --- |
| model | string | — | 固定 minimax-h3 |
| workflow_id | string | 是 | 工作流，本页 3 选 1：cf-multi-reference / cf-mj / cf-fl2v。各取值用途见下方对照表；本页取值都无法由素材推断，必须显式传 |
| prompt | string | 是 | 必填，文本描述（新引擎任何情况下都要求 prompt——图生视频/首尾帧也必须给，如「镜头缓缓推进，光线柔和」） |
| image_urls | string[] | — | 参考图 URL，最多 9 张（别名 images）。仅 cf-multi-reference / cf-mj 可用且必填；cf-fl2v 不接受 |
| first_image | string | — | 首帧关键帧图 URL（别名 first_frame_image）。仅 cf-fl2v 可用且必填 |
| last_image | string | — | 尾帧关键帧图 URL（可选，别名 last_frame_image）。仅 cf-fl2v 可用，须与 first_image 一起传，只传尾帧返回 invalid_request |
| ratio | string | — | 画面比例，8 选 1：16:9 / 9:16 / 1:1 / 4:3 / 3:4 / 3:2 / 2:3 / 21:9，默认 16:9（比例 × 清晰度档位共同决定输出分辨率，见介绍页尺寸对照） |
| resolution | string | — | 清晰度档位（CF 超分工作流）：2K / 4K，默认 2K（不接受 480P/768P/1080P）；单价高于标准档，见定价页 |
| duration | integer | — | 时长（秒）整数 4~15，默认 4（别名 seconds）；cf-fl2v 最长 10 秒 |
| reference_videos | string[] | — | 参考视频 URL，最多 3 条，作为运动/风格参考（别名 reference_video 单条）。仅 cf-multi-reference / cf-mj 可用 |
| audio_urls | string[] | — | 音频 URL，最多 3 条，用于音频引导（别名 reference_audios）。仅 cf-multi-reference / cf-mj 可用 |
| prompt_enhance | boolean | — | 提示词增强（可选，布尔）；不传用默认（开启） |

`model`、`prompt`、`seconds`、`size`、`input_reference` 是统一接口的通用字段；其余字段是该模型渠道的专属字段，按原名放在同一个请求体里。`seconds` / `size`（必须是 `宽x高`）只有在没有传对应专属字段时才会被翻译。

## 请求示例
```bash
curl https://api.novapi.ai/v1/videos \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "minimax-h3",
  "workflow_id": "cf-multi-reference",
  "prompt": "gentle camera push-in, soft light",
  "image_urls": [
    "https://cdn.novapi.ai/your/frame.png"
  ],
  "ratio": "16:9",
  "resolution": "2K",
  "duration": 8
}'
```

```python
import os, requests

r = requests.post(
    "https://api.novapi.ai/v1/videos",
    headers={"Authorization": "Bearer " + os.environ["API_KEY"]},
    json={
        "model": "minimax-h3",
        "workflow_id": "cf-multi-reference",
        "prompt": "gentle camera push-in, soft light",
        "image_urls": [
            "https://cdn.novapi.ai/your/frame.png",
        ],
        "ratio": "16:9",
        "resolution": "2K",
        "duration": 8,
    },
)
print(r.json())  # poll GET /v1/videos/{id} until status is completed
```

```ts
const resp = await fetch("https://api.novapi.ai/v1/videos", {
  method: "POST",
  headers: {
    Authorization: "Bearer " + process.env.API_KEY,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "model": "minimax-h3",
    "workflow_id": "cf-multi-reference",
    "prompt": "gentle camera push-in, soft light",
    "image_urls": [
      "https://cdn.novapi.ai/your/frame.png"
    ],
    "ratio": "16:9",
    "resolution": "2K",
    "duration": 8
  }),
});
console.log(await resp.json()); // poll GET /v1/videos/{id} until status is completed
```

## 响应示例
```json
{
  "id": "video_<task-id>",
  "object": "video",
  "model": "minimax-h3",
  "status": "queued",
  "progress": 0,
  "created_at": <unix-seconds>,
  "completed_at": null,
  "expires_at": null,
  "error": null
}
```

```json
{
  "id": "video_<task-id>",
  "object": "video",
  "model": "minimax-h3",
  "status": "completed",
  "progress": 100,
  "created_at": <unix-seconds>,
  "completed_at": <unix-seconds>,
  "expires_at": null,
  "error": null,
  "url": "https://..."
}
```

```bash
curl https://api.novapi.ai/v1/videos/video_<task-id> \
  -H "Authorization: Bearer $API_KEY"

# completed: "status": "completed", "progress": 100, and a "url" field with the result
curl -L https://api.novapi.ai/v1/videos/video_<task-id>/content \
  -H "Authorization: Bearer $API_KEY" \
  --output result.mp4
```
