Nodes/ComfyUI-AutoFlow/Video To Images
ComfyUI Node

Video To Images

Burst a video into ComfyUI frames — upload or path mode, start frame and all

By ZXL-Xinram·Created about a year ago·Updated 9 months ago· 4
Video To Images
    • images
    • total_frames
    • fps
    • video_info
    use_path_modefalse
    video_upload
    video_path
    start_frame0
    frame_count-1

    Any frame-by-frame workflow starts the same way: get the video's frames into ComfyUI as an IMAGE batch. AutoFlowVideoToImages (shown as "Video To Images") does that in one node - with an upload button, a loop preview in the node, and control over exactly which frames you pull. It's the entry point for img2img-style video work, frame-by-frame upscaling, or feeding frames into a video model.

    Underneath it's OpenCV (cv2.VideoCapture) doing the reading: it opens the file, grabs the source's total frame count, fps and dimensions up front, converts each frame BGR→RGB, normalizes to 0–1 floats, and stacks everything into a single IMAGE tensor. No ffmpeg, no separate pre-extraction step.

    Inputs:

    • use_path_mode (bool, default false) - false means upload mode: pick a video already sitting in ComfyUI's input folder (or use the node's browse/upload button and its built-in loop preview). true means path mode: type a full path like D:/videos/my_video.mp4 and it'll read a video from anywhere the machine can reach.
    • video_upload - the dropdown of videos found in ComfyUI's input directory (upload mode).
    • video_path - the full path string (path mode).
    • start_frame (int, default 0) - the zero-based frame to start reading at.
    • frame_count (int, default -1) - how many frames to pull; -1 means "the rest of the video."

    Outputs:

    • images - the IMAGE batch, ready to wire into whatever eats frames.
    • total_frames - INT, the number of frames actually read.
    • fps - INT, the source's frame rate.
    • video_info - a STRING summary like Video: clip.mp4 | 1280x720 | 30fps | 300 frames. Handy for a display node or logging.

    Where people get burned:

    • total_frames is frames read, not the source's total length. With start_frame=100 and frame_count=50, you get 50 back, not the video's length. The node clamps to the end of the file, so you can also request more than exists and get whatever's left.
    • fps is an int. A 29.97 fps clip reports 29. Fine for most purposes; don't use it to compute exact durations.
    • Audio doesn't exist here. Frames only. If you need sound re-muxed on the other end, keep the source file around.
    • Upload mode needs the file in ComfyUI's input folder (or use the node's upload button). Path mode happily reads anything the machine can reach, which is the flexible option for batch automation.
    • The pack imports OpenCV at load time. If opencv-python is missing from your Python env, every node in the pack fails to register, string and timestamp nodes included. A stock ComfyUI ships it, so this is more a "what to check if the pack won't load" note than a real risk.

    Once you have the frames, the downstream is wide open: process each one, run an interpolation or image-to-video pass, or pair it with the pack's own alpha/transparent-video tools for green-screen-style output.

    Install

    Part of the ComfyUI-AutoFlow pack. Use ComfyUI Manager (search ComfyUI-AutoFlow) or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/ZXL-Xinram/ComfyUI-AutoFlow
    

    Restart ComfyUI, then look under the AutoFlow category. No requirements.txt, no model downloads - the pack leans on torch, numpy, Pillow and opencv-python, all of which a stock ComfyUI installs. The frontend upload button and preview live in the pack's web/ directory and load automatically.

    CategoryAutoFlow/Video

    Inputs (5)

    NameTypeDefaultDescription
    use_path_modeBOOLEANfalse
    video_uploadCOMBO1 options:
    video_pathSTRING
    start_frameINT00–999999
    frame_countINT-1-1–999999

    Outputs (4)

    NameTypeDescription
    imagesIMAGE
    total_framesINT
    fpsINT
    video_infoSTRING