live
MODEL IDklingai:kling-video@4.0

Kling VIDEO 4.0

Kling AI
by

Kling VIDEO 4.0 is a unified video model that generates 1080p clips of up to 30 seconds from text, images, reference videos, and reusable elements. It follows up to 10 keyframes per clip, including first, middle, and last frames, and combines reference images, reference videos, and elements in a single request to hold subjects, style, and motion. It also edits an existing video from a prompt, which suits long narrative shots, storyboard-driven sequences, and reference-driven production work.

Kling VIDEO 4.0

Reference images

How to drive Kling VIDEO 4.0 with reference images: give each image a role, combine people with products and locations, keep a cast consistent, and follow a storyboard.

Introduction

Reference images tell Kling VIDEO 4.0 what the clip has to contain: a person, a product, a location, or a plan for the shots. You can pass up to ten, and the model builds a new clip around them. The prompt has to say what each image contributes. Otherwise the model infers it, and the result is harder to predict.

A fashion clip assembled from three references

<<<image_1>>> defines the model. Preserve her face, hairstyle, and build. <<<image_2>>> defines the jacket she wears. Preserve its material, color, and details exactly. <<<image_3>>> defines the location. Preserve its layout and view. She walks toward the camera across the rooftop, pauses, turns her shoulder to show the back of the jacket, and looks back at the lens. Handheld fashion film camera. Audio: footsteps, light wind, distant city sounds, no music, no subtitles.

Built from 3 references
  • Model
  • Jacket
  • Location

None of the references shows the woman wearing the jacket on the rooftop. Each image has one job in the prompt, and the clip combines them.

Request shape

References go in inputs.referenceImages, by URL or by the UUID of an earlier generation. In the prompt they are <<<image_1>>>, <<<image_2>>> and so on, in array order:

Try in Playground
import { createClient } from '@runware/sdk'

const client = await createClient({ apiKey: process.env.RUNWARE_API_KEY })
await client.connect()

const [result] = await client.run({
  model: 'klingai:kling-video@4.0',
  positivePrompt: '<<<image_1>>> defines the model. Preserve her face, hairstyle, and build. <<<image_2>>> defines the jacket she wears. Preserve its material, color, and details exactly. <<<image_3>>> defines the location. Preserve its layout and view. She walks toward the camera across the rooftop, pauses, turns her shoulder to show the back of the jacket, and looks back at the lens. Handheld fashion film camera. Audio: footsteps, light wind, distant city sounds, no music, no subtitles.',
  width: 1080,
  height: 1920,
  duration: 8,
  inputs: {
    referenceImages: [
      'https://im.runware.ai/image/os/a14d18/ws/2/ii/4e5f6a7b-8c9d-4e0f-9a1b-2c3d4e5f6a7b.jpg',
      'https://im.runware.ai/image/os/a14d18/ws/2/ii/5f6a7b8c-9d0e-4f1a-8b2c-3d4e5f6a7b8c.jpg',
      'https://im.runware.ai/image/os/a14d18/ws/2/ii/6a7b8c9d-0e1f-4a2b-9c3d-4e5f6a7b8c9d.jpg'
    ]
  }
})
import asyncio
import os

from runware import Runware


async def main():
    async with Runware(api_key=os.environ["RUNWARE_API_KEY"]) as client:
        results = await client.run({
            "model": "klingai:kling-video@4.0",
            "positivePrompt": "<<<image_1>>> defines the model. Preserve her face, hairstyle, and build. <<<image_2>>> defines the jacket she wears. Preserve its material, color, and details exactly. <<<image_3>>> defines the location. Preserve its layout and view. She walks toward the camera across the rooftop, pauses, turns her shoulder to show the back of the jacket, and looks back at the lens. Handheld fashion film camera. Audio: footsteps, light wind, distant city sounds, no music, no subtitles.",
            "width": 1080,
            "height": 1920,
            "duration": 8,
            "inputs": {
                "referenceImages": [
                    "https://im.runware.ai/image/os/a14d18/ws/2/ii/4e5f6a7b-8c9d-4e0f-9a1b-2c3d4e5f6a7b.jpg",
                    "https://im.runware.ai/image/os/a14d18/ws/2/ii/5f6a7b8c-9d0e-4f1a-8b2c-3d4e5f6a7b8c.jpg",
                    "https://im.runware.ai/image/os/a14d18/ws/2/ii/6a7b8c9d-0e1f-4a2b-9c3d-4e5f6a7b8c9d.jpg"
                ]
            }
        })


