FunUI Cut Opening
Trim the head off a clip without desyncing the sound
- images
- audio
- images
- audio
- status
The first second of a generated video clip is often the worst second: the reference image settling into motion, the model clearing its throat before the shot starts. You want to drop the head and keep the rest. Cropping frames is a one-liner. Keeping the audio lined up while you do it is where it goes wrong, because now the picture and the soundtrack have to lose the same amount of time, and those are measured in different units.
FunUI Cut Opening does both halves in one node. Give it a batch of images, a number of frames, and the clip's frame rate; it hands back the trimmed frames and the matching stretch of sound.
How it works
frames is how many frames to drop off the front - 0 keeps everything. fps is what converts that into a duration, and the audio is then cut at frames / fps seconds, translated into samples at whatever the audio stream's own sample rate is. That's the whole mechanism, and it's the right one: the node slashes cut samples' worth off the end of the waveform rather than trying to guess at frame boundaries.
Two details show the author has been bitten before:
- It never returns an empty clip. The cut is clamped to
total - 1, so asking for 500 frames out of 121 keeps one frame. An empty IMAGE batch doesn't fail here, it fails three nodes later with something obscure - so the clamp plus a status line saying what happened is the better failure. - The status tells you the arithmetic. You get something like
cut 40 of 121 frames (1.67s), and if you asked for more than you could have, it appendsasked for 500, but one frame has to stay.
The inputs and outputs
- images - the clip, which in ComfyUI is just a batch of IMAGE frames.
- frames - how many to cut. Sounds obvious, it's the number you'll fiddle with.
- fps - and this is the one to get right. The node has no idea what rate your clip is actually at. It uses the number you type. Type the rate you intend to save the clip at, not the rate you wish it were.
- audio (optional) - an AUDIO stream. If you don't wire it, you get the trimmed frames and nothing else, and nothing complains.
Outputs are images, audio (the same object, minus the leading samples, or whatever came in when there was nothing to cut), and status.
Where it sits in a pipeline
Typical order: FunUI Decode → FunUI Cut Opening → your save node, with the images going into a save-video node and the audio alongside it. On an H3 clip with native stereo sound, this is the only trimming step where the audio follows along for free; if you crop the frame batch with a plain image node, the soundtrack stays where it was and you get drift you'll spend twenty minutes blaming on the model.
The node cuts the front only. There's no tail trim here, no frame-rate conversion, no re-timing. If you need a middle slice, chain it or use one of the timeline tools in the FunUI studio, which does trimming interactively on rendered clips.
Installing it
cd ComfyUI/custom_nodes
git clone https://github.com/digital-garbage/FunUI
pip install -r requirements.txt
Or install FunUI from ComfyUI-Manager / comfy node install FunUI, then restart. This particular node is a module in the pack - if it's missing from your node list, its module is switched off in Settings ▸ Modules or failed to load, and the log says which.
You need MiniMax H3 to have audio at all. The pack is built around it; LTX 2.x support is in the README marked untested, and SD 1.5 is experimental.
Where people get burned
Wrong fps. Say it's 24, the clip is actually 16fps, and the sound slides by a growing amount. The trim is exact; your number wasn't.
Expecting a tail trim. It isn't one. frames always comes off the front.
Cutting before decode. You can't cut frames you haven't decoded yet. This node takes IMAGE, not LATENT.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| images | IMAGE | — | |
| frames | INT | 00–4096 | How many frames to cut off the front. 0 = keep everything. |
| fps | FLOAT | 24.001–240 | The clip's frame rate, so the sound is cut by the same time. |
| audioopt | AUDIO | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| images | IMAGE | — |
| audio | AUDIO | — |
| status | STRING | — |