Nodes/FxAi(凤希全能节点)/凤希AI - 视频加载
ComfyUI Node

凤希AI - 视频加载

Load a video as frames without a Python video library in sight

By fxai666·Created 6 months ago·Updated about 15 hours ago· 44
凤希AI - 视频加载
    • 视频帧序列(视频格式)
    • 所有帧图片序列(图片格式)
    • 当前视频路径
    • 总帧数
    • 帧率(FPS)
    • 分辨率
    • 音频
    ◄视频文件夹路径►
    ◄视频索引-1►
    ◄起始时间0.00►
    ◄结束时间0.00►

    FxAiVideoLoad ("凤希AI - 视频加载") loads a video from a folder and hands you its frames as tensors plus a pile of useful metadata. What's interesting isn't what it does - every video pack has a loader - but how it does it: no PyAV, no OpenCV, no moviepy. It shells out to ffprobe for metadata and ffmpeg for raw-frame decoding. The only real dependency is that you have ffmpeg on your PATH.

    What you get

    Point it at a folder path and a video index (the videos are sorted by filename, so 0 is the first), and the outputs are:

    • 视频帧序列(视频格式) - IMAGE, the decoded frames as a single video-format tensor. Feed this straight into the pack's V3/V4 generators or a video-aware sampler.
    • 所有帧图片序列(图片格式) - IMAGE, the same frames in image-format. In practice both outputs are currently the same tensor (don't read anything into the naming), but the split exists so the pack can diverge them later.
    • 当前视频路径 - STRING, the full path, handy for preview or merge steps.
    • 总帧数 - INT.
    • 帧率(FPS) - INT (rounded).
    • 分辨率 - STRING like "1920x1080".

    Two time inputs make it a slicer too: 起始时间 and 结束时间 (both FLOAT, seconds). Set 结束时间 to 0 (the default) and it decodes to the end of the file. Set a range and you get just that window - useful for grabbing a few seconds to use as a continuity reference instead of loading a whole 10-minute file into RAM.

    How it works

    ffprobe reads the video stream's frame rate, dimensions, and duration; then ffmpeg decodes raw rgb24 frames piped to stdout, which the node reads frame-by-frame and converts to ComfyUI tensors. That means decoding is CPU-side and raw - a big 1080p file will chew through RAM while it loads, so the time-slice inputs aren't just a nicety, they're a memory valve.

    The gotchas

    • ffmpeg must be installed and findable. No ffmpeg, no frames - the node raises a clean "FFprobe 无法读取视频" error, so at least it's loud about it. On Windows, make sure ffmpeg is on PATH rather than just sitting in a folder somewhere.
    • The folder must contain supported extensions (.mp4 .avi .mov .mkv .flv .wmv .mpeg .mpg .webm) and the 视频索引 must be in range, or you get a RuntimeError. The folder path is absolute - unlike the pack's other video nodes, this one doesn't resolve through the fxai/video base, so paste the full path or wire it from FxAiVideoManager's 文件夹路径 output.

    Install

    Part of fxai-toolkit:

    cd ComfyUI/custom_nodes
    git clone https://github.com/fxai666/fxai-toolkit
    

    Restart ComfyUI, or use ComfyUI Manager and search "fxai-toolkit". No Python video deps to fight - just system ffmpeg, which the rest of the pack's video/audio nodes need anyway.

    Category凤希AI/视频

    Inputs (4)

    NameTypeDefaultDescription
    视频文件夹路径STRING两种填法都行: ① 填一个**目录** → 按 视频索引 挑这个目录里排序后的第几个视频; ② 直接填一个**视频文件的完整路径**(如 I:/ComfyUI/input/xxx.mp4) → 只读这一个文件,视频索引 自动失效。 填文件时不怕目录里增删文件、也不怕改名排序变化,最稳。
    视频索引INT-1**-1(默认)= 按上面填的实际路径读**,索引不参与; 填的是视频文件时,永远是读这个文件; 填的是目录时,-1 就等于取第一个(索引 0)。 0 及以上 = 按目录里文件名排序后的第几个视频挑(从 0 开始)。
    起始时间FLOAT0.00从第几秒开始读,0 = 从头。
    结束时间FLOAT0.00读到第几秒(不是读多久),0 = 读到结尾。 例:10 ~ 20 = 只读第 10 到 20 秒那一段。

    Outputs (7)

    NameTypeDescription
    视频帧序列(视频格式)IMAGE—
    所有帧图片序列(图片格式)IMAGE—
    当前视频路径STRING—
    总帧数INT—
    帧率(FPS)FLOAT—
    分辨率STRING—
    音频AUDIO—