Kling O3 · Reference to Video
Seven photos, one shot, characters that stay put
- reference_image_urls
- reference_video_urls
- video
- task id
Why this node is the interesting one of the Kling four
Text-to-video makes a scene. Image-to-video animates a frame you already like. Reference-to-video does the thing people actually come to Kling for: takes a cast - a face, an outfit, a car, a location - from up to seven stills and puts them together in one new shot. That's the difference between generating a person and generating this person, in that jacket, on this street.
It's Kling 3.0 Omni on SpicyAPI's servers, so no weights, no VRAM, no 30 GB download. Just a key, an internet connection, and a per-second bill that starts at $0.0672.
How the referencing works
You connect stills to the reference_image_urls group - that's an Autogrow socket group, so you start with one socket and a new one appears each time you connect something, up to seven. Then you talk about them in the prompt by position: "Image 1", "Image 2", and so on. Order is meaning. If your prompt says Image 1 is the woman and Image 2 is the coat, swapping the wires inverts the whole shot. This is the single most common way a reference run comes out wrong.
There's a second, weirder mechanism: elements. It's a JSON string - a list of objects with description, image_urls, and name, each entry built from two to four images of the same character or object, plus optional reference_audio_urls and start_ms/end_ms timing. Once defined, you refer to one in the prompt as @name instead of by position, which is much easier to keep straight once you're juggling four subjects. The tooltip flags that elements are 4K only, so don't build a workflow around them and then drop to 720p to save money.
reference_video_urls is the optional trick: one clip whose motion, camera or characters the new shot should draw on, referred to as "Video 1". With a video attached you're capped at four reference images instead of seven, generate_audio isn't available, and the run is billed at a higher per-second rate. That's Kling's own pricing, not a limitation of the node.
Everything else on the node
- aspect_ratio and resolution - 16:9 and 720p by default; higher tiers cost more per second.
- duration_seconds (3–15) and shot_type - same trio as the other Kling O3 nodes:
singleis one continuous take,multilets the model cut your prompt into several shots on its own,customizemakes it follow multi_prompt, a JSON list where each entry carries its ownduration_secondsandpromptand the lengths must add up to your chosen duration. - generate_audio - off by default; it costs more per second. Not available with a reference video.
- keep_original_audio - on by default, and it only matters when you've attached a reference video: it keeps that clip's own sound in the result rather than replacing it.
Outputs are video and task id. video is a normal ComfyUI VIDEO - Save Video writes it. task id is a string you should keep if anything looks wrong, because it names the exact request in the console and for support.
Install
cd ComfyUI/custom_nodes
git clone https://github.com/spicyapi-ai/comfyui-spicyapi
Restart ComfyUI, then Settings > SpicyAPI → paste a key from spicyapi.ai/console/keys → restart once so the node list comes from your account. Or export SPICY_API_KEY on a server. Nothing pip-installs, no checkpoints to fetch; the pack has no dependencies beyond what ComfyUI already ships. ComfyUI Manager works too - search the pack title, SpicyAPI.
Things that will bite you
The Autogrow label isn't drawn on the node. Sockets are named reference_image_0, reference_image_1 and friends in the wiring, and ComfyUI just shows you a stack of image inputs. Count your connections rather than trusting a label when your prompt says "Image 3".
Invalid JSON fails the run. elements and multi_prompt are typed into a multiline widget, not uploaded as files. One trailing comma, one smart quote pasted from a doc, and you get a parse error instead of a video. Nothing is charged for a request that never got made, but you've lost the minute.
Seven references is a lot of bill. Each image goes through the same upload path as any other node - PNG, falling back to JPEG if it exceeds the 10 MiB ceiling - and this is a model priced per second of output. Budget both the duration and the resolution before you get ambitious; the node's badge shows the rate, and Max cost per run in the settings panel will refuse anything above your ceiling before it's charged.
Cancelling only stops the waiting. The task continues on SpicyAPI, is charged if it succeeds, and its result stays in your console for up to 14 days.
No seed. Reference-to-video doesn't take one, so a good result isn't reproducible and a re-run is a fresh purchase. Save what you like when you see it.
Inputs (12)
| Name | Type | Default | Description |
|---|---|---|---|
| prompt | STRING | Say who and what each reference is (Image 1, Image 2 and so on) and describe the shot they should produce. | |
| reference_image_urls | COMFY_AUTOGROW_V3 | Reference images for characters, objects, outfits or places, up to 7. Refer to them in the prompt as Image 1, Image 2 and so on. | |
| elements | STRING | Named subjects, each built from 2 to 4 images of the same character or object. Refer to one in the prompt as @name. 4K only. JSON. A list of objects with "description", "end_ms"?, "image_urls", "name", "reference_audio_urls"?, "start_ms"?. | |
| aspect_ratio | COMBO | 16:9 | Output aspect ratio. |
| resolution | COMBO | 720p | Output resolution. Higher tiers cost more per second. |
| generate_audio | BOOLEAN | false | Generate a native soundtrack (voices, effects, ambience) with the picture. Audio costs more per second. Not available with a reference video. |
| keep_original_audio | BOOLEAN | true | Keep the reference video's own sound in the result. Only matters when a reference video is given. |
| duration_seconds | INT | 53–15 | Output length in whole seconds, from 3 to 15. Billed per second. |
| shot_type | COMBO | single | single keeps one continuous shot; multi lets the model cut the prompt into several shots on its own; customize follows the shot list you give in multi_prompt. |
| multi_prompt | STRING | Shot list for shot_type customize: one entry per shot, in order, each with its own prompt and length in seconds. The lengths must add up to duration_seconds. JSON. A list of objects with "duration_seconds", "prompt". | |
| seed | INT | 00–2147483647 | This model takes no seed, so the number is never sent. Changing it makes ComfyUI run the node again: set 'control after generate' to randomize for a new result on every run; every run is billed. |
| reference_video_urlsopt | COMFY_AUTOGROW_V3 | Optional reference video (one clip) whose motion, camera or characters the new shot should draw on. Refer to it in the prompt as Video 1. With a video, use up to 4 reference images. A run with a reference video is billed at a higher per-second rate. |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| video | VIDEO | — |
| task id | STRING | The SpicyAPI task id, for the console logs or support. |