Wan22 First Middle Last Frame (Tiled VAE Encode)
Start, middle, end frames — without the encoder eating your VRAM
- 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
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.
Inputs (24)
| Name | Type | Default | Description |
|---|---|---|---|
| positive | CONDITIONING | — | |
| negative | CONDITIONING | — | |
| vae | VAE | — | |
| width | INT | 83216–8192 | — |
| height | INT | 48016–8192 | — |
| length | INT | 811–8192 | — |
| batch_size | INT | 11–4096 | — |
| tile_size | INT | 51264–4096 | — |
| overlap | INT | 640–4096 | — |
| temporal_size | INT | 648–4096 | Amount of frames to encode at a time. |
| temporal_overlap | INT | 84–4096 | Amount of frames to overlap. |
| modeopt | COMBO | NORMAL | 2 options: NORMAL, SINGLE_PERSON |
| start_imageopt | IMAGE | — | |
| middle_imageopt | IMAGE | — | |
| end_imageopt | IMAGE | — | |
| middle_frame_ratioopt | FLOAT | 0.500–1 | — |
| high_noise_mid_strengthopt | FLOAT | 0.800–1 | — |
| low_noise_start_strengthopt | FLOAT | 1.000–1 | — |
| low_noise_mid_strengthopt | FLOAT | 0.200–1 | — |
| low_noise_end_strengthopt | FLOAT | 1.000–1 | — |
| structural_repulsion_boostopt | FLOAT | 1.001–2 | — |
| clip_vision_start_imageopt | CLIP_VISION_OUTPUT | — | |
| clip_vision_middle_imageopt | CLIP_VISION_OUTPUT | — | |
| clip_vision_end_imageopt | CLIP_VISION_OUTPUT | — |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| positive_high | CONDITIONING | — |
| positive_low | CONDITIONING | — |
| negative | CONDITIONING | — |
| latent | LATENT | — |