Nodes/ComfyUI-Fossiel-WAN-Additional-Tilers/Wan22 First Middle Last Frame (Tiled VAE Encode)
ComfyUI Node

Wan22 First Middle Last Frame (Tiled VAE Encode)

Start, middle, end frames — without the encoder eating your VRAM

By Fossiel·Created 9 months ago·Updated 9 months ago· 2
Wan22 First Middle Last Frame (Tiled VAE Encode)
  • positive
  • negative
  • vae
  • start_image
  • middle_image
  • end_image
  • clip_vision_start_image
  • clip_vision_middle_image
  • clip_vision_end_image
  • positive_high
  • positive_low
  • negative
  • latent
width832
height480
length81
batch_size1
tile_size512
overlap64
temporal_size64
temporal_overlap8
modeNORMAL
middle_frame_ratio0.50
high_noise_mid_strength0.80
low_noise_start_strength1.00
low_noise_mid_strength0.20
low_noise_end_strength1.00
structural_repulsion_boost1.00

Wan 2.2's first-middle-last-frame trick is the cheapest way to steer a video: give the model a start frame, a target middle frame, and an end frame, and it invents the journey between them. The stock node from ComfyUI-Wan22FMLF does this beautifully and then hammers your VRAM when it VAE-encodes the whole frame stack at once. This is that node with a tiled encode bolted on - same behavior, far lower peak memory.

Why it's the fiddly one

This node has the most knobs in the pack because Wan 2.2 is a two-expert MoE: a high-noise expert handles motion and composition, a low-noise expert handles detail. FMLF exploits that split by emitting two separate positive conditionings - positive_high and positive_low - each with its own noise-strength mask, so you can let the middle frame influence each pass differently. You wire them to two samplers, then merge the results.

It builds a gray-filled frame stack, stamps your start_image, middle_image, and end_image in, and generates masks that control how much noise is allowed around each anchored frame. middle_frame_ratio (0.5) picks where the middle image lands; high_noise_mid_strength (0.8) and the three low_noise_*_strength knobs (1.0 / 0.2 / 1.0) set how hard each image constrains its pass. structural_repulsion_boost (1.0–2.0) pushes the model to keep start/middle/end visually distinct - crank it if the shots blur together. mode toggles SINGLE_PERSON, which encodes a separate low-noise branch for person-centric shots.

And yes, this is the node where you can feel the tiling: every one of those encodes - the shared stack, and the separate low-noise stack in SINGLE_PERSON mode - runs through encode_tiled() with the same four knobs the rest of the pack uses (tile_size 512, overlap 64, temporal_size 64, temporal_overlap 8).

Inputs and outputs

Required: positive / negative conditioning, vae, width / height / length / batch_size, plus the tiling group. Optional: the three images, optional clip_vision_start_image / middle / end outputs from a CLIP Vision node (they get merged into one set), and all the strength floats above.

Outputs: positive_high, positive_low, negative (conditioning), and latent. The high/low positives go to your high-noise and low-noise KSamplers respectively; latent feeds whichever sampler runs first. If you've done any Wan 2.2 two-pass work this will feel familiar.

Installing it

ComfyUI Manager → search Fossiel or WAN-Additional-Tilers, or:

cd ComfyUI/custom_nodes
git clone https://github.com/Fossiel/ComfyUI-Fossiel-WAN-Additional-Tilers

Restart ComfyUI. No Python deps, no model downloads - bring your own Wan 2.2 checkpoint, CLIP, and VAE.

Gotchas

Because this node does several tiled encodes, it's a touch slower than the plain original - the price of fitting in VRAM, and worth it on low-memory cards. Keep ComfyUI updated, since the temporal tiling arguments need a reasonably recent build. If the middle image keeps getting ignored, check that middle_frame_ratio puts it somewhere sensible for your length, and remember the model only understands positions aligned to the 4-frame latent grid.

Categoryconditioning/video_models

Inputs (24)

NameTypeDefaultDescription
positiveCONDITIONING
negativeCONDITIONING
vaeVAE
widthINT83216–8192
heightINT48016–8192
lengthINT811–8192
batch_sizeINT11–4096
tile_sizeINT51264–4096
overlapINT640–4096
temporal_sizeINT648–4096Amount of frames to encode at a time.
temporal_overlapINT84–4096Amount of frames to overlap.
modeoptCOMBONORMAL2 options: NORMAL, SINGLE_PERSON
start_imageoptIMAGE
middle_imageoptIMAGE
end_imageoptIMAGE
middle_frame_ratiooptFLOAT0.500–1
high_noise_mid_strengthoptFLOAT0.800–1
low_noise_start_strengthoptFLOAT1.000–1
low_noise_mid_strengthoptFLOAT0.200–1
low_noise_end_strengthoptFLOAT1.000–1
structural_repulsion_boostoptFLOAT1.001–2
clip_vision_start_imageoptCLIP_VISION_OUTPUT
clip_vision_middle_imageoptCLIP_VISION_OUTPUT
clip_vision_end_imageoptCLIP_VISION_OUTPUT

Outputs (4)

NameTypeDescription
positive_highCONDITIONING
positive_lowCONDITIONING
negativeCONDITIONING
latentLATENT