Video First / Last Frame:
Extracts the opening and closing images from a ComfyUI video so you can use them as visual references elsewhere in your workflow. For videos backed by a file or stream, the node reads short sections near the beginning and end rather than loading the entire video into memory. It also checks the video frame timestamps to identify the final image, which helps when an audio track continues after the video images stop.
Video First / Last Frame Input Parameters:
video
The required ComfyUI VIDEO to examine. The node uses its available frames or video stream to find the first and last images within the active video range. Connect a video with at least one frame; an empty video cannot produce either result. There is no numeric minimum, maximum, default value, or selectable option for this input.
Video First / Last Frame Output Parameters:
first_frame
An IMAGE containing the first frame of the video. It is returned as a single-image batch, ready to connect to nodes that accept ComfyUI images. You can use it as a reference for how a clip begins.
last_frame
An IMAGE containing the last video frame, also returned as a single-image batch. For a stream-backed video, the node locates the final video image rather than treating a longer audio or container duration as evidence of additional frames. You can use this image as a reference for how the clip ends.
Video First / Last Frame Usage Tips:
- Connect a valid ComfyUI
VIDEOand send each image output to the part of your workflow that needs an opening or closing reference. - If you are working with a long file-backed video, use this node when you only need its boundary images: it decodes short sections near each end instead of materializing every frame.
- There are no adjustable settings on this node. To change which images count as the beginning and end, prepare or trim the video upstream before connecting it.
Video First / Last Frame Common Errors and Solutions:
Input is not a valid ComfyUI VIDEO.
- Explanation: The connected value does not provide usable video duration or frame-rate information.
- Solution: Check that the connection comes from a node producing a ComfyUI
VIDEO. Recreate or reload the video if its metadata is unavailable.
Input is not a stream-backed ComfyUI VIDEO.
- Explanation: For a video that is not backed by in-memory frames, the node could not access the stream information needed to locate its final frame.
- Solution: Use a supported ComfyUI
VIDEOsource and make sure its underlying video file or stream remains accessible.
Video contains no frames.
- Explanation: The video is empty, has a non-positive duration or frame rate, or contains no usable frames in the active range.
- Solution: Verify that the source plays and contains visible frames. If you trimmed it upstream, check that the selected range includes at least one frame.
VIDEO frames must use ComfyUI IMAGE layout [B, H, W, C].
- Explanation: The extracted frames are not a four-dimensional ComfyUI image batch.
- Solution: Supply a ComfyUI-compatible
VIDEOrather than a differently formatted frame tensor, and check the node that created the video.
Could not locate the final VIDEO frame.
- Explanation: An unexpected problem occurred while reading the stream to find its final frame.
- Solution: Confirm that the video source is accessible and can be decoded. If the problem persists, try re-encoding the video or loading it through another compatible ComfyUI video source.
