EMA-VFI Segment Interpolate
The EMA-VFI segment node for interpolating long clips on a modest card
- images
- model
- settings
- images
- model
- elapsed_seconds
The plain EMA-VFI Interpolate node is already light on VRAM, but that doesn't save you when the input is a 20-minute video - the assembled output has to live somewhere, and that somewhere is your system RAM until it doesn't. EMA-VFI Segment Interpolate is the same interpolation split into chunks so peak memory stays bounded. If you're on a mid-range card doing long-form interpolation, this is the node that keeps the run alive.
It's structurally identical to the other pairwise Segment nodes in the pack. Same EMA-VFI internals, same multiplier, batch_size, chunk_size, keep_device, all_on_gpu, clear_cache_after_n_frames, and source_fps/target_fps - plus the two segment controls:
segment_index- which 0-based slice of the input this node processes.segment_size(default 500) - input frames per segment, with a one-frame overlap between adjacent segments for seamless stitching.
The pattern. Drop one node per segment (index 0, 1, 2…), each ending in a Video Combine save. Chain them by feeding the previous node's model output into the next node's model input - that pass-through forces them to run one at a time, and each segment's frames get written to disk and freed from RAM before the next starts. It's manual, but it converts "interpolate a whole movie" into "interpolate several 500-frame chunks," which is the only way some machines handle it. Finish with Tween Concat Videos to merge the segment_*.mp4 files back together.
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, let Load EMA-VFI Model pull the checkpoint, and have VideoHelperSuite on hand for the video load/save nodes.
Common issues. Keep the loader's frame rate, the node's source_fps/target_fps, and Video Combine's frame_rate in agreement, or you'll get timing drift between segments that shows up as a hiccup at every stitch. If you're downsampling and the node says a segment contains no target timestamps, segment_size is too small to span one output interval - raise it. And never let two segment nodes share the same source without chaining the model output; they'll run in parallel and quietly recreate the RAM problem you were trying to escape.
Inputs (13)
| Name | Type | Default | Description |
|---|---|---|---|
| images | IMAGE | Input image batch. Output frame count: 2x=(2N-1), 4x=(4N-3), 8x=(8N-7). | |
| model | EMA_VFI_MODEL | EMA-VFI model from the Load EMA-VFI Model node. | |
| multiplier | COMBO | 2 | Frame rate multiplier. 2x=one interpolation pass, 4x=two recursive passes, 8x=three. Higher = more frames but longer processing. |
| clear_cache_after_n_frames | INT | 101–100 | Clear CUDA cache every N frame pairs to prevent VRAM buildup. Lower = less VRAM but slower. |
| keep_device | BOOLEAN | true | Keep model on GPU between frame pairs. Faster but uses more VRAM constantly. Disable to free VRAM between pairs (slower due to CPU-GPU transfers). |
| all_on_gpu | BOOLEAN | false | Store all intermediate frames on GPU instead of CPU. Much faster (no transfers) but requires enough VRAM for all frames. Recommended for 48GB+ cards. |
| batch_size | INT | 11–64 | Number of frame pairs to process simultaneously. Higher = faster but uses more VRAM. Start with 1, increase until VRAM is full. |
| chunk_size | INT | 00–10000 | Process 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. |
| source_fps | FLOAT | 0.000–1000 | Input frame rate. Required when target_fps > 0. |
| target_fps | FLOAT | 0.000–1000 | Target output FPS. When > 0, overrides multiplier and auto-computes a power-of-2 oversample up to 8x, then selects frames. 0 = use multiplier. |
| segment_index | INT | 00–10000 | Which 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_size | INT | 5002–10000 | Number 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. |
| settingsopt | VFI_SETTINGS | Auto-tuned settings from VFI Optimizer. Overrides batch_size, chunk_size, keep_device, all_on_gpu, clear_cache_after_n_frames. |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| images | IMAGE | — |
| model | EMA_VFI_MODEL | — |
| elapsed_seconds | FLOAT | — |