live
MODEL IDklingai:kling-image@4.0

Kling IMAGE 4.0

Kling AI
by

Kling IMAGE 4.0 is an image model for text-to-image and reference-guided generation at native 2K, 4K, and 8K, with natural lighting and skin and material detail close to a camera photo. It renders up to 2,000 characters of legible text in seven languages, combines up to 10 reference images and elements, and plans series of up to 10 images that keep subjects and style consistent. It also designs e-commerce product pages and websites as a single tall image, which suits storyboards, slide decks, product shoots, and campaign visuals.

Kling IMAGE 4.0

Elements

How to save a product or a character in Kling IMAGE 4.0 as an element under your own id, build it from several angles, and reuse it by id across a whole campaign.

Introduction

An element is a product or a character that Kling IMAGE 4.0 saves for reuse under an id you choose. The first request builds it from a few photos taken from different angles. Every later request names the same id and gets the same product back without sending the photos again, which is what keeps a campaign's hero item identical from the first shot to the last.

Built from 3 references
  • Front
  • Side
  • Back

The three packshots became the element in the same request that rendered the hero. Worn on the hiker's back, the backpack keeps the curved front pocket and the charcoal side panels of the packshots.

Creating an element

Elements go in inputs.elements. An element needs an id, a short description, a frontalImage, and one to three more angles in images. In the prompt it is <<<element_1>>>, numbered in array order and separately from reference images:

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-image@4.0',
  positivePrompt: 'A campaign photo for an outdoor gear brand. A young man with a short beard in a navy rain shell wears <<<element_1>>> on both shoulders as he steps onto a rocky trail at a misty trailhead, a wooden trail sign and pine trees behind him. Soft overcast morning light. Three-quarter view from behind and to the side at shoulder height, 35mm lens, the backpack sharp and in the center of the frame. Photoreal outdoor photography, no text, no logos.',
  width: 2496,
  height: 1664,
  inputs: {
    elements: [
      {
        id: 'k4i-trail-pack',
        description: 'Rust orange 28-liter hiking backpack with charcoal side panels',
        frontalImage: 'https://assets.runware.ai/guides/klingai-image-4-0/elements/source-backpack.jpg',
        images: [
          'https://assets.runware.ai/guides/klingai-image-4-0/elements/source-backpack-side.jpg',
          'https://assets.runware.ai/guides/klingai-image-4-0/elements/source-backpack-back.jpg'
        ],
        tags: [
          'Item'
        ]
      }
    ]
  }
})
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-image@4.0",
            "positivePrompt": "A campaign photo for an outdoor gear brand. A young man with a short beard in a navy rain shell wears <<<element_1>>> on both shoulders as he steps onto a rocky trail at a misty trailhead, a wooden trail sign and pine trees behind him. Soft overcast morning light. Three-quarter view from behind and to the side at shoulder height, 35mm lens, the backpack sharp and in the center of the frame. Photoreal outdoor photography, no text, no logos.",
            "width": 2496,
            "height": 1664,
            "inputs": {
                "elements": [
                    {
                        "id": "k4i-trail-pack",
                        "description": "Rust orange 28-liter hiking backpack with charcoal side panels",
                        "frontalImage": "https://assets.runware.ai/guides/klingai-image-4-0/elements/source-backpack.jpg",
                        "images": [
                            "https://assets.runware.ai/guides/klingai-image-4-0/elements/source-backpack-side.jpg",
                            "https://assets.runware.ai/guides/klingai-image-4-0/elements/source-backpack-back.jpg"
                        ],
                        "tags": [
                            "Item"
                        ]
                    }
                ]
            }
        })


