> ## 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 Reference to Video - ComfyUI Built-in Node Documentation

> Generates a video from reference images and reference videos with the Kling 4.0 model, including audio.

Generates a video from reference images and reference videos with the Kling 4.0 model, including audio. The references drive the subject, style and motion, and an optional first and last frame pin the start and the end of the clip. Use it to keep a character or a scene consistent across a shot while describing the action in the prompt.

## Inputs

### Common Inputs

| Parameter | Description | Data Type | Required | Range |
| - | - | - | - | - |
| `model` | Model selector. Only `"kling-4.0"` is available; selecting it reveals the inputs below. | DYNAMIC\_COMBO | Yes | `"kling-4.0"` |

### kling-4.0 Inputs

These inputs appear when `model` is set to `"kling-4.0"`.

| Parameter | Description | Data Type | Required | Range |
| - | - | - | - | - |
| `reference_images` | Growable slots for reference images, up to 10. Refer to them in the prompt as `@Image1`, `@Image2` and so on, in connection order. | AUTOGROW | No | 0 to 10 images |
| `reference_videos` | Growable slots for reference videos, up to 5. Refer to them in the prompt as `@Video1`, `@Video2` and so on. Each video and all videos together must be 3 to 30 seconds long. | AUTOGROW | No | 0 to 5 videos |
| `first_frame` | Optional frame the video starts on. Counts toward the 10-image limit together with the reference images. | IMAGE | No | - |
| `last_frame` | Optional frame the video ends on. Counts toward the 10-image limit together with the reference images. | IMAGE | No | - |
| `prompt` | Description of the video to generate. Refer to the inputs as `@Image1`, `@Image2` and so on, and `@Video1`, `@Video2` and so on. | STRING | Yes | 1 to 26000 characters |
| `resolution` | Resolution of the output video. Default: `"720p"`. | COMBO | Yes | `"720p"` `"1080p"` |
| `aspect_ratio` | Aspect ratio of the output video. `"adaptive"` follows the prompt, then the first frame or the reference videos, and otherwise falls back to 16:9. Default: `"adaptive"`. | COMBO | Yes | `"adaptive"` `"16:9"` `"9:16"` `"1:1"` `"21:9"` |
| `duration` | Length of the generated video in seconds. Default: 5. | INT | Yes | 3 to 30 |
| `seed` | Seed controls whether the node should re-run; results are non-deterministic regardless of seed. Default: 42. | INT | Yes | 0 to 2147483647 |

**Constraints and behavior:**

* Images are limited to 10 in total, counting the reference images, the first frame and the last frame.
* Every image must be at least 300x300 pixels with an aspect ratio between 2:5 and 5:2.
* Every reference video must be 3 to 30 seconds long, at least 700x700 and at most 4553x4553 pixels, no more than 8,294,400 pixels in total, with an aspect ratio between 2:5 and 5:2 and a frame rate of at least 24 fps. All reference videos together must not exceed 30 seconds.
* A prompt that mentions `@ImageN` or `@VideoN` raises an error when fewer than N inputs of that kind are connected.
* When a first or a last frame is connected, the node adds an instruction that the video starts or ends exactly on that frame.

## Outputs

| Output Name | Description | Data Type |
| - | - | - |
| `video` | The generated video, downloaded from the provider once the task completes. | VIDEO |

> This documentation was AI-generated. If you find any errors or have suggestions for improvement, please feel free to contribute! [Edit on GitHub](https://github.com/Comfy-Org/embedded-docs/blob/main/comfyui_embedded_docs/docs/Kling4ReferenceToVideoNode/en.md)

***

**Source fingerprint (SHA-256):** `bda2298ed6ed06db04a8f342ec6ad0d5a0494e09bfadee72fce4420ebe4eaf6a`


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