Nodes/comfyui-darkil-nodes/I2V Encode with Middle Frame [darkilNodes]
ComfyUI Node

I2V Encode with Middle Frame [darkilNodes]

Wan I2V encoding with a middle frame

By pytraveler·Created 7 months ago·Updated 15 days ago· 9
I2V Encode with Middle Frame [darkilNodes]
  • vae
  • clip_embeds
  • start_image
  • middle_image
  • end_image
  • control_embeds
  • temporal_mask
  • extra_latents
  • add_cond_latents
  • empty_frame_pad_image
  • image_embeds
width832
height480
num_frames81
noise_aug_strength0.000
start_latent_strength1.000
end_latent_strength1.000
middle_latent_strength1.000
middle_frame_ratio0.50
force_offloadtrue
motion_amplitude1.00
fun_or_fl2v_modeltrue
tiled_vaefalse
augment_empty_frames0.00

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.

CategorydarkilNodes/wan

Inputs (23)

NameTypeDefaultDescription
widthINT83264–8096Width of the image to encode
heightINT48064–8096Height of the image to encode
num_framesINT811–10000Number of frames to encode
noise_aug_strengthFLOAT0.0000–10Strength of noise augmentation, helpful for I2V where some noise can add motion and give sharper results
start_latent_strengthFLOAT1.0000–10Additional latent multiplier for the start frame, helpful for I2V where lower values allow for more motion
end_latent_strengthFLOAT1.0000–10Additional latent multiplier for the end frame, helpful for I2V where lower values allow for more motion
middle_latent_strengthFLOAT1.0000–10Additional latent multiplier for the middle frame
middle_frame_ratioFLOAT0.500–1Position of the middle frame as a ratio of total frames (0.0 = start, 1.0 = end)
force_offloadBOOLEANtrue
motion_amplitudeFLOAT1.001–2Motion amplitude multiplier, >1.0 enhances motion reducing slow motion, 1.0=disabled
vaeoptWANVAE
clip_embedsoptWANVIDIMAGE_CLIPEMBEDSClip vision encoded image
start_imageoptIMAGEImage to encode
middle_imageoptIMAGEMiddle frame image
end_imageoptIMAGEEnd frame
control_embedsoptWANVIDIMAGE_EMBEDSControl signal for the Fun -model
fun_or_fl2v_modeloptBOOLEANtrueEnable when using official FLF2V or Fun model
temporal_maskoptMASKmask
extra_latentsoptLATENTExtra latents to add to the input front, used for Skyreels A2 reference images
tiled_vaeoptBOOLEANfalseUse tiled VAE encoding for reduced memory use
add_cond_latentsoptADD_COND_LATENTSAdditional cond latents WIP
augment_empty_framesoptFLOAT0.000–10EXPERIMENTAL: Augment empty frames with the difference to the start image to force more motion
empty_frame_pad_imageoptIMAGEUse this image to pad empty frames instead of gray, used with SVI-shot and SVI 2.0 LoRAs

Outputs (1)

NameTypeDescription
image_embedsWANVIDIMAGE_EMBEDS