ComfyUI Node

Load SGM-VFI Model

The SGM-VFI loader with the num_key_points dial that rescues fast chaotic footage

By ethanfel·Created 7 months ago·Updated about a month ago· 17
Load SGM-VFI Model
    • model
    model_pathours-1-2-points.pkl
    ttafalse
    num_key_points0.50

    Load SGM-VFI Model feeds the pack's "large motion" specialist. SGM-VFI (CVPR 2024) is the model you reach for when your footage is full of fast, chaotic movement that makes pairwise interpolators smear - the way the pack's TL;DR frames it: use SGM-VFI for difficult large motion. This loader is where the model's signature feature lives: sparse global matching, controlled by num_key_points.

    The mechanism behind SGM-VFI is what makes it different. Ordinary flow estimators only look at local neighborhoods, which breaks when a thing moves a lot between frames - there's no local evidence for where it went. SGM-VFI does global matching (built on GMFlow) to find where each region of the frame went, so big jumps stay coherent. Global matching everywhere is expensive, though, which is where num_key_points comes in:

    • num_key_points (default 0.5) - the sparsity dial. 0.0 means global matching everywhere: slowest, but best for extreme motion. Higher values sample fewer keypoints, which is faster but loses some large-motion robustness. The default 0.5 is the sane starting point; push it down only when footage genuinely defeats it.

    The other inputs are quieter:

    • model_path - the checkpoint, default ours-1-2-points.pkl (~15M params plus GMFlow), auto-downloaded from Google Drive to ComfyUI/models/sgm-vfi/.
    • tta - test-time augmentation (flip-and-average), ~2x slower for a small quality bump. Off by default.

    On the cupy question: the README says SGM-VFI "requires cupy," which overstates it. The actual source wraps cupy in a soft import - if it's absent or broken, the warp falls back to a pure-PyTorch path. SGM is the most flow-heavy model in the pack, so cupy genuinely helps it most, and the README's install table is the ground truth for versions (pip install cupy-cuda12x for CUDA 12, etc.). Install it if you can; don't let the word "requires" scare you off the node.

    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, and the checkpoint auto-downloads on first use. Output is a model wire into SGM-VFI Interpolate / Segment Interpolate.

    Gotchas. SGM-VFI is the pack's slowest pairwise option and heaviest at ~3GB per pair - don't make it your default "smooth a normal video" node, you're paying for motion robustness you don't need. If first run stalls, it's the Google Drive download. And if you're mixing cupy versions with other ComfyUI nodes, uninstall the old wheel first; a broken cupy falls back silently, so a "why is this suddenly slow" mystery can be a cupy mismatch that you'd never see as an error.

    Categoryvideo/SGM-VFI

    Inputs (3)

    NameTypeDefaultDescription
    model_pathCOMBOours-1-2-points.pklCheckpoint file from models/sgm-vfi/. Auto-downloads on first use if missing. Variant (base/small) is auto-detected from filename.
    ttaBOOLEANfalseTest-time augmentation: flip input and average with unflipped result. ~2x slower but slightly better quality.
    num_key_pointsFLOAT0.500–1Sparsity of global matching. 0.0 = global matching everywhere (slower, better for large motion). Higher = sparser keypoints (faster). Default 0.5 is a good balance.

    Outputs (1)

    NameTypeDescription
    modelSGM_VFI_MODEL