I2V Encode with Middle Frame [darkilNodes]
Wan I2V encoding with a middle frame
- vae
- clip_embeds
- start_image
- middle_image
- end_image
- control_embeds
- temporal_mask
- extra_latents
- add_cond_latents
- empty_frame_pad_image
- image_embeds
Standard image-to-video for Wan gives you a first frame and hopes for the best. This node is the WanVideoWrapper ImageToVideo Encode clone that also lets you pin a frame in the middle - and optionally an end frame - so you can steer a video toward a specific composition instead of trusting the model to get there on its own. If you've ever generated a Wan clip that wanders off and never lands where you wanted, this is aimed squarely at you.
It lives in the darkilNodes wan category and, importantly, it is not a standalone loader. It consumes and produces WanVideoWrapper's types (WANVAE, WANVIDIMAGE_EMBEDS), so it only works if you already run ComfyUI-WanVideoWrapper by Kijai. The encode logic itself is adapted from WanVideoWrapper plus the Wan22FMLF and PainterI2VforKJ projects, all credited in the README.
What you feed it
start_image,middle_image,end_image(all IMAGE, all optional except the start) - the reference frames.width,height,num_frames- the output canvas. Defaults are 832×480×81, the usual Wan 2.2 sweet spot.middle_frame_ratio(FLOAT, 0.0–1.0, default 0.5) - where the middle frame lands. 0.0 = start, 1.0 = end. Note the position gets aligned down to a multiple of 4 frames internally, so don't expect a perfectly exact frame index.start_latent_strength,middle_latent_strength,end_latent_strength(FLOAT, default 1) - how hard each reference frame is held in latent space. Lower values let motion develop; the start/end tooltips say exactly this.noise_aug_strength- noise augmentation on the reference, which for I2V can mean sharper results with more motion.motion_amplitude(1.0–2.0) - scales the inter-frame latent differences from the first frame to counter that "slow motion" feel. 1.0 disables it.
There's a pile of advanced optional inputs too - control_embeds for Fun models, temporal_mask, extra_latents for Skyreels A2 references, tiled_vae to cut memory, and an experimental augment_empty_frames that nudges empty frames with the difference to the start image to force more motion. Don't touch those until the basic path works.
The output
One output: image_embeds (WANVIDIMAGE_EMBEDS), which wires into the WanVideoWrapper sampler nodes exactly like the stock encode node's output. The force_offload toggle (default on) unloads the VAE after encoding to keep VRAM under control - leave it on unless you're chasing every last millisecond.
Where people get burned
The biggest trap is treating this as a standalone video pipeline. It's an encode node; without WanVideoWrapper installed you won't even see its sockets. Second trap: feeding an end image with a strong end_latent_strength while num_frames is short can make the model fight itself - the middle and end anchors compete. Drop strengths below 1 when you have all three frames filled. And the fun_or_fl2v_model toggle exists because the Fun and official FLF2V models expect a slightly different conditioning path - flip it based on which model you're running, not by vibes.
Installing
Same pack as everything else: Manager search for ComfyUI-darkil-nodes, or
cd ComfyUI/custom_nodes
git clone https://github.com/pytraveler/comfyui-darkil-nodes
Then restart, and make sure ComfyUI-WanVideoWrapper is installed - it's the actual runtime dependency here. No Python deps ship with this pack itself.
Inputs (23)
| Name | Type | Default | Description |
|---|---|---|---|
| width | INT | 83264–8096 | Width of the image to encode |
| height | INT | 48064–8096 | Height of the image to encode |
| num_frames | INT | 811–10000 | Number of frames to encode |
| noise_aug_strength | FLOAT | 0.0000–10 | Strength of noise augmentation, helpful for I2V where some noise can add motion and give sharper results |
| start_latent_strength | FLOAT | 1.0000–10 | Additional latent multiplier for the start frame, helpful for I2V where lower values allow for more motion |
| end_latent_strength | FLOAT | 1.0000–10 | Additional latent multiplier for the end frame, helpful for I2V where lower values allow for more motion |
| middle_latent_strength | FLOAT | 1.0000–10 | Additional latent multiplier for the middle frame |
| middle_frame_ratio | FLOAT | 0.500–1 | Position of the middle frame as a ratio of total frames (0.0 = start, 1.0 = end) |
| force_offload | BOOLEAN | true | — |
| motion_amplitude | FLOAT | 1.001–2 | Motion amplitude multiplier, >1.0 enhances motion reducing slow motion, 1.0=disabled |
| vaeopt | WANVAE | — | |
| clip_embedsopt | WANVIDIMAGE_CLIPEMBEDS | Clip vision encoded image | |
| start_imageopt | IMAGE | Image to encode | |
| middle_imageopt | IMAGE | Middle frame image | |
| end_imageopt | IMAGE | End frame | |
| control_embedsopt | WANVIDIMAGE_EMBEDS | Control signal for the Fun -model | |
| fun_or_fl2v_modelopt | BOOLEAN | true | Enable when using official FLF2V or Fun model |
| temporal_maskopt | MASK | mask | |
| extra_latentsopt | LATENT | Extra latents to add to the input front, used for Skyreels A2 reference images | |
| tiled_vaeopt | BOOLEAN | false | Use tiled VAE encoding for reduced memory use |
| add_cond_latentsopt | ADD_COND_LATENTS | Additional cond latents WIP | |
| augment_empty_framesopt | FLOAT | 0.000–10 | EXPERIMENTAL: Augment empty frames with the difference to the start image to force more motion |
| empty_frame_pad_imageopt | IMAGE | Use this image to pad empty frames instead of gray, used with SVI-shot and SVI 2.0 LoRAs |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| image_embeds | WANVIDIMAGE_EMBEDS | — |