Nodes/ComfyUI-Kie-API/KIE Kling Elements Batch
ComfyUI Node

KIE Kling Elements Batch

Batch named Kling elements so @character actually works

By gateway·Created 9 months ago·Updated 4 months ago· 39
KIE Kling Elements Batch
  • element_1
  • element_2
  • element_3
  • element_4
  • element_5
  • element_6
  • element_7
  • element_8
  • element_9
  • elements
  • data

Kling 3.0 lets you define named elements - a character, an object, a face - and then reference them inside your prompt as @name. The single-element builder (KIE KlingElements) makes one of those references; this node collects up to nine of them into a single batch so the KIE Kling3_Video node can see them all at once.

Without this step, a multi-element prompt like "a woman with @dog and @old_woman" has nowhere to receive all three references - the video node's element input takes only one. Batch is the bridge.

How it works

It's a trivial but important plumbing node. Each element_1 through element_9 input is optional and accepts a KIE_ELEMENT payload from an upstream KIE KlingElements node. It merges whatever is connected into one KIE_ELEMENTS list, deduplicates any overlapping names, and passes it along. No media is uploaded here and nothing is generated - it's pure aggregation.

To build the elements themselves, remember the rule from the element node: each one takes either 2–4 images or a single video, never both, and it needs a name. Names are restricted to letters, numbers, _, and - - no spaces, so @old_woman is fine but @old woman will silently fail to match.

Inputs and outputs

  • element_1 … element_9 - all optional; connect as many as your prompt references.
  • elements (KIE_ELEMENTS) - the batched payload. Wire this into the elements input on KIE Kling3_Video (or KIE Kling3_Preflight).
  • data (STRING) - a JSON preview of the batch, handy for a quick sanity check or for logging.

Install

Standard pack install - ComfyUI Manager (search "ComfyUI-Kie-API") or:

cd ComfyUI/custom_nodes
git clone https://github.com/gateway/ComfyUI-Kie-API

Restart and drop your Kie.ai API key into config/kie_key.txt. No model files, no GPU.

Where it trips people up

  • Names must match your prompt exactly. The @ reference in shots_text or prompt has to equal the element's name string, character for character. A mismatch doesn't error loudly - you just get a video where the element is ignored.
  • Batch before the video node, not after. The order is Element → Batch → Video. The video node reads the whole batch at once.
  • data is a preview, not an input. It's informational; the actual payload that matters is the elements output.

If you're doing anything beyond a single named reference in Kling 3.0, this little node is the difference between a prompt that works and a prompt that quietly drops half your cast.

Categorykie/helpers

Inputs (9)

NameTypeDefaultDescription
element_1optKIE_ELEMENT
element_2optKIE_ELEMENT
element_3optKIE_ELEMENT
element_4optKIE_ELEMENT
element_5optKIE_ELEMENT
element_6optKIE_ELEMENT
element_7optKIE_ELEMENT
element_8optKIE_ELEMENT
element_9optKIE_ELEMENT

Outputs (2)

NameTypeDescription
elementsKIE_ELEMENTS
dataSTRING