asyncio.run(main())
curl https://api.runware.ai/v1 \
  -H "Authorization: Bearer $RUNWARE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '[
    {
      "taskType": "imageInference",
      "taskUUID": "6a3d8f15-2c9e-4b74-8a61-0f5e2b7c9d38",
      "model": "klingai:kling-image@4.0",
      "positivePrompt": "A campaign photo for an outdoor gear brand. A young man with a short beard in a navy rain shell wears <<<element_1>>> on both shoulders as he steps onto a rocky trail at a misty trailhead, a wooden trail sign and pine trees behind him. Soft overcast morning light. Three-quarter view from behind and to the side at shoulder height, 35mm lens, the backpack sharp and in the center of the frame. Photoreal outdoor photography, no text, no logos.",
      "width": 2496,
      "height": 1664,
      "inputs": {
        "elements": [
          {
            "id": "k4i-trail-pack",
            "description": "Rust orange 28-liter hiking backpack with charcoal side panels",
            "frontalImage": "https://assets.runware.ai/guides/klingai-image-4-0/elements/source-backpack.jpg",
            "images": [
              "https://assets.runware.ai/guides/klingai-image-4-0/elements/source-backpack-side.jpg",
              "https://assets.runware.ai/guides/klingai-image-4-0/elements/source-backpack-back.jpg"
            ],
            "tags": [
              "Item"
            ]
          }
        ]
      }
    }
  ]'
runware run klingai:kling-image@4.0 \
  positivePrompt="A campaign photo for an outdoor gear brand. A young man with a short beard in a navy rain shell wears <<<element_1>>> on both shoulders as he steps onto a rocky trail at a misty trailhead, a wooden trail sign and pine trees behind him. Soft overcast morning light. Three-quarter view from behind and to the side at shoulder height, 35mm lens, the backpack sharp and in the center of the frame. Photoreal outdoor photography, no text, no logos." \
  width=2496 \
  height=1664 \
  inputs.elements.0.id=k4i-trail-pack \
  inputs.elements.0.description="Rust orange 28-liter hiking backpack with charcoal side panels" \
  inputs.elements.0.frontalImage=https://assets.runware.ai/guides/klingai-image-4-0/elements/source-backpack.jpg \
  inputs.elements.0.images.0=https://assets.runware.ai/guides/klingai-image-4-0/elements/source-backpack-side.jpg \
  inputs.elements.0.images.1=https://assets.runware.ai/guides/klingai-image-4-0/elements/source-backpack-back.jpg \
  inputs.elements.0.tags.0=Item
{
  "taskType": "imageInference",
  "taskUUID": "6a3d8f15-2c9e-4b74-8a61-0f5e2b7c9d38",
  "model": "klingai:kling-image@4.0",
  "positivePrompt": "A campaign photo for an outdoor gear brand. A young man with a short beard in a navy rain shell wears <<<element_1>>> on both shoulders as he steps onto a rocky trail at a misty trailhead, a wooden trail sign and pine trees behind him. Soft overcast morning light. Three-quarter view from behind and to the side at shoulder height, 35mm lens, the backpack sharp and in the center of the frame. Photoreal outdoor photography, no text, no logos.",
  "width": 2496,
  "height": 1664,
  "inputs": {
    "elements": [
      {
        "id": "k4i-trail-pack",
        "description": "Rust orange 28-liter hiking backpack with charcoal side panels",
        "frontalImage": "https://assets.runware.ai/guides/klingai-image-4-0/elements/source-backpack.jpg",
        "images": [
          "https://assets.runware.ai/guides/klingai-image-4-0/elements/source-backpack-side.jpg",
          "https://assets.runware.ai/guides/klingai-image-4-0/elements/source-backpack-back.jpg"
        ],
        "tags": [
          "Item"
        ]
      }
    ]
  }
}
Response
[
  {
    "taskType": "imageInference",
    "taskUUID": "6a3d8f15-2c9e-4b74-8a61-0f5e2b7c9d38",
    "imageUUID": "d4e9a2c7-5b18-4f63-9e07-2a8c6f3d1b95",
    "imageURL": "https://im.runware.ai/image/os/a14d18/ws/2/ii/d4e9a2c7-5b18-4f63-9e07-2a8c6f3d1b95.jpg"
  }
]

You pick the id: up to 20 letters, digits, hyphens or underscores. It is the only handle you keep, so choose one you will recognize in a later request. tags is optional and classifies the element, with values such as Item, Character, Costume or Scene.

