KIE Kling Elements
KIE Kling Elements
- images
- video
- element
- data
Here's the idea behind Kling Elements: instead of hoping the model figures out which part of your prompt is the character, you name it. This helper node takes 2–4 images (or one video) and wraps them into a single named element - say "maya" - that a Kling 3.0 prompt can then reference as @maya. It's a character-reference system for the closed API world, and it's the building block the pack's whole Kling 3.0 story is assembled from.
Unlike every other node in this pack, this one makes no API call. It's a pure local payload builder: you feed it media, it produces a structured KIE_ELEMENT object you wire into the pack's Kling Elements Batch node and eventually into Kling 3.0 (Video). Zero credits spent until you actually generate.
How it works
The node packages whatever you give it - an image batch (2–4 images) or a single video, never both - plus a name and an optional description into an element payload. It validates the one-media-type rule for you (connect images and video and it errors) and hands you the payload plus a pretty-printed JSON preview so you can inspect exactly what Kling will receive.
The inputs that matter
- name - required, default
element_name. This is the handle your prompt uses. Pick something short and unambiguous:@maya, not@the_main_character_with_the_red_jacket. - images - an
IMAGEbatch of 2–4 images for the element. Use it for character or object references. - video - one
VIDEO, if your element is motion-based instead of image-based. - description - optional text describing the element, which Kling uses to understand what it's looking at.
Outputs:
- element - the
KIE_ELEMENTpayload. This is the wire you care about; it feeds Kling Elements Batch. - data - the same payload as JSON text, for eyeballing.
Installing
Installs with the pack. ComfyUI Manager: search "ComfyUI Kie API". Or:
cd ComfyUI/custom_nodes
git clone https://github.com/gateway/ComfyUI-Kie-API
# restart ComfyUI
No model downloads. Because this node never calls the API, you technically don't even need the key for it - but the Kling 3.0 node you're building toward absolutely does, so set up config/kie_key.txt (copy from kie_key.example.txt) anyway.
Where people get burned
The one-media rule trips people up first - it looks like you could attach both images and video, and the node will refuse. Decide which element type you're building before you wire it. Second, names matter more than they seem: Kling references elements by exact name in the prompt, so a typo in name means @maya silently references nothing. And remember this node is half of a chain - the pack's recommended reading order is Elements → Elements Batch → Kling 3.0 Preflight → Kling 3.0 Video, and Kling 3.0 itself is explicitly experimental/not production-ready. Build the payloads, preflight them, and only then spend the credits.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| name | STRING | element_name | — |
| descriptionopt | STRING | — | |
| imagesopt | IMAGE | — | |
| videoopt | VIDEO | — | |
| logopt | BOOLEAN | true | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| element | KIE_ELEMENT | — |
| data | STRING | — |