asyncio.run(main())
curl https://api.runware.ai/v1 \
  -H "Authorization: Bearer $RUNWARE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '[
    {
      "taskType": "videoInference",
      "taskUUID": "9b0c1d2e-3f4a-4b5c-8d6e-7f8a9b0c1d2e",
      "model": "klingai:kling-video@4.0",
      "positivePrompt": "<<<image_1>>> defines the model. Preserve her face, hairstyle, and build. <<<image_2>>> defines the jacket she wears. Preserve its material, color, and details exactly. <<<image_3>>> defines the location. Preserve its layout and view. She walks toward the camera across the rooftop, pauses, turns her shoulder to show the back of the jacket, and looks back at the lens. Handheld fashion film camera. Audio: footsteps, light wind, distant city sounds, no music, no subtitles.",
      "width": 1080,
      "height": 1920,
      "duration": 8,
      "inputs": {
        "referenceImages": [
          "https://im.runware.ai/image/os/a14d18/ws/2/ii/4e5f6a7b-8c9d-4e0f-9a1b-2c3d4e5f6a7b.jpg",
          "https://im.runware.ai/image/os/a14d18/ws/2/ii/5f6a7b8c-9d0e-4f1a-8b2c-3d4e5f6a7b8c.jpg",
          "https://im.runware.ai/image/os/a14d18/ws/2/ii/6a7b8c9d-0e1f-4a2b-9c3d-4e5f6a7b8c9d.jpg"
        ]
      }
    }
  ]'
runware run klingai:kling-video@4.0 \
  positivePrompt="<<<image_1>>> defines the model. Preserve her face, hairstyle, and build. <<<image_2>>> defines the jacket she wears. Preserve its material, color, and details exactly. <<<image_3>>> defines the location. Preserve its layout and view. She walks toward the camera across the rooftop, pauses, turns her shoulder to show the back of the jacket, and looks back at the lens. Handheld fashion film camera. Audio: footsteps, light wind, distant city sounds, no music, no subtitles." \
  width=1080 \
  height=1920 \
  duration=8 \
  inputs.referenceImages.0=https://im.runware.ai/image/os/a14d18/ws/2/ii/4e5f6a7b-8c9d-4e0f-9a1b-2c3d4e5f6a7b.jpg \
  inputs.referenceImages.1=https://im.runware.ai/image/os/a14d18/ws/2/ii/5f6a7b8c-9d0e-4f1a-8b2c-3d4e5f6a7b8c.jpg \
  inputs.referenceImages.2=https://im.runware.ai/image/os/a14d18/ws/2/ii/6a7b8c9d-0e1f-4a2b-9c3d-4e5f6a7b8c9d.jpg
{
  "taskType": "videoInference",
  "taskUUID": "9b0c1d2e-3f4a-4b5c-8d6e-7f8a9b0c1d2e",
  "model": "klingai:kling-video@4.0",
  "positivePrompt": "<<<image_1>>> defines the model. Preserve her face, hairstyle, and build. <<<image_2>>> defines the jacket she wears. Preserve its material, color, and details exactly. <<<image_3>>> defines the location. Preserve its layout and view. She walks toward the camera across the rooftop, pauses, turns her shoulder to show the back of the jacket, and looks back at the lens. Handheld fashion film camera. Audio: footsteps, light wind, distant city sounds, no music, no subtitles.",
  "width": 1080,
  "height": 1920,
  "duration": 8,
  "inputs": {
    "referenceImages": [
      "https://im.runware.ai/image/os/a14d18/ws/2/ii/4e5f6a7b-8c9d-4e0f-9a1b-2c3d4e5f6a7b.jpg",
      "https://im.runware.ai/image/os/a14d18/ws/2/ii/5f6a7b8c-9d0e-4f1a-8b2c-3d4e5f6a7b8c.jpg",
      "https://im.runware.ai/image/os/a14d18/ws/2/ii/6a7b8c9d-0e1f-4a2b-9c3d-4e5f6a7b8c9d.jpg"
    ]
  }
}
Response
[
  {
    "taskType": "videoInference",
    "taskUUID": "9b0c1d2e-3f4a-4b5c-8d6e-7f8a9b0c1d2e",
    "videoUUID": "7b8c9d0e-1f2a-4b3c-8d4e-5f6a7b8c9d0e",
    "videoURL": "https://vm.runware.ai/video/os/a14d18/ws/2/vi/7b8c9d0e-1f2a-4b3c-8d4e-5f6a7b8c9d0e.mp4"
  }
]

