Nodes/ComfyUI_CGAnimittaTools/CGA_FrameExtraction🎞️
ComfyUI Node

CGA_FrameExtraction🎞️

Tell it your video's frame count and it hands you the keyframes to keep

By cganimitta·Created about a year ago·Updated about a year ago· 47
CGA_FrameExtraction🎞️
    • selected_frames
    total_frames81
    speed8

    If you've ever tried to skim a video in ComfyUI, you know the drill: you want every 8th frame for a quick preview pass or a keyframe extraction, and you end up doing the math by hand or dropping a calculator node in. CGA_FrameExtraction is that math, as a node. You tell it how many frames the video has and how far apart to sample, and it returns the comma-separated list of frame indices to feed into a video loader or sampler.

    It is emphatically a calculator, not a video tool. It never touches a video file. You supply total_frames and it does the rest, which makes it lightweight, deterministic, and easy to reason about.

    How the math actually works

    • total_frames (INT, default 81) - how many frames your video has.
    • speed (INT, default 8) - the sampling interval. Confusingly named; it's a step size, not a speed.

    The logic: start at frame speed - 1, step forward by speed, and stop once you'd exceed total_frames - 1. Everything is zero-indexed, and the output never includes the last frame number you don't have. For the defaults, 81 frames at interval 8 gives you frames 7, 15, 23, … 79 - the last one lands exactly at the maximum valid index.

    Output is selected_frames, a single STRING like "7,15,23,31,39,47,55,63,71,79" - comma-separated, ready to paste into any node that takes a frame list.

    Why it exists

    The README frames it as "extract partial frames proportionally," and that's the real use case: a video workflow where you want a representative subset of frames before deciding which to process fully, or keyframes for interpolation and animation work. Pair it with a video loader that accepts a frame-list input and you've got a quick "sample every Nth frame" pass without writing any math.

    Two gotchas

    First, the class name. This is the one node in the pack that carries a literal movie-camera emoji in its registered name - CGA_FrameExtraction🎞️ including a trailing space. Fine in the node menu, but if you ever reference it by class name in an API call or hand-edited workflow JSON, copy it character for character or it won't resolve.

    Second, the output is a string, not a list of integers. Whatever consumes it has to parse the commas. That's fine for the loaders that accept CSV-ish frame specs, but don't wire it straight into something expecting an INT list.

    Install

    Same pack, same story. ComfyUI Manager → search ComfyUI_CGAnimittaTools → install → restart. Or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/cganimitta/ComfyUI_CGAnimittaTools
    

    No models, no exotic dependencies (torch, numpy, pathlib - all already in ComfyUI). After restart it lives under CGAnimittaTools in the menu.

    CategoryCGAnimittaTools

    Inputs (2)

    NameTypeDefaultDescription
    total_framesINT81
    speedINT8

    Outputs (1)

    NameTypeDescription
    selected_framesSTRING