凤希AI - 视频加载
Load a video as frames without a Python video library in sight
- 视频帧序列(视频格式)
- 所有帧图片序列(图片格式)
- 当前视频路径
- 总帧数
- 帧率(FPS)
- 分辨率
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 aRuntimeError. The folder path is absolute - unlike the pack's other video nodes, this one doesn't resolve through thefxai/videobase, 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.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| 视频文件夹路径 | STRING | — | |
| 视频索引 | INT | 0 | — |
| 起始时间 | FLOAT | 0.00 | — |
| 结束时间 | FLOAT | 0.00 | — |
Outputs (6)
| Name | Type | Description |
|---|---|---|
| 视频帧序列(视频格式) | IMAGE | — |
| 所有帧图片序列(图片格式) | IMAGE | — |
| 当前视频路径 | STRING | — |
| 总帧数 | INT | — |
| 帧率(FPS) | INT | — |
| 分辨率 | STRING | — |