Nodes/ComfyUI-Infinite-Canvas/画布视频输入 🎬
ComfyUI Node

画布视频输入 🎬

Turn a video into a stack of frames without leaving the graph

By zml-w·Created 10 months ago·Updated 9 months ago· 6
画布视频输入 🎬
    • images
    • frame_count
    • fps
    video
    frame_limit0

    CanvasVideoInput is how video gets into this pack. You pick a file, it reads the frames, and out comes a batch of images plus the frame count and the fps - the three things a video-to-video workflow needs before a model like Wan 2.2 or LTX can do anything useful. The pack even ships a wan2.2 example workflow, and this is the node at its front door.

    How it works

    The video dropdown lists video files from ComfyUI's input folder, filtered to .mp4, .mov, .avi, .webm, .mkv, and .gif. Under the hood it uses OpenCV's VideoCapture to open the file, reads frames one at a time, converts each from BGR to RGB (OpenCV's default reading order is backwards from what ComfyUI expects), normalizes to 0–1 floats, and stacks the lot into one [F, H, W, 3] tensor.

    The other input, frame_limit, caps how many frames you pull - 0 means "all of them," up to a hard max of 10,000. Set it when you only want a slice of a long clip and don't want to feed the model an hour of footage.

    What comes out

    • images - the frame batch, ready for a video model or a VAE.
    • frame_count - how many frames you actually got. Check this; it's your early warning.
    • fps - read from the container, floored to an integer. Pass it to the pack's CanvasVideoOutput later so your output video keeps the timing.

    Where people get burned

    Codec roulette. VideoCapture can only decode what your OpenCV build bundles, and that's a shorter list than your browser supports. H.265/HEVC files, some ProRes, and oddball containers can open cleanly and then decode zero frames. The node doesn't throw - it hands you a black 512×512 frame with frame_count of 0. Silent failure is the worst kind, so the first thing you do with a new source is read frame_count. If it's 0, re-encode the clip:

    ffmpeg -i input.mp4 -c:v libx264 -pix_fmt yuv420p output.mp4
    

    VRAM math. Every frame is a full-resolution tensor in one batch. Ten seconds at 30 fps is 300 frames - fine for a model that iterates per frame, painful for anything that loads the whole batch at once. Keep frame_limit honest about how much you actually need.

    Fractional fps. A 23.976 fps file reports 23, not 24. It rarely matters for generation, but it's why a clip might come back a hair slow or fast after you re-encode.

    Install

    Standard for the pack:

    cd ComfyUI/custom_nodes
    git clone https://github.com/zml-w/ComfyUI-Infinite-Canvas
    

    Restart ComfyUI, or go through ComfyUI Manager (search "ComfyUI-Infinite-Canvas"). The requirements (opencv-python, imageio-ffmpeg) matter here - OpenCV is the video decoder, so a failed install means a node that never appears. And yes, the pack still wants --enable-cors-header in your ComfyUI startup args for the Infinite Canvas frontend. In the node list it's the 画布视频输入 🎬 node under the 无限画布 category.

    Category无限画布

    Inputs (2)

    NameTypeDefaultDescription
    videoCOMBO0 options:
    frame_limitINT00–10000

    Outputs (3)

    NameTypeDescription
    imagesIMAGE
    frame_countINT
    fpsINT