Nodes/KIE.ai Nodes Next/Wan 2.7 - Reference to Video
ComfyUI Node

Wan 2.7 - Reference to Video

This one takes URLs, not image sockets

By felipederosilva·Created about a month ago·Updated a day ago· 3
Wan 2.7 - Reference to Video
  • reference_image
  • video
  • url
  • all_urls_json
  • task_id
  • raw_json
  • credits_consumed
  • credits_left
◄promptImage 1 is eating, while video 1 and image 2 are singing beside it.►
◄negative_promptlow resolution, errors, worst quality, low quality, malformed, extra fingers, bad proportions►
◄reference_video[ "https://example.com/demo/ref-video-1.mp4" ]►
◄first_framehttps://example.com/demo/first-frame.png►
◄reference_voicehttps://example.com/demo/reference-voice.mp3►
◄resolution1080p►
◄aspect_ratio16:9►
◄duration5►
◄prompt_extendtrue►
◄watermarkfalse►
◄seed0►
◄nsfw_checkerfalse►
◄timeout_seconds1200►
◄callback_url►

Reference-to-video is the capability that finally made consistent characters feel solved-ish: instead of describing your subject, you show the model up to five images or clips of them and let it hold the identity while it builds a new scene. It's the same idea that made Bernini's multi-reference mode the open-weight story of 2026, and Wan 2.7 offers it through KIE.

One warning before you wire anything: on this node, references are STRING fields holding JSON URL arrays, not IMAGE sockets. That's not laziness - KIE's endpoint takes images and videos in the same reference list with a combined cap of five, and ComfyUI has no socket that means "three images and two clips". So you paste URLs, or you get URLs from the pack's upload utility nodes and feed those strings in.

How it works

prompt is required and does the heavy lifting: descriptions here index the references explicitly ("Image 1 is eating, while video 1 and image 2 are singing"), which is how multi-reference prompting works across every model that does it. The node posts to /api/v1/jobs/createTask with model wan/2-7-r2v, polls /api/v1/jobs/recordInfo until the task resolves, downloads the MP4 to ComfyUI/output/KIE-Results/videos, and returns a native VIDEO object.

Inputs that matter

  • reference_image - JSON array of image URLs. At least one of this or reference_video must be filled, and images plus videos together can't exceed five.
  • reference_video - JSON array of video URLs, same rule.
  • first_frame - optional single image URL that pins frame one and overrides aspect_ratio (the output then matches the first frame's ratio closely).
  • reference_voice - an audio URL (wav/mp3, 1-10 seconds) to set the timbre of the subject. If your reference_video already has audio, the original track is used unless you supply a voice here, in which case this wins.
  • prompt, negative_prompt - 5000 and 500 characters respectively. Both defaults read like real multi-reference instructions; that's a hint.
  • resolution - 1080p default, 720p cheaper. aspect_ratio - 16:9, 9:16, 1:1, 4:3, 3:4, ignored when first_frame is set.
  • duration - 2 to 10 seconds, integer.
  • prompt_extend - on by default. watermark off, seed present.

Outputs

video for saving or chaining. url, all_urls_json, task_id, raw_json, and credits_consumed / credits_left, plus the on-node receipt. Multi-reference jobs are the most expensive thing in this folder, so watch those two numbers.

Install

cd ComfyUI/custom_nodes
git clone https://github.com/felipederosilva/ComfyUI-KIE-Nodes-Next
cd ComfyUI-KIE-Nodes-Next && pip install -r requirements.txt

Restart, and find it in KIE Next / Video / Wan. No weights ship with the pack; the dependencies are requests, Pillow, numpy, PyYAML.

Key, once: Settings → KIE.ai Nodes Next → Connection → Paste / replace KIE.ai API key. It validates against KIE before replacing your saved key, then reports ✅ CONNECTED with a masked fingerprint - and the key never lands in the workflow file. KIE_API_KEY for headless installs. Credits are pre-paid, no subscription.

Common issues

"At least one reference required" or a rejection on count. You have to supply reference_image or reference_video, and the combined total is capped at five. Note the cap is images plus videos, so four images and two clips is six and fails.

You tried to drag an image socket into reference_image. Can't - it's a URL string. Either paste a public URL or use the pack's upload helpers under KIE Next / Utility to turn a local image into a URL first, then feed that string in.

JSON syntax errors. These fields are parsed as JSON arrays. One stray comma and the node tells you it isn't valid JSON.

Reference identity leaks into the result's framing. References are for identity and style; first_frame is what controls composition. Use both when you need both.

Nothing renders. Not an output node - add a save or preview, and update ComfyUI if you see a comfy_api.latest error.

CategoryKIE Next/Video/Wan

Inputs (15)

NameTypeDefaultDescription
promptSTRINGImage 1 is eating, while video 1 and image 2 are singing beside it.Text prompt. Required. Describes the desired elements and visual features in the generated video. Supports Chinese and English. Maximum length: 5000 characters.
negative_promptoptSTRINGlow resolution, errors, worst quality, low quality, malformed, extra fingers, bad proportionsOptional negative prompt describing what should not appear in the video. Supports Chinese and English. Maximum length: 500 characters.
reference_imageoptIMAGE—
reference_videooptSTRING[ "https://example.com/demo/ref-video-1.mp4" ]Array of reference video URLs. At least one of `reference_image` or `reference_video` must be provided. The total number of images and videos cannot exceed 5.
first_frameoptSTRINGhttps://example.com/demo/first-frame.pngFirst frame image URL. At most one image can be provided. If supplied, `aspect_ratio` is ignored and the output uses a ratio close to the first frame image.
reference_voiceoptSTRINGhttps://example.com/demo/reference-voice.mp3Audio URL used to specify the voice timbre of the subject in the reference material. Rules: - If `reference_video` contains audio and `reference_voice` is not provided, the original video audio is used by default - If both `reference_video` and `reference_voice` are provided, `reference_voice` takes priority Audio limits: - Formats: `wav`, `mp3` - Duration: `1` to `10` seconds - File size: up to `15MB`
resolutionoptCOMBO1080pOutput video resolution tier. Available values: `720p`, `1080p`. Default value: `1080p`.
aspect_ratiooptCOMBO16:9Output video aspect ratio. Effective logic: - If `first_frame` is not provided: the video is generated using the specified `aspect_ratio` - If `first_frame` is provided: `aspect_ratio` is ignored and the output uses a ratio close to the first frame image
durationoptINT52–10Output video duration in seconds. Valid range is an integer from `2` to `10`. Default value: `5`.
prompt_extendoptBOOLEANtrueWhether to enable prompt rewriting. When enabled, the model expands the input prompt. This usually works better for short prompts but increases processing time.
watermarkoptBOOLEANfalseWhether to add a watermark. The watermark is placed in the lower-right corner of the video with the fixed text "AI generated".
seedoptINT00–2147483647Random seed. Range: `0-2147483647`. If omitted, the system generates one automatically.
nsfw_checkeroptBOOLEANfalseDefaults to false. You can set it to false based on your needs. If set to false, our content filtering will be disabled, and all results will be returned directly by the model itself. Note: There is no guarantee that everything can be filtered out; if you are not satisfied with the results, you will need to make your own arrangements.
timeout_secondsoptINT120030–7200—
callback_urloptSTRINGOptional KIE callback URL. Leave empty for normal ComfyUI use.

Outputs (7)

NameTypeDescription
videoVIDEO—
urlSTRING—
all_urls_jsonSTRING—
task_idSTRING—
raw_jsonSTRING—
credits_consumedFLOAT—
credits_leftFLOAT—