Nodes/Tween - Video Frame Interpolation/BIM-VFI Segment Interpolate
ComfyUI Node

BIM-VFI Segment Interpolate

RAM is the real bottleneck, not VRAM — the BIM-VFI node that admits it

By ethanfel·Created 7 months ago·Updated about a month ago· 17
BIM-VFI Segment Interpolate
  • images
  • model
  • settings
  • images
  • model
  • elapsed_seconds
multiplier2
clear_cache_after_n_frames10
keep_devicetrue
all_on_gpufalse
batch_size1
chunk_size0
source_fps0.00
target_fps0.00
segment_index0
segment_size500

Here's the thing nobody tells you about long video interpolation: VRAM gets all the attention, but for a 10-minute clip it's RAM that dies first. The plain BIM-VFI Interpolate node bounds VRAM via chunk_size, but the full interpolated output still has to live in memory somewhere. BIM-VFI Segment Interpolate is the version that admits it - it only produces one segment's worth of output frames at a time, so peak RAM stays proportional to your segment size instead of your whole video.

It's the same BIM-VFI interpolation under the hood: same model, same multiplier (2x/4x/8x, recursive passes), same batch_size, chunk_size, keep_device, all_on_gpu, clear_cache_after_n_frames, and the same source_fps/target_fps exact-FPS selection. The two new inputs are the point:

  • segment_index (0-based) - which slice of the input this node processes.
  • segment_size (default 500) - input frames per segment. Adjacent segments overlap by one frame so stitching is seamless.

How the pattern works. You lay down one Segment Interpolate per segment, each with segment_index = 0, 1, 2…, and chain them by wiring the previous node's model output into the next one's model input. That model pass-through is the trick: it forces sequential execution, so segment 0 finishes, you save its frames to disk with a Video Combine node, that save frees the RAM, and only then does segment 1 run. Peak RAM is bounded by one segment instead of the whole movie. It's fiddly - ComfyUI doesn't do loops here, so it's a chain of nodes, not a single config - but it's the difference between "this runs" and "my machine eats its own desktop."

When you're done, point Tween Concat Videos at the saved segment files to glue them back into one video, and keep the loader's frame rate, the node's source_fps/target_fps, and Video Combine's frame_rate synchronized or you'll get a stutter you can't explain.

Install. Search "Tween" in ComfyUI Manager, or:

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

Restart, then let the Load BIM-VFI Model node auto-download the checkpoint on first use. You'll also want VideoHelperSuite for the Load Video and Video Combine nodes that feed and drain this chain.

Common issues. If a segment reports no target timestamps when you're downsampling, your segment_size is too small to span one output-frame interval - bump it up. If you chain segments but skip saving between them, you've defeated the whole purpose; the RAM never gets freed. And remember the model pass-through chain is mandatory - two Segment nodes wired to the same source will run in parallel and blow your RAM budget anyway.

Categoryvideo/BIM-VFI

Inputs (13)

NameTypeDefaultDescription
imagesIMAGEInput image batch. Output frame count: 2x=(2N-1), 4x=(4N-3), 8x=(8N-7).
modelBIM_VFI_MODELBIM-VFI model from the Load BIM-VFI Model node.
multiplierCOMBO2Frame rate multiplier. 2x=one interpolation pass, 4x=two recursive passes, 8x=three. Higher = more frames but longer processing.
clear_cache_after_n_framesINT101–100Clear CUDA cache every N frame pairs to prevent VRAM buildup. Lower = less VRAM but slower.
keep_deviceBOOLEANtrueKeep model on GPU between frame pairs. Faster but uses ~200MB VRAM constantly. Disable to free VRAM between pairs (slower due to CPU-GPU transfers).
all_on_gpuBOOLEANfalseStore all intermediate frames on GPU instead of CPU. Much faster (no transfers) but requires enough VRAM for all frames. Recommended for 48GB+ cards.
batch_sizeINT11–64Number of frame pairs to process simultaneously. Higher = faster but uses more VRAM. Start with 1, increase until VRAM is full. Recommended: 1 for 8GB, 2-4 for 24GB, 4-16 for 48GB+.
chunk_sizeINT00–10000Process input frames in chunks of this size (0=disabled). Bounds VRAM usage during processing but the full output is still assembled in RAM. To bound RAM, use the Segment Interpolate node instead. Result is identical to processing all at once.
source_fpsFLOAT0.000–1000Input frame rate. Required when target_fps > 0.
target_fpsFLOAT0.000–1000Target output FPS. When > 0, overrides multiplier and auto-computes a power-of-2 oversample up to 8x, then selects frames. 0 = use multiplier.
segment_indexINT00–10000Which segment to process (0-based). Bounds RAM by only producing this segment's output frames, unlike chunk_size which bounds VRAM but still assembles the full output in RAM. Chain the model output to the next Segment Interpolate to force sequential execution.
segment_sizeINT5002–10000Number of input frames per segment. Adjacent segments overlap by 1 frame for seamless stitching. Smaller = less peak RAM per segment. Save each segment's output to disk before the next runs.
settingsoptVFI_SETTINGSAuto-tuned settings from VFI Optimizer. Overrides batch_size, chunk_size, keep_device, all_on_gpu, clear_cache_after_n_frames.

Outputs (3)

NameTypeDescription
imagesIMAGE
modelBIM_VFI_MODEL
elapsed_secondsFLOAT