Nodes/ComfyUI 1hewNodes/Load Video to Image
ComfyUI Node

Load Video to Image

Pull a video apart frame by frame, audio and all

By 1hew·Created about a year ago·Updated 7 days ago· 33
Load Video to Image
    • image
    • audio
    • fps
    • frame_count
    • filename
    file
    frame_limit0
    fps0
    start_skip0
    end_skip0
    format4n+1
    video_index0
    include_subdirfalse

    Video models don't eat videos - they eat batches of frames. Load Video to Image is the bridge: it decodes a video file into an IMAGE batch you can feed to an image model, plus the audio, the FPS, and a frame count, all in one go. If you're doing frame-extraction for image-to-video conditioning, keyframe work, or just mining reference footage, this is the node that does the unpacking.

    It's one of a pair: Load Video returns a VIDEO object for video-native chains, while this one gives you the raw frames (and the audio) as plain tensors - which is what you actually want when the next step is a batch processor, an upscaler, or a per-frame pass.

    How it decodes

    Under the hood it uses PyAV for the heavy lifting and falls back to ffmpeg/ffprobe for probing and audio when needed. It resolves ffmpeg from standard locations - the ComfyUI root, the bundled python_embeded folder on Windows installs, or your FFMPEG_PATH env var - then decodes frames, lifts the first audio stream (if any) into a {"waveform": ..., "sample_rate": ...} AUDIO dict, and applies your trimming settings in order: skip frames, resample FPS, constrain format, then cap the frame count. There's even a progress bar on long decodes.

    The inputs that matter:

    • file - a path or a folder. With a folder, video_index picks which file and include_subdir decides whether to dig into subdirectories.
    • start_skip / end_skip - cut N frames off the head and tail before anything else. Your "skip the 3-second title card" knobs.
    • fps - 0 keeps the source rate; anything else resamples. Note it resamples in time, not by dropping: it re-indexes frames to hit the target rate over the same duration.
    • frame_limit - 0 means all frames; otherwise the output is capped at this many.
    • format - n, 2n+1, 4n+1, 6n+1, 8n+1 (default 4n+1). This is the interesting one: it constrains the frame count to a pattern some video-model families want to see (the pack's own Wan-side tooling uses the 4n+1 convention). If you're feeding a specific model, match its documented format; if you're just extracting stills, n (no constraint) is fine.

    Outputs: image (the frame batch), audio, fps, frame_count, and filename (the stem, handy for naming what you save later).

    Installing it

    Via ComfyUI Manager, search "ComfyUI 1hewNodes", install, restart. Or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/1hew/ComfyUI-1hewNodes
    

    The catch with the video nodes specifically: decoding needs a working PyAV and a resolvable ffmpeg/ffprobe. ComfyUI's bundled environment usually has both; on a hand-rolled Python install, make sure pip install av succeeded and ffmpeg is on your PATH. The rest of the pack's heavy requirements (rembg, ultralytics, ...) aren't needed for this node but come along with the repo.

    Gotchas

    If you get an empty image output or a decode error, it's almost always the ffmpeg resolution, not the node logic - set FFMPEG_PATH explicitly and retry. And remember 4n+1 is on by default: if you expected "all frames" and got a strangely-even count, that's the format constraint doing its job. For plain still extraction, switch it to n and move on.

    Category1hewNodes/io

    Inputs (8)

    NameTypeDefaultDescription
    fileSTRING
    frame_limitINT00–100000
    fpsFLOAT00–120
    start_skipINT00–100000
    end_skipINT00–100000
    formatCOMBO4n+15 options: n, 2n+1, 4n+1, 6n+1, 8n+1
    video_indexINT0-8192–8192
    include_subdirBOOLEANfalse

    Outputs (5)

    NameTypeDescription
    imageIMAGE
    audioAUDIO
    fpsFLOAT
    frame_countINT
    filenameSTRING