FunUI Cut Opening:
FunUICutOpening removes the beginning of a generated video clip and trims the accompanying sound by the same amount of time. It is especially useful for image-to-video work, where a reference image helps establish the subject’s identity, visual style, and composition but also appears as the opening still. You can generate the shot normally, then remove that opening to begin further into the action without weakening the reference image’s influence during generation. The node works on decoded images—the actual visible frames—rather than the compressed video representation used during generation. This makes the cut correspond directly to a number of visible frames and avoids the decoding problems that cutting compressed video data can cause. It performs a straightforward trim: the remaining frames retain their order, no replacement ending is generated, and the finished clip becomes shorter.
FunUI Cut Opening Input Parameters:
images
Required input of type IMAGE containing the decoded video frames in playback order. The node treats the first dimension of this image batch as the clip’s frame count and removes frames from its beginning, leaving the remaining images unchanged. Connect decoded video frames here rather than latent samples; in the supplied H3 pipeline, this connection comes from FunUIDecode. For a nonempty clip, the node limits the cut so that at least one frame remains, even if you request more frames than can be removed. No default value, numeric range, or selectable options are defined for this input.
frames
Required INT parameter specifying how many frames to remove from the beginning of the clip. Its default is 0, minimum is 0, and maximum is 4096. A value of 0 leaves both the images and any accompanying audio unchanged. Increasing this value moves the start further into the generated action and shortens the clip accordingly; for example, removing 12 frames from a 24 fps clip removes half a second. The actual cut is limited to one less than the available frame count, so a nonempty clip cannot become empty through trimming. If your request exceeds that limit, the node keeps one frame and reports the adjustment in its status message.
fps
Required FLOAT parameter specifying the frame rate used to convert the removed frame count into time. Its default is 24.0, minimum is 1.0, maximum is 240.0, and adjustment step is 0.01. This value determines how much audio is removed and how the cut duration is reported; it does not change the number of image frames removed or resample the video. For example, cutting 24 frames at 24 fps removes one second of audio, whereas cutting the same number at 48 fps removes half a second. Set this to the frame rate you intend to use when saving or playing the clip so that the picture and sound receive matching time cuts.
audio
Optional input of type AUDIO containing the sound associated with the video. When connected and a cut is made, the node removes audio from the beginning using the actual number of removed video frames, the specified frame rate, and the audio’s sample rate. The calculated audio sample count is rounded to the nearest whole sample and limited to the available audio length. The sample rate and other entries in the audio data are preserved. If the requested time cut consumes all available sound, the resulting audio waveform is empty; unlike the image frames, audio is not guaranteed to retain a sample. If this input is omitted, the node still trims the images and returns no audio. No default audio asset, numeric range, or selectable options are defined.
FunUI Cut Opening Output Parameters:
images
IMAGE output containing the frames remaining after the opening is removed, in their original order and without changes to their visual content. For a nonempty input clip, the remaining frame count is the original count minus the actual cut, with at least one frame retained. If no frames are removed, the original image batch is returned unchanged. Connect this output to your video-saving node so the exported clip uses the trimmed sequence rather than the original decoded frames.
audio
AUDIO output containing the accompanying sound after the matching opening duration has been removed. The trim is calculated from the actual video cut, not an excessive requested cut, which keeps both cuts aligned to the same intended duration. The audio sample rate and other audio metadata are preserved, while the waveform starts later in the original recording. If no cut is made, the original audio is returned unchanged; if no audio was connected, this output is None. A cut that reaches or exceeds the available audio duration produces an empty waveform. The node only trims the beginning and does not otherwise adjust the audio’s duration to match the remaining video.
status
STRING output describing the action taken. When no frames are removed, its exact value is nothing cut. Otherwise, it reports the actual removed frame count, original frame count, and removed duration rounded to two decimal places, such as cut 12 of 120 frames (0.50s). If your requested cut would leave no image frames, the message adds an explanation, such as cut 119 of 120 frames (4.96s); asked for 150, but one frame has to stay. Use this output to verify the effective cut, particularly when working with clips shorter than expected.
FunUI Cut Opening Usage Tips:
- Place the node after video decoding and before video saving. The supplied H3 pipeline follows FunUIDecode → FunUICutOpening → FunUISaveVideo, allowing the cut to operate on visible frames rather than latent data.
- For image-to-video shots, start with a small cut and preview the result. Increase
framesuntil the opening reference still or unwanted initial moment is removed, while checking that you retain the action you want. - Calculate a starting setting by multiplying the desired cut duration in seconds by the clip’s frame rate, then choosing a whole frame count. At 24 fps, 6 frames removes 0.25 seconds, 12 frames removes 0.5 seconds, and 24 frames removes 1 second.
- Match
fpsto the frame rate used by your video-saving node. Changing it here does not change video playback speed; it changes the audio trim duration and the reported cut time. - Connect both trimmed outputs to your video-saving node when working with sound. Combining trimmed images with the original, untrimmed audio can introduce a timing offset.
- Use
framesset to 0 to keep the node connected while disabling the trim. This passes the images and audio through unchanged and returnsnothing cut. - Allow for a shorter final shot when planning generation length. This node does not replace removed footage, extend the ending, or regenerate motion.
- Check
statuswhen a clip unexpectedly becomes extremely short. The node preserves one image frame rather than rejecting an oversized cut, so a completed operation does not necessarily mean the requested trim was suitable.
FunUI Cut Opening Common Errors and Solutions:
nothing cut
- Explanation: This is a normal status message, not an error. It means the effective cut was zero, usually because
framesis 0 or the input clip contains only one frame. - Solution: Increase
framesif you want a trim. If the message persists, check thatimagescontains a multi-frame decoded video rather than a single still image.
cut …; asked for …, but one frame has to stay
- Explanation: This status message means you requested more frames than can be removed while retaining one image frame. The node reduced the cut automatically, potentially leaving a one-frame result.
- Solution: Lower
framesto leave the amount of footage you need. Check the original frame count shown in the message and confirm that the full decoded clip reaches the node.
Sound and picture are out of sync after trimming
- Explanation: This is a possible result rather than a custom error message. A mismatched
fpsvalue causes the audio to be trimmed by a different duration than the video represents at export. Routing original audio alongside trimmed images can cause the same symptom. - Solution: Set
fpsto match the saved video’s frame rate and connect bothimagesandaudiofrom FunUICutOpening to your video-saving node. Also verify that the source audio and video were synchronized before trimming.
Audio is empty after the cut
- Explanation: The calculated opening trim can consume the entire audio waveform if the sound is shorter than or equal to the removed duration. The node limits audio removal to the available samples but does not preserve a minimum audio length.
- Solution: Reduce
frames, checkfps, or provide audio that extends beyond the cut point. If you intend to export without sound, omit the audio connection rather than depending on a downstream node to handle an empty waveform.
KeyError: 'waveform' or KeyError: 'sample_rate'
- Explanation: These Python errors can occur during a nonzero cut if the connected audio data is missing the waveform or sample-rate entry that the node expects. They indicate malformed audio data rather than a problem with the requested frame count.
- Solution: Supply a valid ComfyUI AUDIO connection from an audio-loading or decoding node. If sound is unnecessary, disconnect the optional
audioinput.
AttributeError involving 'shape', or an indexing error
- Explanation: The node reads the image batch’s frame count through its shape and slices that batch to trim it. It also reads and slices the audio waveform when sound is present. Incorrectly structured data can therefore cause shape-related or indexing errors; the exact message depends on the supplied data.
- Solution: Connect decoded IMAGE data to
images, not latent samples, a filename, or another data type. For audio-related failures, check that the source provides a standard ComfyUI AUDIO object with a waveform.
ZeroDivisionError: float division by zero
- Explanation: This can occur during a nonzero cut if
fpsis forced to 0 outside the declared interface limits. The normal interface prevents this by setting a minimum of 1.0. - Solution: Use the clip’s actual positive frame rate within the supported 1.0–240.0 range. If you construct workflows programmatically, validate
fpsbefore running the node.
The result is still empty or fails downstream with an empty image batch
- Explanation: The one-frame safeguard only preserves a frame when the incoming clip already contains at least one. If the incoming image batch is empty, the node cannot create a replacement frame, and the resulting failure may appear later in the workflow.
- Solution: Check the generation and decoding stages to confirm they produce a nonempty image batch. Preview or inspect the decoded frames before connecting them to FunUICutOpening.
