CAIN VFI
Flow-free interpolation with channel attention
- frames
- optional_interpolation_states
- IMAGE
CAIN is one of the older, simpler interpolators in the ComfyUI Frame Interpolation pack - no optical flow, no fancy motion fields, just a compact network that leans on channel attention. It's not the one I'd reach for on complex, fast motion, but it's lightweight and it's a fine baseline to try when heavier models are overkill or giving you trouble.
Quick refresher: frame interpolation invents new frames between your existing ones so a choppy low-fps clip plays smooth. You generate video cheaply at a low frame count with AnimateDiff or Wan, then interpolate 2x or 4x to hit a watchable frame rate instead of diffusing every real frame. CAIN is one option for that last step.
How it works
CAIN comes from a 2020 paper whose title is a wink at the transformer world: "Channel Attention Is All You Need for Video Frame Interpolation." Instead of explicitly estimating where pixels move (optical flow) and warping along it, CAIN rearranges the frames with a PixelShuffle operation and lets a network with channel-attention blocks figure out the in-between directly. No flow estimate means no flow-estimation artifacts - and also means it doesn't reason about large displacements as sharply as flow-based models like FILM or AMT. On small, smooth motion it's clean and quick; on big jumps it tends to go soft rather than tear. You don't tune any of this; you just load the weights.
The inputs that matter
- frames (IMAGE) - your clip, at least 2 frames, from a VAE decode or a Load Images node.
- ckpt_name - one option,
pretrained_cain.pth, which downloads automatically on first run. - multiplier (INT, default 2) - output frames per gap. 2 doubles the count, 4 quadruples it. Because CAIN is a lighter model, it's cheap to run at 2x; just don't expect miracles pushing high multipliers over fast motion.
- clear_cache_after_n_frames (INT, default 10) - the OOM valve; lower it on long clips if memory gets tight.
An optional optional_interpolation_states input takes a Make Interpolation State List for skipping specific frame pairs across cuts. Usually left unwired.
Output is a single IMAGE batch - pipe it into a Video Combine node (VideoHelperSuite) to encode.
Installing it
It ships in the whole ComfyUI Frame Interpolation pack:
- ComfyUI Manager - search ComfyUI Frame Interpolation, install, restart.
- Manual -
cd ComfyUI/custom_nodes && git clone https://github.com/Fannovel16/ComfyUI-Frame-Interpolation, thenpython install.py(Linux, in your ComfyUI venv) orinstall.bat(Windows). Restart.
The pretrained_cain.pth checkpoint downloads on first use.
Common issues
The honest caveat with CAIN is quality on hard motion. If your source has large displacement between frames and CAIN gives you a soft, slightly mushy tween, that's the flow-free design showing its age - switch to FILM (built for large motion) or AMT and you'll usually get a crisper result, slower. For gentle motion it's perfectly fine and fast.
The pack-wide install stuff applies too: the cupy backend is the usual snag, so run install.bat on Windows instead of install.py. If interpolation runs on CPU with the GPU idle, the backend failed to initialize on the GPU - verify cupy matches your CUDA version. On non-NVIDIA hardware, the experimental taichi backend (pip install taichi, set ops_backend: taichi in config.yaml) is worth a shot, with the caveat that not every node supports it.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| ckpt_name | COMBO | 1 options: pretrained_cain.pth | |
| frames | IMAGE | — | |
| clear_cache_after_n_frames | INT | 101–1000 | — |
| multiplier | INT | 22–1000 | — |
| optional_interpolation_statesopt | INTERPOLATION_STATES | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |