Load & Trim Video
Cut a clip and feed it straight into video gen
- images
- video
- audio
- frame_count
- fps
- width
- height
Every image-to-video workflow starts the same way: a source clip you need at the right length, the right resolution, and sometimes at a fraction of the frame rate. Load & Trim Video does all of that in one node, with a live frame preview and a scrub timeline drawn right on it - drag the brackets, press play, and out comes the trimmed range as an IMAGE batch, a native VIDEO, the matching AUDIO, and a pile of metadata. No pre-cutting in DaVinci, no manual resize math.
It's part of Enigmatic Nodes, a small utility pack by the individual dev enigmatice. Like its sibling Load & Trim Audio, it's pure local Python plus a JS frontend - no models, no keys, no downloads.
How it works
The decode uses PyAV (the same library ComfyUI core uses), and it's smarter about it than most loader nodes: it seeks near the start time instead of decoding from frame zero, so a long source doesn't waste time chewing through the whole file just to get to your trim point. Frames are resized with LANCZOS so the longer edge matches your longest_side and the other edge is derived from the source's own aspect ratio - a 16:9 clip at 1280 becomes 720, a 1:1 clip at 720 stays 720. Everything is rounded to an even number, which keeps most downstream pipelines happy.
Two details are worth knowing before you touch the settings. select_every_nth doesn't just drop frames and leave you with a choppy, faster clip - it divides the output fps by the same factor, so a 30fps clip kept every 2nd frame comes out as 15fps and plays for the same real-time length. That's the behavior you actually want for thinning, and it's easy to miss. And the VIDEO output is a native ComfyUI VIDEO object, built through the newer comfy_api backend, so it plugs straight into nodes that expect VIDEO rather than making you manually convert frames.
The inputs that matter
- video - a file from ComfyUI's
inputfolder, with an Upload button or drag-and-drop onto the node. - start_time / end_time - trim bounds in seconds;
0end means "to the end". - longest_side (default
1280) - the size of the longer edge; the other is computed from the source aspect ratio.0keeps the original size. - select_every_nth (default
1) and frame_load_cap (default0) - thin the output and guard against loading a massive clip at full rate.
There's also extract_audio (default on), which trims the video's audio track to the same range - or returns silence if you turn it off to skip audio decoding.
The outputs
images (the frames as IMAGE), video (native VIDEO), audio (AUDIO), and frame_count, fps, width, height - the metadata that typically feeds the next node's settings or a filename.
Installing it
Same for the whole pack:
- ComfyUI Manager - search Enigmatic Nodes, install, restart.
- Manual -
cd ComfyUI/custom_nodes && git clone https://github.com/enigmatice/comfyui-enigmatic-nodes, then restart.
No models to download. The pack declares torch, numpy, scipy, Pillow, opencv-python; ComfyUI core already ships all but opencv-python, and Manager installs deps automatically. One real requirement: because the VIDEO output uses the newer comfy_api backend, you want a fairly recent ComfyUI - if you're months behind on updates, update before complaining the node fails.
Common issues
- "No frames decoded in the selected range" - your trim start/end lands outside the actual clip. Nudge the brackets back inside.
- The
VIDEOoutput errors on an old install - update ComfyUI; the node targets the modern backend. - Frame count surprises -
select_every_nthchanges the fps output, not just the count, so don't be confused whenfpsreads 15 on a 30fps source.
It's a young node from a pack with essentially zero community presence yet, so the debugging will be on you. The good news is it's one of those rare utility nodes that solves the whole "prepare a clip for video gen" step in a single drag - worth having even if it's the only node you use from the pack.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| video | COMBO | Pick a video from ComfyUI's input folder, or use the Upload button on the preview. | |
| start_time | FLOAT | 0.0000–86400 | Trim start in seconds. Drag the left bracket on the timeline. |
| end_time | FLOAT | 0.0000–86400 | Trim end in seconds. 0 (or past the clip length) means play to the end. Drag the right bracket on the timeline. |
| longest_side | INT | 12800–8192 | Target size of the LONGER edge. The other edge is computed from the video's own aspect ratio (16:9 @ 1280 -> 720, 1:1 @ 720 -> 720). Enter 0 to keep the original size. |
| select_every_nth | INT | 11–1000 | Keep only every Nth frame within the trim (1 = every frame). |
| frame_load_cap | INT | 00–100000 | Maximum number of frames to output (0 = no limit). Guards against loading a huge clip at full frame rate. |
| extract_audio | BOOLEAN | true | Also output the video's audio track, trimmed to the same range. Turn off to skip audio decoding (silence is returned). |
Outputs (7)
| Name | Type | Description |
|---|---|---|
| images | IMAGE | — |
| video | VIDEO | — |
| audio | AUDIO | — |
| frame_count | INT | — |
| fps | FLOAT | — |
| width | INT | — |
| height | INT | — |