ComfyUI Node

PainterFLF2V

Pin the first and last frame, let the middle move

By princepainter·Created 7 months ago·Updated 5 days ago· 194
PainterFLF2V
  • positive
  • negative
  • vae
  • clip_vision_start_image
  • clip_vision_end_image
  • start_image
  • end_image
  • positive
  • negative
  • latent
width832
height480
length81
batch_size1
motion_amplitude1.00

First-frame/last-frame (FLF) generation is the workhorse trick of local video: you hand the model a start frame and an end frame and it invents the motion between them. It's how people build loops, match cuts, and shots where the ending has to land somewhere specific. PainterFLF2V is a compact conditioning-and-latent builder for exactly that job - one node that takes your start/end images plus your prompt, and produces the positive/negative conditioning and latent you feed straight into a sampler.

What it is

A prep node in the conditioning/video_models category. It doesn't sample anything; it packages everything a video sampler needs for an FLF2V pass into three clean outputs: positive, negative, and latent. Drop it between your CLIP encode and your KSampler and the whole "build empty latent, anchor start frame, anchor end frame" dance collapses into one node.

How it works

The node takes your prompt conditioning (positive/negative), a vae, your target width/height/length, and - the important part - a start_image and end_image. It encodes those frames into the latent and positions them at the beginning and end of the timeline, then writes the motion setting into the conditioning. motion_amplitude (default 1.0, range 1–2, stepped 0.05) is the dial for how much the model is allowed to move between your anchors; crank it toward 2 and the middle gets adventurous, keep it near 1 and the shot stays conservative.

There's also a pair of optional clip_vision_start_image / clip_vision_end_image inputs - if your workflow is already running CLIP Vision on the anchors, feed the outputs here rather than re-passing raw images.

The inputs that matter

  • start_image / end_image - your two anchors. No anchors, no FLF; the node degrades to a plain empty-latent builder.
  • length - frame count, default 81 (the classic Wan-ish 4n+1 length), stepped by 4.
  • motion_amplitude - how much the model moves between the frames.
  • positive / negative - wire through from your text encoder as usual.

Outputs: positive and negative conditioning into the sampler's conditioning ports, latent into its latent port.

Install

It's one of ~forty nodes in the PainterNodes pack, so you're installing the pack. ComfyUI Manager: search "PainterNodes", install, restart. Or:

cd ComfyUI/custom_nodes
git clone https://github.com/princepainter/ComfyUI-PainterNodes
cd ComfyUI-PainterNodes
pip install -r requirements.txt

Dependencies are trivial (soundfile, numpy); the actual video model - typically Wan 2.2 or a Bernini-style build - is loaded separately.

Common issues

  • FLF not doing anything - if you see motion ignore your anchors, check that the images actually connect and that length is within the model's trained range. A too-long timeline lets the model drift back to its default motion habits.
  • Frames not matching the model's VAE - keep length on the step (4) so you land on valid frame counts; the node snaps sensibly, but wildly off values are the usual cause of "latent shape" errors.
  • Wired to a model that has no FLF support - Bernini famously has no first/last-frame conditioning. This node is for Wan-family and other FLF-capable models; if your output ignores the end frame, you're feeding the wrong backend.

The author's README is Chinese-first and updates fast, but the node itself is straightforward: pin the ends, set how wild the middle gets, sample. For anyone chaining loops or landing shots, it's the node that makes the two ends agree.

Categoryconditioning/video_models

Inputs (12)

NameTypeDefaultDescription
positiveCONDITIONING
negativeCONDITIONING
vaeVAE
widthINT83216–4096
heightINT48016–4096
lengthINT811–4096
batch_sizeINT11–4096
motion_amplitudeFLOAT1.001–2
clip_vision_start_imageoptCLIP_VISION_OUTPUT
clip_vision_end_imageoptCLIP_VISION_OUTPUT
start_imageoptIMAGE
end_imageoptIMAGE

Outputs (3)

NameTypeDescription
positiveCONDITIONING
negativeCONDITIONING
latentLATENT