Nodes/ComfyUI-SA-Nodes-QQ/H3 Frames_cut (QQ)
ComfyUI Node

H3 Frames_cut (QQ)

Cut a Dead Segment Out of a Clip Without Losing Audio Sync

By siraxe·Created about a year ago·Updated 9 days ago· 75
H3 Frames_cut (QQ)
  • image
  • audio
  • image
  • audio
  • cut_num
◄start_from0►
◄cut_from22►
◄cut_to39►
◄end_at-1►
◄fps24►

Generated video arrives as one take. Then you watch it and frame 22 to 39 is the part where the character's hand melts, or the cut point is late, or there's a splice you want gone. In a normal editor you'd slice, delete, drag the audio and re-export - and then you're re-encoding a file to feed back into ComfyUI, which is a stupid amount of work for removing 17 frames.

H3 Frames_cut (QQ) does that inside the graph, and the reason it exists rather than a generic frame-slicer is the audio. MiniMax H3 generates picture and stereo audio in one pass - that's the model's whole design claim - so any frame surgery has to move the soundtrack by the same amount or the clip desyncs.

How it works

You give it an image sequence and a range to remove. It keeps [start_from, cut_from) and [cut_to, end_at) and drops everything in the middle, concatenating the two surviving chunks along the batch dimension. If an audio input is connected, it converts the same frame numbers to samples - sample_rate / fps samples per frame - and splices the waveform identically, carrying the sample rate through untouched.

One thing will surprise you if you don't read the source: the cut length is snapped at runtime to a multiple of 17 frames relative to cut_from. The widget accepts any integer, but 22→40 comes back as a 17-frame cut. The author's comment says only that the cut region is always n * 17 - about 0.7 s per step at 24 fps - so whatever grid constraint that's serving, your typed cut_to is a suggestion.

The inputs and outputs that matter

image is the sequence, straight from a decode node. start_from (default 0) and end_at (default -1) bound the whole operation, and -1 means "to the last available frame" - you'll rarely change either. cut_from (22) and cut_to (39) are the actual edit. audio is optional, but connect it or you've built a desync on purpose.

fps defaults to 24 and only matters for the audio math. Set it to whatever the clip actually is; if your footage is 16 or 30, leaving 24 in place is a silent drift proportional to clip length.

Three outputs. image goes to any video combiner - Create Video, VHS_VideoCombine, SaveVideo - along with audio into the same node's audio input. cut_num is the honest number: frames actually removed, after snapping and clamping. Wire it to a display text node the first few times; it's the only way to know what the node did rather than what you asked for.

Install

ComfyUI Manager: search ComfyUI-SA-Nodes-QQ. Or:

cd ComfyUI/custom_nodes
git clone https://github.com/siraxe/ComfyUI-SA-Nodes-QQ

Restart, then look under WanVideoWrapper_QQ/video in the add-node menu - the category still carries the pack's old name even though the folder and repo are ComfyUI-SA-Nodes-QQ. If you had the pre-rename version installed, remove the old wanwrapper_qq folder first; the README warns that stale workflows will otherwise reinstall the retired package.

No pip dependencies: the pack's requirements.txt is empty. But the pack's __init__.py imports every node module at startup, including the MiniMax H3 ones that reach into comfy.ldm.minimax.model and the new comfy_api interface - so on a ComfyUI older than native H3 support the import fails and all of this pack's nodes vanish, this simple frame-cutter included.

Where it goes wrong

Audio drifts after the cut. Nine times out of ten the fps widget doesn't match the clip. The sample math is exact when the fps is right and quietly wrong when it isn't.

The output isn't the length you typed. That's the 17-frame snap. If you need an exact slice with no quantisation, this is the wrong node and a plain batch-slice plus a separate audio trim is the honest answer.

You can't cut near the start. cut_from and cut_to both have a minimum of 5, so the first five frames are out of bounds.

It returns a single black frame. The source handles "you cut everything" by returning one zeroed frame rather than throwing, which keeps the graph valid and makes the failure look like a decode problem. Check cut_num before you go debugging the sampler.

Scope note: this operates on decoded frames, not a video file. It's for surgical edits - a dead segment in a finished generation, or trimming a reference clip before it hits an encoder. If you want a timeline editor, use one.

CategoryWanVideoWrapper_QQ/video

Inputs (7)

NameTypeDefaultDescription
imageIMAGE—
start_fromINT00–100000—
cut_fromINT225–100000—
cut_toINT395–100000—
end_atINT-1-1–100000—
fpsINT241–240—
audiooptAUDIO—

Outputs (3)

NameTypeDescription
imageIMAGE—
audioAUDIO—
cut_numINT—