Lay clips end to end (Snap Book)
Laying H3 clips end to end without leaving the graph
- clips
- VIDEO
MiniMax H3 gives you 4 to 15 seconds at a time. That's the whole model. So the second you want anything longer than one take, you're editing - and you've got six files in output/, each its own little universe, needing to line up as one thing.
The usual answer is an ffmpeg one-liner in a terminal, or a combine node from another pack that welds together whatever it's handed and hopes the sizes match. MAISnapCut is the film-shaped version: one socket per clip, a plan saying how each is trimmed and how loud it is, and everything conformed before it's joined.
(The display name says "Snap Book" and it sits in the pack's Snap category, but you don't need Snap turned on. Snap is off by default; the nodes work either way.)
What's actually going on under it
It doesn't decode video in Python. It writes a temp file per clip, runs ffprobe on it to learn its duration and whether it has an audio stream, builds one big ffmpeg filter graph, and calls ffmpeg once.
Every clip gets the same treatment: resampled to your fps, then scale=W:H:force_original_aspect_ratio=decrease and padded to centre. That means nothing gets cropped - a clip of the wrong shape comes out letterboxed or pillarboxed rather than losing the edges.
Audio is where hand-rolled concat jobs quietly fall apart, and this is the part I'd trust. Each clip's sound is trimmed to the same in/out as its picture, resampled to 48 kHz stereo, run through volume=<gain_db>dB, then padded or trimmed to exactly the clip's duration so the join never drifts. A silent clip gets generated silence rather than shifting everything after it - H3 renders at 32 kHz, which is why that resample exists at all.
Then concat=v=1:a=1, out through libx264 at CRF 18, AAC 192k, faststart, handed back to you as a VIDEO. Note that it always re-encodes - you're not remuxing. CRF 18 is visually fine for a deliverable, but don't chain five of these and expect the grain to survive.
The inputs you actually set
clips is an autogrow socket: drop a Video in, another slot appears on the node, up to 100. Order is the socket order, and that order is the whole story.
plan is a JSON array, one entry per connected clip, in the same order:
[
{"name": "shot01", "in_s": 0.6, "out_s": 3.9, "gain_db": -2},
{"name": "shot01b", "in_s": 7.0},
{"name": "board_hall", "hold_s": 1.5}
]
A take entry wants in_s, out_s and gain_db - leave either time off and you get the clip's start or its end. A still entry wants one number, hold_s: the frame is cloned for that long. name is just the label your error messages use.
width, height and fps are the one size and one rate everything is conformed to. Defaults are 1280×704 at 24, which is a sane H3-shaped target - if your clips are 2K, you're downscaling all of them here.
One output: a single VIDEO. Wire it into Save Video, or into MAI Video Out from the same pack if you want the metadata and hold-map sidecars written beside it.
Install
ComfyUI Manager, search the pack title (ComfyUI-MAINodes), or:
cd ComfyUI/custom_nodes
git clone https://github.com/matlowai/ComfyUI-MAINodes
Restart ComfyUI; the node shows up under MAINodes/snap. The pack's example Motion Lab graphs want ComfyUI-KJNodes as well, but this node doesn't - it has no dependencies of its own beyond the pack.
The real dependency is ffmpeg. ComfyUI itself reads and writes video through PyAV, so plenty of installs run perfectly with no ffmpeg program anywhere, and the Windows portable build ships none. This node is one of the ones that needs the program. It fails with a plain sentence rather than a [WinError 2], which is more than most packs manage:
# Windows
winget install ffmpeg
# macOS
brew install ffmpeg
Add ffprobe the same way - the node calls it too - then restart ComfyUI so it inherits the new PATH.
Where people get burned
The plan is positional, not name-matched. Entries are applied to clips in socket order; name never decides anything. Get them out of step and your trims land on the wrong shot. Mixing up the counts is at least loud about it: The plan names 3 clips and 2 are connected: one plan entry per clip, in order.
"Trimmed to nothing." That's what you get when out_s is before in_s, or when you guessed the clip's length and overshot. The message prints both numbers against the real duration, so read it before you re-run.
Everything has a fat black frame around it. That's the deliberate pad-not-crop choice doing its job. Render your takes at one shape if you don't want it.
Long cuts. The assembled file is built in memory and handed on as bytes - a ten-minute cut is a ten-minute h264 sitting in RAM. Build two minutes, check it, then extend.
If you do use Snap, there's more here: the same machinery writes the Cut out as an OpenTimelineIO timeline an NLE can open. Not needed for getting one video out of six clips.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| clips | COMFY_AUTOGROW_V3 | — | |
| plan | STRING | JSON list, one per clip: {name, in_s, out_s, gain_db} for a take, {name, hold_s} for a still | |
| width | INT | 128016–8192 | — |
| height | INT | 70416–8192 | — |
| fps | INT | 241–120 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| VIDEO | VIDEO | — |