Shoot the angles against one backdrop in one light. The three packshots share the gray backdrop and the studio light, so the only thing that changes between them is the view, and the model reads them as one object.

Reusing an element

To bring the backpack back, send its id without the photos. The model looks the element up and places the saved product in the new scene:

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-image@4.0',
  positivePrompt: 'A lifestyle photo for the same outdoor gear brand\'s city line. A woman in her twenties with a curly bob, in a beige trench coat and white sneakers, waits on a modern train platform with <<<element_1>>> on one shoulder, looking down the track. Bright morning light through the glass canopy, a train softly blurred arriving behind her. Full length, eye level, 50mm lens. Photoreal lifestyle photography, no text, no logos.',
  width: 1760,
  height: 2336,
  inputs: {
    elements: [
      {
        id: 'k4i-trail-pack'
      }
    ]
  }
})
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-image@4.0",
            "positivePrompt": "A lifestyle photo for the same outdoor gear brand's city line. A woman in her twenties with a curly bob, in a beige trench coat and white sneakers, waits on a modern train platform with <<<element_1>>> on one shoulder, looking down the track. Bright morning light through the glass canopy, a train softly blurred arriving behind her. Full length, eye level, 50mm lens. Photoreal lifestyle photography, no text, no logos.",
            "width": 1760,
            "height": 2336,
            "inputs": {
                "elements": [
                    {
                        "id": "k4i-trail-pack"
                    }
                ]
            }
        })


asyncio.run(main())
curl https://api.runware.ai/v1 \
  -H "Authorization: Bearer $RUNWARE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '[
    {
      "taskType": "imageInference",
      "taskUUID": "9b5e2a74-1d6c-4f38-b2a9-7e4c1f8d6a03",
      "model": "klingai:kling-image@4.0",
      "positivePrompt": "A lifestyle photo for the same outdoor gear brand's city line. A woman in her twenties with a curly bob, in a beige trench coat and white sneakers, waits on a modern train platform with <<<element_1>>> on one shoulder, looking down the track. Bright morning light through the glass canopy, a train softly blurred arriving behind her. Full length, eye level, 50mm lens. Photoreal lifestyle photography, no text, no logos.",
      "width": 1760,
      "height": 2336,
      "inputs": {
        "elements": [
          {
            "id": "k4i-trail-pack"
          }
        ]
      }
    }
  ]'
runware run klingai:kling-image@4.0 \
  positivePrompt="A lifestyle photo for the same outdoor gear brand's city line. A woman in her twenties with a curly bob, in a beige trench coat and white sneakers, waits on a modern train platform with <<<element_1>>> on one shoulder, looking down the track. Bright morning light through the glass canopy, a train softly blurred arriving behind her. Full length, eye level, 50mm lens. Photoreal lifestyle photography, no text, no logos." \
  width=1760 \
  height=2336 \
  inputs.elements.0.id=k4i-trail-pack
{
  "taskType": "imageInference",
  "taskUUID": "9b5e2a74-1d6c-4f38-b2a9-7e4c1f8d6a03",
  "model": "klingai:kling-image@4.0",
  "positivePrompt": "A lifestyle photo for the same outdoor gear brand's city line. A woman in her twenties with a curly bob, in a beige trench coat and white sneakers, waits on a modern train platform with <<<element_1>>> on one shoulder, looking down the track. Bright morning light through the glass canopy, a train softly blurred arriving behind her. Full length, eye level, 50mm lens. Photoreal lifestyle photography, no text, no logos.",
  "width": 1760,
  "height": 2336,
  "inputs": {
    "elements": [
      {
        "id": "k4i-trail-pack"
      }
    ]
  }
}
Response
[
  {
    "taskType": "imageInference",
    "taskUUID": "9b5e2a74-1d6c-4f38-b2a9-7e4c1f8d6a03",
    "imageUUID": "2f8c6e1a-9d43-4b07-a5e2-8c1f6d3a9b74",
    "imageURL": "https://im.runware.ai/image/os/a14d18/ws/2/ii/2f8c6e1a-9d43-4b07-a5e2-8c1f6d3a9b74.jpg"
  }
]

