> ## Documentation Index
> Fetch the complete documentation index at: https://docs.comfy.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Kling 4.0：ComfyUI 文生视频、图生视频、参考生视频与视频编辑

> 在 ComfyUI 中使用 Kling 4.0 生成和编辑视频：文生视频、十张关键帧动画、参考素材生成与按提示词改写，均带立体声音频。

Kling 4.0 是 Kling AI 的视频生成模型，在 ComfyUI 中以合作伙伴节点提供。单次生成最长 30 秒，支持 720p 或 1080p，并在生成画面的同时生成立体声音频。

下面四个模板覆盖了这些工作流。每个节点还提供更快的 `kling-4.0-flash` 模型选项，限制为 720p 和 20 秒。

> [!TIP]
>
> 使用 API 节点需要保证你已经正常登录，并在受许可的网络环境下使用，请参考[API 节点总览](https://docs.comfy.org/zh/tutorials/partner-nodes/overview.md)部分文档来了解使用 API 节点的具体使用要求。

> [!TIP]
>
> > [tab] 本地用户
> >
> > 请确保你的 ComfyUI 已经更新。
> >
> > * [ComfyUI 下载](https://www.comfy.org/download)
> > * [ComfyUI 更新教程](https://docs.comfy.org/zh/installation/update_comfyui.md)
> >
> > 本指南里的工作流可以在[工作流模板](https://docs.comfy.org/zh/interface/features/template.md)中找到。如果找不到，可能是 ComfyUI 没有更新。
> >
> > 如果加载工作流时有节点缺失，可能原因有：
> >
> > 1. 你用的不是最新版（每夜版）。
> > 2. 启动时有些节点导入失败。
>
> > [tab] 云端用户
> >
> > * [Cloud](https://cloud.comfy.org) 会在 ComfyUI 稳定版本发布后更新。
> >
> > 所以，如果你发现本文档中有任何核心节点缺失，可能是因为新核心节点尚未在最新稳定版中发布。请等待下一个稳定版发布。

## Kling 4.0：文生视频

只凭提示词生成片段。按顺序写清每个镜头和对应的运镜，因为一次生成可以包含多次切换。

<video controls src="https://raw.githubusercontent.com/Comfy-Org/workflow_templates/main/output/api_kling4_t2v.mp4" />

> [card] [在 Comfy Cloud 上运行](https://cloud.comfy.org/?template=api_kling4_t2v\&utm_source=docs\&utm_medium=referral\&utm_campaign=kling-4-0)
>
> 在 Comfy Cloud 中打开

> [card] [下载工作流](https://github.com/Comfy-Org/workflow_templates/blob/main/templates/api_kling4_t2v.json)
>
> 下载 JSON，或在模板库中搜索 "Kling 4.0: Text to Video"

## Kling 4.0：图生视频

让一张静图动起来，或串联一组关键帧：可选首帧、最多八个中间帧和可选尾帧，合计十张图。片段的比例取自首帧。`kling-4.0-flash` 只支持单张首帧。

<video controls src="https://raw.githubusercontent.com/Comfy-Org/workflow_templates/main/output/api_kling4_i2v.mp4" />

> [card] [在 Comfy Cloud 上运行](https://cloud.comfy.org/?template=api_kling4_i2v\&utm_source=docs\&utm_medium=referral\&utm_campaign=kling-4-0)
>
> 在 Comfy Cloud 中打开

> [card] [下载工作流](https://github.com/Comfy-Org/workflow_templates/blob/main/templates/api_kling4_i2v.json)
>
> 下载 JSON，或在模板库中搜索 "Kling 4.0: Image to Video"

**输入素材**

> [card] [kling4\_editorial\_portrait.png](https://raw.githubusercontent.com/Comfy-Org/workflow_templates/main/input/kling4_editorial_portrait.png)
>
> 加载到 `first_frame`

## Kling 4.0：参考生视频

用参考素材而不是单张起始帧拍摄新片段：最多十张参考图（可选的首尾帧也计入这个上限）、五段参考视频，`kling-4.0` 还可以选填尾帧。在提示词中按连接顺序写作 `@Image1`、`@Video1`。

<video controls src="https://raw.githubusercontent.com/Comfy-Org/workflow_templates/main/output/api_kling4_r2v.mp4" />

> [card] [在 Comfy Cloud 上运行](https://cloud.comfy.org/?template=api_kling4_r2v\&utm_source=docs\&utm_medium=referral\&utm_campaign=kling-4-0)
>
> 在 Comfy Cloud 中打开

> [card] [下载工作流](https://github.com/Comfy-Org/workflow_templates/blob/main/templates/api_kling4_r2v.json)
>
> 下载 JSON，或在模板库中搜索 "Kling 4.0: Reference to Video"

**输入素材**

> [card] [kling4\_r2v\_woman\_copper\_bob.png](https://raw.githubusercontent.com/Comfy-Org/workflow_templates/main/input/kling4_r2v_woman_copper_bob.png)
>
> 人物参考，加载到 `reference_images`

> [card] [kling4\_r2v\_brutalist\_hall.png](https://raw.githubusercontent.com/Comfy-Org/workflow_templates/main/input/kling4_r2v_brutalist_hall.png)
>
> 场景参考，加载到 `reference_images`

## Kling 4.0：视频编辑

改写你已有的片段。输出保留 `video_1` 的时长；`audio` 设为 `original` 时沿用原片音频，否则重新生成声音。

<video controls src="https://raw.githubusercontent.com/Comfy-Org/workflow_templates/main/output/api_kling4_video_edit.mp4" />

> [card] [在 Comfy Cloud 上运行](https://cloud.comfy.org/?template=api_kling4_video_edit\&utm_source=docs\&utm_medium=referral\&utm_campaign=kling-4-0)
>
> 在 Comfy Cloud 中打开

> [card] [下载工作流](https://github.com/Comfy-Org/workflow_templates/blob/main/templates/api_kling4_video_edit.json)
>
> 下载 JSON，或在模板库中搜索 "Kling 4.0: Video Edit"

**输入素材**

> [card] [kling4\_gown\_input.mp4](https://raw.githubusercontent.com/Comfy-Org/workflow_templates/main/input/kling4_gown_input.mp4)
>
> 加载到 `video_1`

## 输入限制

* 图片：至少 300 x 300 像素，比例在 2:5 到 5:2 之间，每次最多十张，关键帧计入其中。
* 视频：每段 3 到 30 秒（`kling-4.0-flash` 为 3 到 20 秒），所有连接片段合计 30 秒，帧率至少 24 fps，单边 700 到 4553 像素，合计不超过 8,294,400 像素，比例在 2:5 到 5:2 之间。
* 在图生视频、参考生视频和编辑节点中，提示词里的 `@ImageN` 或 `@VideoN` 超出已连接输入数量时，运行会直接失败。

所有参数都列在节点参考页中：[文生视频](https://docs.comfy.org/zh/built-in-nodes/Kling4TextToVideoNode.md)、[图生视频](https://docs.comfy.org/zh/built-in-nodes/Kling4ImageToVideoNode.md)、[参考生视频](https://docs.comfy.org/zh/built-in-nodes/Kling4ReferenceToVideoNode.md)、[视频编辑](https://docs.comfy.org/zh/built-in-nodes/Kling4EditVideoNode.md)。


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.