Load Video (Advanced)
The scissors ComfyUI's video loader forgot
- video
- info
ComfyUI grew a native VIDEO type and a core Load Video node, and for most people most of the time that's enough. What it won't do is take a 720p clip that's 40 seconds long and give you seconds 12 through 17. That's the entire reason this node exists, plus it takes whatever container ffmpeg can read instead of being picky about it.
Where it fits
The video stack now produces clips routinely - Wan, LTX, SVD, AnimateDiff chains - and the moment you have clips you have clip-shaped problems: too long for a re-render, wrong container for wherever it's going, wrong codec for the player someone will open it in. Loading and saving are two different jobs and this pack splits them cleanly. Load Video (Advanced) gets the file in as a VIDEO; Save Video (Format Converter) writes it back out as MP4 / MKV / WEBM / AVI / MOV. Wire them together and the middle is free. This node is the front half.
It's also the node you point at footage that didn't come from ComfyUI at all. Because the trim is built in, you can pull a nine-second window out of a downloaded video and feed it to an upscaler or an i2v pass without a detour through ffmpeg on the command line.
The mechanism, and why the trim is cheap here but not in the audio node
On load it opens the file with PyAV, reads the selected video stream, and records width, height, frame rate, codec, container duration and whether there's an audio track - that's what the node's report is made of. Then it constructs the VIDEO from the file with a start time and a duration attached.
Note the difference from this pack's audio loader: the trim is deferred. Nothing is decoded at load time. The VIDEO object just remembers "this window starts at 12s and runs 5s", and whatever consumes it later reads only that range. The audio node, by contrast, decodes the whole file up front and slices the tensor. So trimming video genuinely saves work downstream, while trimming audio only saves memory.
That laziness has a second consequence worth knowing: the node records on the VIDEO that it was truncated, and the save node checks for exactly that before deciding whether it can copy the file instead of re-encoding it. A truncated clip always gets transcoded. Trim-then-export is a real encode, not a cheat.
Inputs and outputs
Three fields you'll actually set. 视频文件 is the input directory listing (plus an upload button and a preview player that works before you run anything - drag a file onto the canvas to get it into input). 视频流序号 picks among multiple video streams, 0 first. 截断方式 offers no truncation, head segment (0s → 截取时长(秒)), middle range (起点(秒) → 终点(秒)), or start-to-end (起点(秒) only) - the three time fields default to 0 / 0 / 60 and the unused ones are ignored per mode. 报告语言 picks English, Chinese, or follow-the-UI.
The node raises early rather than producing garbage: an end time that isn't greater than the start, or a start past the total duration, both fail with a message naming your numbers.
Outputs: video (a VIDEO - into Save Video (Format Converter), Video Report, or any core video node that takes one) and info (a STRING of the same report, handy if you want the parameters logged somewhere).
Install
Manager → search comfyui_media_toolbox → Install → Restart. Or:
cd ComfyUI/custom_nodes
git clone https://github.com/jesse890423/comfyui_media_toolbox.git
Restart and it appears under Video. av, numpy and torch are already in ComfyUI; the pack's requirements.txt adds only imageio-ffmpeg, which carries a static ffmpeg binary. Loading needs none of that - PyAV does the probe. Saving and converting need the ffmpeg binary, so confirm it resolves:
python -c "import imageio_ffmpeg; print(imageio_ffmpeg.get_ffmpeg_exe())"
A full ffmpeg build matters more for video than audio: cut-down builds missing libx265, VP9 or AV1 will load and report fine, then fail at encode time with an unhelpful ffmpeg stderr dump.
Things that will bite
"This file has no video stream." You picked an audio file. The error even points you at Load Audio (Advanced), which is the right node for that job.
You asked for stream 2 of a single-stream file. Multi-stream files are uncommon, and when the index is out of range the node quietly falls back to stream 0. Check the report if the resolution looks wrong. And note that if you then transcode, the save node works from the first video stream of the source file - the stream picker's influence lives in the VIDEO object, not in the resulting ffmpeg command.
The dropdown is empty or stale. New files need the node's Refresh button; ComfyUI scans input once at startup. The listing does recurse into subfolders, so clips/take_03.mp4 is selectable as-is.
Paths are limited to ComfyUI's input and output directories, by design. Absolute paths and .. are rejected - the author is deliberately not shipping a "read anything on this machine" node, which is the correct call for anything that will eventually be handed a stranger's workflow.
Don't expect it to be a video editor. One window, start and duration, no frame-exact seek guarantee beyond what ffmpeg gives you. For precise frame in/out you're better off pre-cutting.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| 视频文件 | COMBO | Pick a video from the ComfyUI `input` directory, or use the upload button to bring in a file from anywhere on this machine. The video is previewed as soon as you pick it, without running the node. | |
| 视频流序号 | INT | 00–16 | Which video stream to use for files with multiple streams. 0 means the first one. |
| 截断方式 | COMBO | No truncation (use the whole file) | How to cut a long video: ① Head segment only: from 0 s, take Duration to take seconds ② Middle range only: from Start to End ③ From start to the end: use everything from Start to the end of the video For ① fill in Duration to take; for ② fill in Start and End; for ③ fill in Start only. |
| 起点(秒) | FLOAT | 0.000–1000000 | Where to start (seconds). Middle range: used together with End. From start to the end: the starting position; End is ignored. |
| 终点(秒) | FLOAT | 0.000–1000000 | Where to stop (seconds). Must be greater than Start. Only applies to the Middle range mode; ignored in other modes. |
| 截取时长(秒) | FLOAT | 60.000–1000000 | How much to take (seconds), measured from the beginning of the file, so the start is fixed at 0 s. Only applies to the Head segment mode; ignored in other modes. |
| 报告语言 | COMBO | Follow UI language | Language of this node's report text. "Follow UI language" produces a Chinese report while the ComfyUI interface is Chinese, and an English report otherwise. |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| video | VIDEO | — |
| info | STRING | — |