Wan 2.7 - Reference to Video
This one takes URLs, not image sockets
- reference_image
- video
- url
- all_urls_json
- task_id
- raw_json
- credits_consumed
- credits_left
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 orreference_videomust 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 overridesaspect_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 yourreference_videoalready 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-1080pdefault,720pcheaper.aspect_ratio- 16:9, 9:16, 1:1, 4:3, 3:4, ignored whenfirst_frameis set.duration- 2 to 10 seconds, integer.prompt_extend- on by default.watermarkoff,seedpresent.
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.
Inputs (15)
| Name | Type | Default | Description |
|---|---|---|---|
| prompt | STRING | Image 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_promptopt | STRING | low resolution, errors, worst quality, low quality, malformed, extra fingers, bad proportions | Optional negative prompt describing what should not appear in the video. Supports Chinese and English. Maximum length: 500 characters. |
| reference_imageopt | IMAGE | — | |
| reference_videoopt | STRING | [ "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_frameopt | STRING | https://example.com/demo/first-frame.png | First 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_voiceopt | STRING | https://example.com/demo/reference-voice.mp3 | Audio 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` |
| resolutionopt | COMBO | 1080p | Output video resolution tier. Available values: `720p`, `1080p`. Default value: `1080p`. |
| aspect_ratioopt | COMBO | 16:9 | Output 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 |
| durationopt | INT | 52–10 | Output video duration in seconds. Valid range is an integer from `2` to `10`. Default value: `5`. |
| prompt_extendopt | BOOLEAN | true | Whether to enable prompt rewriting. When enabled, the model expands the input prompt. This usually works better for short prompts but increases processing time. |
| watermarkopt | BOOLEAN | false | Whether to add a watermark. The watermark is placed in the lower-right corner of the video with the fixed text "AI generated". |
| seedopt | INT | 00–2147483647 | Random seed. Range: `0-2147483647`. If omitted, the system generates one automatically. |
| nsfw_checkeropt | BOOLEAN | false | Defaults 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_secondsopt | INT | 120030–7200 | — |
| callback_urlopt | STRING | Optional KIE callback URL. Leave empty for normal ComfyUI use. |
Outputs (7)
| Name | Type | Description |
|---|---|---|
| video | VIDEO | — |
| url | STRING | — |
| all_urls_json | STRING | — |
| task_id | STRING | — |
| raw_json | STRING | — |
| credits_consumed | FLOAT | — |
| credits_left | FLOAT | — |