The output size is optional with references. Send width and height to pick the exact shape, as above, or leave them out and the aspect ratio adapts to the inputs, with resolution choosing 720p or 1080p.

If the request also carries keyframes, the numbering runs through the frame images first and the references after them. Frame images and references share a cap of ten between them.

Give every image a role

Without instructions, the model decides on its own what to take from each image. The pattern that holds up is one sentence per image: what it defines, and what to preserve from it. Name the parts to keep, like the shape or the colors, and leave how they look to the image:

<<<image_1>>> defines the product. Keep its shape, colors, and cap exactly., <<<image_2>>> defines the scene. Keep the vanity, the mirror, and the fixtures., A hand sets the perfume bottle on the vanity and lets go, and the camera pushes in slowly as the light moves across the glass., Audio: glass set down on stone, quiet bathroom ambience, no music, no subtitles.
Image 1 roleImage 2 roleActionAudio
The product placed into the scene

<<<image_1>>> defines the product. Keep its shape, colors, and cap exactly. <<<image_2>>> defines the scene. Keep the vanity, the mirror, and the fixtures. A hand sets the perfume bottle on the vanity and lets go, and the camera pushes in slowly as the light moves across the glass. Audio: glass set down on stone, quiet bathroom ambience, no music, no subtitles.

Built from 2 references
  • Product
  • Scene

Neither the bottle nor the vanity is described in the prompt. The square glass of the bottle and the brass fixtures of the vanity both come from the images.

Keeping a cast consistent

Portraits work as casting. Pass one image per person, refer to each by what distinguishes them on screen, and ask for their faces to stay strictly consistent:

Two references cast as podcast hosts

Reference the faces of the man in <<<image_1>>> and the woman in <<<image_2>>> and keep them strictly consistent. The two sit across a small table in a podcast studio with acoustic foam panels and two microphones on boom arms. The woman says in clear American English: "Okay, so what actually changed this year?" and the man laughs and leans toward his microphone. Two-camera podcast style, warm practical lighting. Audio: their voices close-miked, soft room tone, no music, no subtitles.

Built from 2 references
  • Host 1
  • Host 2

Both portraits are neutral and evenly lit, against a plain background that leaves nothing for the model to confuse with the scene you describe. For a person who has to appear in clip after clip, save them as an element instead.

Following a storyboard

A storyboard sheet works as a reference too, as a shot plan: the model reads the panels in order and turns each one into a shot. Say explicitly that the drawing itself should not appear:

Four sketched panels turned into four shots

Use <<<image_1>>> as the director-approved storyboard: the sequence of shots, the framing, and the action in each panel. Recreate each panel in order as a finished photoreal live-action shot, joined by hard cuts. Do not render the storyboard itself, the pencil lines, the grid, or the panel numbers. Keep the car free of logos and badges. Audio: natural sounds for each shot, no music, no subtitles.

Built from 1 reference
  • Storyboard

The prompt gives the sheet its role and leaves the content to the panels: what happens in each shot comes from the drawing. It also says "Do not render the storyboard itself" and names what to leave out: the pencil lines, the grid and the panel numbers.

Tips

  1. One sentence per image. Say what each reference defines and what to preserve from it.

  2. Use clean source images. A plain background and even light give the model one thing to take from each reference.

  3. Cast people with portraits. One image per person, described by what tells them apart on screen.

  4. Use a storyboard as a plan, not a style. Let the panels carry the content, and say not to render the drawing.

  5. Switch to elements for recurring characters. References hold a person for one clip, elements across many.