Video Last Frame:
VideoLastFrame finds a scene video and extracts its final decoded frame for use as an image in your ComfyUI workflow. It selects the matching video with the highest numbered counter, so you can work with the latest numbered version of a scene without choosing a file manually. It uses FFmpeg to decode through the end of the video, leaving the last frame rather than the first frame near the end.
Video Last Frame Input Parameters:
index
The scene number to look for in video filenames. For example, an index of 2 matches files named 2_<counter>.mp4; if several match, the node chooses the one with the highest numeric counter. This is a required integer with a default of 1, a minimum of 0, and a maximum of 999999. Choose the number used at the start of your scene video’s filename.
scenes_folder
The folder containing your scene videos, specified relative to the ComfyUI output directory. Leave it empty to search the output directory itself, or enter a subfolder such as scenes to search there. This optional string defaults to "" (empty); the source specifies no minimum or maximum length. If it points to the wrong folder, the node will not find a matching video.
Video Last Frame Output Parameters:
image
The final decoded frame of the selected video as a standard ComfyUI IMAGE. It is returned as a single RGB image, ready to connect to downstream image-processing nodes. Its dimensions come from the decoded video frame.
video_path
The filesystem path to the video selected for extraction, returned as a STRING. Use it to identify which file supplied the frame, especially when several numbered versions of a scene exist.
Video Last Frame Usage Tips:
- Name scene videos in the form
<index>_<counter>.mp4and place them in the folder you select. For example, withindexset to2,2_3.mp4is chosen over2_1.mp4. - Leave
scenes_folderempty when videos are directly in the ComfyUI output directory. If they are in a subfolder, enter its path relative to that directory. - Check
video_pathwhen the extracted image is not from the version you expected; the highest numeric counter wins, regardless of which file was created most recently. - Make sure FFmpeg is available before running the node. It checks for a system FFmpeg installation first, then tries
imageio-ffmpeg.
Video Last Frame Common Errors and Solutions:
[ Video Last Frame] No video matching '<index>_<n>.mp4' in <scenes_dir>
- Explanation: The selected folder contains no video matching the requested scene number and filename pattern.
- Solution: Check
indexandscenes_folder, then confirm that a matching.mp4file is in that folder and has a numeric counter, such as2_1.mp4.
ffmpeg not found. Install it system-wide or run: pip install imageio-ffmpeg
- Explanation: The node could not find an FFmpeg executable, which it needs to extract the frame.
- Solution: Install FFmpeg system-wide or install
imageio-ffmpegin the Python environment running ComfyUI, then retry.
[ Video Last Frame] ffmpeg failed extracting last frame of <video_path> (exit <code>):
- Explanation: FFmpeg reported an error, or the expected extracted frame file was not created. The message includes the end of FFmpeg’s diagnostic output.
- Solution: Read that diagnostic text for the specific cause. Confirm that the selected video opens and plays, and that ComfyUI can write to its output directory; then retry or replace the video if it is damaged.
