Nodes/ComfyUI-AjoNodes/VFI Frame Skip Calculator (AJO)
ComfyUI Node

VFI Frame Skip Calculator (AJO)

Turn 16fps into exactly 25fps without doing interpolation math by hand

By AJO-reading·Created about a year ago·Updated about a year ago· 11
VFI Frame Skip Calculator (AJO)
    • skip_list_string
    • rife_multiplier
    source_fps16
    target_fps25
    total_input_frames160

    Frame interpolation is the classic companion to video upscaling and frame-rate fixes - 2x RIFE on top of a restored clip is a standard move. But RIFE does multiples of the source rate. Interpolate 16fps 2x and you get 32fps, not the 25fps a PAL-adjacent deliverable needs. Nobody wants to hand-figure which of those 32 frames to keep. That's the whole job of AJO_VfiSkipListCalculator: give it source fps, target fps, and frame count, and it tells you which interpolated frames to skip so you land on the target rate.

    How it works

    Pure math, no torch, no model - this node is a calculator. It walks through the arithmetic:

    1. If target_fps <= source_fps, no interpolation is needed at all: it returns an empty skip list and multiplier 1.
    2. It only handles up to 2x. If your target is more than double the source, it prints a warning that a single 2x pass can't reach it and returns multiplier 2 anyway - you'd need a 4x-capable chain.
    3. Otherwise it figures the 2x totals: input_frames * 2 frames in, input_frames interpolations available. Desired output is ceil(input_frames * target/source), so the frames to drop are the difference.
    4. It spaces those skipped indices as evenly as it can and returns them as a comma-separated string.

    Inputs and outputs

    • source_fps (INT, default 16) - your clip's actual frame rate.
    • target_fps (INT, default 25) - where you want to end up.
    • total_input_frames (INT, default 160) - length of the source clip in frames.

    Outputs: skip_list_string (STRING) - the comma-separated indices to skip, and rife_multiplier (INT) - the base multiplier for your VFI node, which will be 2 when you're interpolating.

    Wiring it in

    Feed skip_list_string into the skip_list input of a RIFE-style VFI node (the RIFE VFI node in ComfyUI-Frame-Interpolation takes exactly this - a comma-separated list of frame indices to skip), and rife_multiplier into that node's multiplier input. Out the other side goes to Video Combine / Save Video as usual. The defaults (16 → 25) are clearly aimed at the common anime/motion-clip case, and they're sane if that's your source.

    Where it's honest about its limits

    Two things to know. First, the "evenly spaced" skip list is an approximation - cadence won't be perfectly uniform, just close enough that you won't see it without a frame counter. Second, the 2x cap is real: if your target is more than double the source, this node will warn and hand you a 2 that doesn't actually get you there. Don't expect it to rescue a 12fps source to 30fps in one hop; you'll be chaining interpolations yourself. And it's worth eyeballing the actual fps of your input rather than trusting a container's metadata - garbage in, garbage out, and this node is very literal about the numbers you give it.

    For its lane, though, it's a genuinely handy bit of workflow math - the kind of node that saves you the scratch-pad sketch every time you do a rate conversion.

    Install

    Part of ComfyUI-AjoNodes, a two-node pack with no extra dependencies (no requirements.txt - it only needs stdlib math, plus comfy_extras/comfy_execution that ship with ComfyUI). Install via ComfyUI Manager (search "ComfyUI-AjoNodes"), or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/AJO-reading/ComfyUI-AjoNodes.git
    

    Restart ComfyUI and the node shows up under AJO-Nodes/VFI.

    CategoryAJO-Nodes/VFI

    Inputs (3)

    NameTypeDefaultDescription
    source_fpsINT161–240
    target_fpsINT251–240
    total_input_framesINT1601–99999

    Outputs (2)

    NameTypeDescription
    skip_list_stringSTRING
    rife_multiplierINT