Describe the scene, not the element. Neither prompt mentions the backpack's color or pockets. They describe the place and what happens in it, and the element supplies the product.

An element belongs to the organization that created it. Its id only resolves in requests from that same organization, and an id that was never created there is rejected.

Several elements in one image

A request takes up to 10 elements and reference images combined. Each element gets its own number in the prompt, and reference images keep theirs. The request below reuses the backpack as <<<element_1>>>, creates a trail guide as <<<element_2>>> and takes the campsite from a reference image:

Built from 3 references
  • Guide, front
  • Guide, three-quarter
  • Campsite
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-image@4.0',
  positivePrompt: '<<<element_2>>> sets <<<element_1>>> down on the wooden bench at the campsite in <<<image_1>>> and looks out over the lake with a calm smile, one hand still on the backpack strap. Warm golden hour light from the left, a long shadow across the grass. Wide shot at standing height, 35mm lens, the guide and the backpack on the left third of the frame. Photoreal outdoor campaign photography, no text, no logos.',
  width: 2720,
  height: 1536,
  inputs: {
    elements: [
      {
        id: 'k4i-trail-pack'
      },
      {
        id: 'k4i-trail-guide',
        description: 'Trail guide with a long gray braid in a forest green fleece',
        frontalImage: 'https://assets.runware.ai/guides/klingai-image-4-0/elements/source-guide.jpg',
        images: [
          'https://assets.runware.ai/guides/klingai-image-4-0/elements/source-guide-side.jpg'
        ],
        tags: [
          'Character'
        ]
      }
    ],
    referenceImages: [
      'https://assets.runware.ai/guides/klingai-image-4-0/elements/source-camp.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-image@4.0",
            "positivePrompt": "<<<element_2>>> sets <<<element_1>>> down on the wooden bench at the campsite in <<<image_1>>> and looks out over the lake with a calm smile, one hand still on the backpack strap. Warm golden hour light from the left, a long shadow across the grass. Wide shot at standing height, 35mm lens, the guide and the backpack on the left third of the frame. Photoreal outdoor campaign photography, no text, no logos.",
            "width": 2720,
            "height": 1536,
            "inputs": {
                "elements": [
                    {
                        "id": "k4i-trail-pack"
                    },
                    {
                        "id": "k4i-trail-guide",
                        "description": "Trail guide with a long gray braid in a forest green fleece",
                        "frontalImage": "https://assets.runware.ai/guides/klingai-image-4-0/elements/source-guide.jpg",
                        "images": [
                            "https://assets.runware.ai/guides/klingai-image-4-0/elements/source-guide-side.jpg"
                        ],
                        "tags": [
                            "Character"
                        ]
                    }
                ],
                "referenceImages": [
                    "https://assets.runware.ai/guides/klingai-image-4-0/elements/source-camp.jpg"
                ]
            }
        })


asyncio.run(main())
curl https://api.runware.ai/v1 \
  -H "Authorization: Bearer $RUNWARE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '[
    {
      "taskType": "imageInference",
      "taskUUID": "3c7f1e92-6a4d-4b85-9c13-5e8a2d7f4b60",
      "model": "klingai:kling-image@4.0",
      "positivePrompt": "<<<element_2>>> sets <<<element_1>>> down on the wooden bench at the campsite in <<<image_1>>> and looks out over the lake with a calm smile, one hand still on the backpack strap. Warm golden hour light from the left, a long shadow across the grass. Wide shot at standing height, 35mm lens, the guide and the backpack on the left third of the frame. Photoreal outdoor campaign photography, no text, no logos.",
      "width": 2720,
      "height": 1536,
      "inputs": {
        "elements": [
          {
            "id": "k4i-trail-pack"
          },
          {
            "id": "k4i-trail-guide",
            "description": "Trail guide with a long gray braid in a forest green fleece",
            "frontalImage": "https://assets.runware.ai/guides/klingai-image-4-0/elements/source-guide.jpg",
            "images": [
              "https://assets.runware.ai/guides/klingai-image-4-0/elements/source-guide-side.jpg"
            ],
            "tags": [
              "Character"
            ]
          }
        ],
        "referenceImages": [
          "https://assets.runware.ai/guides/klingai-image-4-0/elements/source-camp.jpg"
        ]
      }
    }
  ]'
