Nodes/ComfyUI-FFMPEGA/Load Last Video (FFMPEGA)
ComfyUI Node

Load Last Video (FFMPEGA)

Stop digging through output folders — just load the last video you made

By AEmotionStudio·Created 8 months ago·Updated 2 days ago· 16
Load Last Video (FFMPEGA)
  • images
  • audio
  • mask
  • images
  • selected_frames
  • audio
  • video_path
  • image_paths
  • mask
refresh_modeauto
frame_select_modemanual
auto_timestamps
pause_for_selectionfalse
source_folder
filename_filter
max_frames128
video_path

Every ComfyUI user has a version of this workflow: run something, save, then spend twenty seconds in a file browser trying to remember which of the twelve FFMPEGA_00042.mp4 files you actually just made. Load Last Video (FFMPEGA) kills that whole ritual. It scans ComfyUI's output and temp directories, finds the newest video by modification time, decodes its frames, extracts the audio, and shows you an inline preview that loads immediately - no queueing, no file hunting.

It's the sibling of Load Last Image, and the two were merged into this pack from the author's separate ComfyUI-LoadLast project. The obvious use is iteration: edit → save → re-load the result → edit again, as a loop that never requires typing a filename. But it's not just a convenience node - it also does frame selection.

The inputs that matter

  • refresh_mode - auto (reload when the latest video changes - the one you want for iteration) or manual (only reloads on input change).
  • frame_select_mode - how to pick frames out of the video: manual (you click in the preview), or auto strategies like uniform_5, uniform_10, first_last, every_2nd, every_5th, and timestamps (driven by auto_timestamps, e.g. 0.5,1.0,2.5). Handy for pulling representative stills without loading everything.
  • pause_for_selection - in manual selection mode, blocks execution until you actually select frames, then re-queue.
  • max_frames - cap on frames decoded into the IMAGE tensor (default 128, 0 = all). Frames are evenly sampled to keep temporal coverage, so it's the memory guard for long videos.
  • source_folder / filename_filter - point it at a custom folder or filter by prefix when "newest in output" isn't the right answer.
  • images / audio / video_path - overrides: connect any of these and they beat auto-discovery, which is useful when you already have the file in hand but want this node's frame-selection outputs anyway.

Outputs: images (decoded frames), selected_frames (at the chosen timestamps), audio, video_path, image_paths (comma-separated PNG paths of the selected frames), frame_count, fps, duration.

Installing it

It ships in ComfyUI-FFMPEGA: ComfyUI Manager → search ComfyUI-FFMPEGA → Install, or:

cd ComfyUI/custom_nodes
git clone https://github.com/AEmotionStudio/ComfyUI-FFMPEGA.git
cd ComfyUI-FFMPEGA
pip install -r requirements.txt

Restart ComfyUI; ffmpeg on PATH is the pack's hard dependency.

Where people get burned

The classic trap is relying on it in a workflow where "newest" is ambiguous - if another node (or another run) writes to the same output folder between your queue and this node's execution, you load the wrong video and silently process garbage. Use filename_filter to pin it to your own prefix, or set source_folder to somewhere only you write. Also note the default max_frames of 128 with even sampling: that's deliberate to protect memory, but it means images is not "all the frames" on a long clip - if you need the full frame sequence, raise the cap or 0 it and accept the VRAM cost.

CategoryFFMPEGA

Inputs (11)

NameTypeDefaultDescription
refresh_modeCOMBOautoauto: reload when latest video changes. manual: only on input change.
frame_select_modeCOMBOmanualHow to select frames. 'manual' = user clicks in preview. 'last' = the final frame only, for continuing a scene. Other modes auto-select frames based on the chosen strategy. Auto-selected frames are merged with any manual clicks.
auto_timestampsSTRINGComma-separated timestamps for 'timestamps' mode (e.g., '0.5,1.0,2.5').
pause_for_selectionBOOLEANfalseWhen ON and frame_select_mode is 'manual', blocks execution if no frames are selected. Select frames, then re-queue.
source_folderoptSTRINGCustom folder to scan. Empty = default output/temp directories.
filename_filteroptSTRINGOnly load files starting with this prefix.
max_framesoptINT1280–2147483647Max frames to decode into the IMAGE tensor (0 = all). Caps memory usage for long videos. Frames are evenly sampled to preserve temporal coverage.
imagesoptIMAGEOverride: video frames as IMAGE tensor. Overrides auto-discovery.
audiooptAUDIOOverride: provide audio directly. Overrides audio extracted from video.
video_pathoptSTRINGOverride: path to a video file. Overrides auto-discovery.
maskoptMASKOptional upstream MASK pass-through. Forwarded as-is to the mask output.

Outputs (6)

NameTypeDescription
imagesIMAGE
selected_framesIMAGE
audioAUDIO
video_pathSTRING
image_pathsSTRING
maskMASK