Nodes/S42 CutFlow/✂ S42 CutFlow Smart Trim
ComfyUI Node

✂ S42 CutFlow Smart Trim

Cut the junk frames off your AI clips without leaving ComfyUI

By GeekyGhost·Created 6 months ago·Updated 4 months ago· 3
✂ S42 CutFlow Smart Trim
  • clip
  • clip
  • frame_count
  • info
trim_unitframes
in_point0
out_point-1
fps24.0

Every AI video model hands you unusable frames. LTX warmup frames, Wan artifacts, CogVideo noise at the start and end - the good stuff is almost always in the middle. S42CF_SmartTrim is the razor blade: it trims a clip to an in/out point, either by exact frame index or by seconds, and hands you a clean clip plus its frame count. It's the most-used node in GeekyGhost's S42 CutFlow suite for a reason - it's the thing you reach for the moment you load generated footage.

The inputs that matter

  • clip (IMAGE) - your video as a standard IMAGE batch. Works with anything that outputs that: VHS/GGF Load Video, an LTX VAE decode, whatever.
  • trim_unit - frames (exact 0-based frame indices) or seconds (time-based, using the fps parameter). Seconds mode is the one you'll actually want when you "know I want the middle 3 seconds" but can't be bothered converting to frame numbers by hand.
  • in_point (float, default 0) - where to start. In frames mode that's a frame index; in seconds mode, a time from the start.
  • out_point (float, default -1) - where to end (inclusive). The -1 means "trim to the end of the clip," and it's a genuinely thoughtful default - you can set just an in_point and get everything after it.
  • fps (float, default 24) - only consulted in seconds mode.

So the two most common operations are: chop the first 12 frames with trim_unit=frames, in_point=12, or cut out "the middle three seconds" with trim_unit=seconds, in_point=1.5, out_point=4.5, fps=24.

What comes out

clip (the trimmed IMAGE batch), frame_count (INT - genuinely useful, because downstream nodes like audio trimming or segmenting want to know how long the clip now is), and info (STRING), a one-line summary of what got cut. Wiring frame_count from this node into the pack's Audio Trim or a frame-count-driven node keeps everything in sync without you doing arithmetic.

Installing it

Standard pack install - this is one of 50+ nodes, so you install the whole suite once:

cd ComfyUI/custom_nodes/
git clone https://github.com/GeekyGhost/S42-CutFlow.git
pip install -r S42-CutFlow/requirements.txt   # Windows portable: python_embeded\python.exe -m pip install -r ...

Or ComfyUI Manager → search S42 CutFlow → install. Restart ComfyUI (a full restart, not just a refresh), and it appears under S42 CutFlow/Clip Ops. The console prints a [S42 CutFlow] Loaded ... nodes line when the pack registers.

Gotchas

The classic mistake is forgetting out_point is inclusive - if you want frames 10 through 20, that's in_point=10, out_point=20, and you get 11 frames. If your clip comes back one frame shorter than you expected, that's why. Second: in frames mode the fps parameter is ignored entirely, so don't fight it - switch trim_unit to seconds if you're thinking in time. Third, trim before you filter, not after. Trimming first means your expensive sharpen/denoise passes run on fewer frames, and it keeps the bad start/end frames from contaminating temporal effects like a speed ramp or frame averaging. If you're trimming AI output, a good habit is to check the result with the pack's Thumbnail Strip first, so you can see exactly where the artifacts end before you commit to cut points.

CategoryS42 CutFlow/Clip Ops

Inputs (5)

NameTypeDefaultDescription
clipIMAGEVideo clip as IMAGE batch [B,H,W,C]. Connect from any video loader or upstream node.
trim_unitCOMBOframesUnit for in/out points. 'frames' = exact frame indices (0-based). 'seconds' = time-based (uses fps parameter).
in_pointFLOAT00–99999Start point. In 'frames' mode: frame index (0 = first). In 'seconds' mode: time from start.
out_pointFLOAT-1-1–99999End point (inclusive). Set to -1 to trim to end of clip.
fpsFLOAT24.01–120Frames per second. Used when trim_unit='seconds' to convert time to frame indices.

Outputs (3)

NameTypeDescription
clipIMAGE
frame_countINT
infoSTRING