> ## 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 in ComfyUI: Text, Image, Reference, and Edit Workflows

> Generate and edit video with Kling 4.0 in ComfyUI: text to video, ten-keyframe animation, reference shots, and prompt-driven edits, each with stereo audio.

Kling 4.0 is Kling AI's video generation model, available in ComfyUI as Partner Nodes. One generation runs up to 30 seconds at 720p or 1080p, and produces stereo audio alongside the picture.

Four templates cover the workflows below. Each node also offers a faster `kling-4.0-flash` model option, limited to 720p and 20 seconds.

> [!TIP]
>
> To use the Partner Nodes, you need to ensure that you are logged in properly and using a permitted network environment. Please refer to the [Partner Nodes Overview](https://docs.comfy.org/tutorials/partner-nodes/overview.md) section of the documentation to understand the specific requirements for using the Partner Nodes.

> [!TIP]
>
> > [tab] Local users
> >
> > Make sure your ComfyUI is updated.
> >
> > * [Download ComfyUI](https://www.comfy.org/download)
> > * [Update Guide](https://docs.comfy.org/installation/update_comfyui.md)
> >
> > Workflows in this guide can be found in the [Workflow Templates](https://docs.comfy.org/interface/features/template.md).
> > If you can't find them in the template, your ComfyUI may be outdated.
> >
> > If nodes are missing when loading a workflow, possible reasons:
> >
> > 1. You are not using the latest ComfyUI version (Nightly version)
> > 2. Some nodes failed to import at startup
>
> > [tab] Cloud users
> >
> > * [Cloud](https://cloud.comfy.org) will update after ComfyUI stable release.
> >
> > So, if you find any core node missing in this document, it might be because the new core nodes have not yet been released in the latest stable version. Please wait for the next stable release.

## Kling 4.0: Text to Video

Generates a clip from a prompt alone. Describe the shots and their camera moves in order, because one run can hold several cuts.

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

> [card] [Run on Comfy Cloud](https://cloud.comfy.org/?template=api_kling4_t2v\&utm_source=docs\&utm_medium=referral\&utm_campaign=kling-4-0)
>
> Open in Comfy Cloud

> [card] [Download Workflow](https://github.com/Comfy-Org/workflow_templates/blob/main/templates/api_kling4_t2v.json)
>
> Download JSON or search "Kling 4.0: Text to Video" in Template Library

## Kling 4.0: Image to Video

Animates one still, or a sequence of keyframes: an optional first frame, up to eight middle frames, and an optional last frame, ten images in total. The clip takes the aspect ratio of the first keyframe. `kling-4.0-flash` animates a single first frame.

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

> [card] [Run on Comfy Cloud](https://cloud.comfy.org/?template=api_kling4_i2v\&utm_source=docs\&utm_medium=referral\&utm_campaign=kling-4-0)
>
> Open in Comfy Cloud

> [card] [Download Workflow](https://github.com/Comfy-Org/workflow_templates/blob/main/templates/api_kling4_i2v.json)
>
> Download JSON or search "Kling 4.0: Image to Video" in Template Library

**Input material**

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

## Kling 4.0: Reference to Video

Shoots a new clip from references instead of a single starting frame: up to ten reference images (the optional frames count toward that limit) and five reference clips, with an optional last frame on `kling-4.0`. Refer to them in the prompt as `@Image1` and `@Video1`, in connection order.

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

> [card] [Run on Comfy Cloud](https://cloud.comfy.org/?template=api_kling4_r2v\&utm_source=docs\&utm_medium=referral\&utm_campaign=kling-4-0)
>
> Open in Comfy Cloud

> [card] [Download Workflow](https://github.com/Comfy-Org/workflow_templates/blob/main/templates/api_kling4_r2v.json)
>
> Download JSON or search "Kling 4.0: Reference to Video" in Template Library

**Input materials**

> [card] [kling4\_r2v\_woman\_copper\_bob.png](https://raw.githubusercontent.com/Comfy-Org/workflow_templates/main/input/kling4_r2v_woman_copper_bob.png)
>
> Character reference, load into `reference_images`

> [card] [kling4\_r2v\_brutalist\_hall.png](https://raw.githubusercontent.com/Comfy-Org/workflow_templates/main/input/kling4_r2v_brutalist_hall.png)
>
> Location reference, load into `reference_images`

## Kling 4.0: Video Edit

Rewrites a clip you already have. The result keeps the length of `video_1`, and `audio` set to `original` keeps the source audio instead of generating new sound.

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

> [card] [Run on Comfy Cloud](https://cloud.comfy.org/?template=api_kling4_video_edit\&utm_source=docs\&utm_medium=referral\&utm_campaign=kling-4-0)
>
> Open in Comfy Cloud

> [card] [Download Workflow](https://github.com/Comfy-Org/workflow_templates/blob/main/templates/api_kling4_video_edit.json)
>
> Download JSON or search "Kling 4.0: Video Edit" in Template Library

**Input material**

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

## Input limits

* Images: at least 300 x 300 px, aspect ratio between 2:5 and 5:2, up to ten per run, keyframes included.
* Videos: each 3 to 30 seconds (3 to 20 with `kling-4.0-flash`), all connected clips 30 seconds in total, at least 24 fps, 700 to 4553 px per side, at most 8,294,400 px in total, aspect ratio between 2:5 and 5:2.
* In the image, reference, and edit nodes, a prompt that names `@ImageN` or `@VideoN` beyond the number of connected inputs fails the run.

Every parameter is listed on the node reference pages: [Text to Video](https://docs.comfy.org/built-in-nodes/Kling4TextToVideoNode.md), [Image to Video](https://docs.comfy.org/built-in-nodes/Kling4ImageToVideoNode.md), [Reference to Video](https://docs.comfy.org/built-in-nodes/Kling4ReferenceToVideoNode.md), [Edit Video](https://docs.comfy.org/built-in-nodes/Kling4EditVideoNode.md).


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