runware run klingai:kling-image@4.0 \
  positivePrompt="<<<element_2>>> sets <<<element_1>>> down on the wooden bench at the campsite in <<<image_1>>> and looks out over the lake with a calm smile, one hand still on the backpack strap. Warm golden hour light from the left, a long shadow across the grass. Wide shot at standing height, 35mm lens, the guide and the backpack on the left third of the frame. Photoreal outdoor campaign photography, no text, no logos." \
  width=2720 \
  height=1536 \
  inputs.elements.0.id=k4i-trail-pack \
  inputs.elements.1.id=k4i-trail-guide \
  inputs.elements.1.description="Trail guide with a long gray braid in a forest green fleece" \
  inputs.elements.1.frontalImage=https://assets.runware.ai/guides/klingai-image-4-0/elements/source-guide.jpg \
  inputs.elements.1.images.0=https://assets.runware.ai/guides/klingai-image-4-0/elements/source-guide-side.jpg \
  inputs.elements.1.tags.0=Character \
  inputs.referenceImages.0=https://assets.runware.ai/guides/klingai-image-4-0/elements/source-camp.jpg
{
  "taskType": "imageInference",
  "taskUUID": "3c7f1e92-6a4d-4b85-9c13-5e8a2d7f4b60",
  "model": "klingai:kling-image@4.0",
  "positivePrompt": "<<<element_2>>> sets <<<element_1>>> down on the wooden bench at the campsite in <<<image_1>>> and looks out over the lake with a calm smile, one hand still on the backpack strap. Warm golden hour light from the left, a long shadow across the grass. Wide shot at standing height, 35mm lens, the guide and the backpack on the left third of the frame. Photoreal outdoor campaign photography, no text, no logos.",
  "width": 2720,
  "height": 1536,
  "inputs": {
    "elements": [
      {
        "id": "k4i-trail-pack"
      },
      {
        "id": "k4i-trail-guide",
        "description": "Trail guide with a long gray braid in a forest green fleece",
        "frontalImage": "https://assets.runware.ai/guides/klingai-image-4-0/elements/source-guide.jpg",
        "images": [
          "https://assets.runware.ai/guides/klingai-image-4-0/elements/source-guide-side.jpg"
        ],
        "tags": [
          "Character"
        ]
      }
    ],
    "referenceImages": [
      "https://assets.runware.ai/guides/klingai-image-4-0/elements/source-camp.jpg"
    ]
  }
}
Response
[
  {
    "taskType": "imageInference",
    "taskUUID": "3c7f1e92-6a4d-4b85-9c13-5e8a2d7f4b60",
    "imageUUID": "8e1b4d6f-7c29-4a53-b8e0-6d2f9a4c1e87",
    "imageURL": "https://im.runware.ai/image/os/a14d18/ws/2/ii/8e1b4d6f-7c29-4a53-b8e0-6d2f9a4c1e87.jpg"
  }
]

A reused element and a new one can share a request. The backpack is sent by id alone and the guide with her photos, so this one request saves k4i-trail-guide for the next shot in the campaign as well. The campsite stays a plain reference: it is used once and needs no id.

Tips

  1. Create once, reuse by id. Later requests need only the id.

  2. Give an element several angles. A front view plus one to three more covers the views a scene asks for.

  3. Keep the backdrop and light constant across the angles. Only the view should change between them.

  4. Describe the scene, not the element. Its appearance comes from the saved photos.

  5. Save what recurs, reference what does not. A product or a person that appears across a campaign is an element, and a location used once is a reference image.

  6. Pick ids you will remember. The id is the only handle you keep, and it works only inside your organization.