Select Latest π₯π ₯π π ’
Select Latest
- Filename
Select Latest finds the most recently modified file in a folder and hands you its path as a string. The point is chaining: you run a workflow that writes a file, and on the next run you want to automatically pick up whatever that last run produced - without manually copying a filename in. This node is the "grab whatever I just made" glue.
Worth flagging up front: it's an experimental virtual node. It runs on the frontend rather than as a normal graph node, and the author labels it experimental for a reason - it's a clever convenience, not a load-bearing production primitive. Treat it as such.
Why you'd reach for it
The canonical case, and the reason its default prefix is literally output/AnimateDiff, is iterative video work: generate a clip, then feed the last output back into a new generation as a starting point - the frame-to-frame chaining that lets you extend a sequence across multiple runs. Rather than hardcode AnimateDiff_00042.mp4 and edit it every single time, you point Select Latest at the folder and prefix, and it always resolves to the newest match. Queue the workflow repeatedly and it walks forward on its own.
How it works
You give it a path prefix and (optionally) a required ending. It scans for files matching both, picks the one with the newest modification time, and outputs that full path as a string. Because it's a virtual node evaluating on the frontend, it resolves the filename when you queue the prompt.
Inputs and outputs
- filename_prefix (STRING, default
output/AnimateDiff) - a path that's part folder, part filename prefix. Candidate files must match it. This is how you scope it to the right directory and naming scheme. - filename_postfix (STRING) - a string the selected file must end with. Use it to lock onto a specific extension, e.g.
.mp4or.png, so you don't accidentally grab a sidecar file.
Output:
- Filename (STRING) - the full path to the most recently modified matching file, ready to feed into a loader.
Installing it
comfy.icu has VideoHelperSuite pre-installed, so it's available immediately.
Locally: ComfyUI Manager β search ComfyUI-VideoHelperSuite β install β restart. Or clone:
cd ComfyUI/custom_nodes
git clone https://github.com/Kosinkadink/ComfyUI-VideoHelperSuite
then restart ComfyUI. It's Kosinkadink's pack, and this node in particular grew out of AnimateDiff chaining workflows - hence that default prefix.
Common issues
Because it selects by modification time, anything that touches a file's timestamp can fool it - copying files around, syncing a folder, or another workflow writing to the same directory can all leave a "newer" file that isn't the one you meant. Keep its target folder clean and dedicated if you're relying on it for a chain.
Set filename_postfix to your real extension. Without it, the newest match might be a partial write, a thumbnail, or a metadata file, and you'll hand a garbage path to your loader.
And since it's experimental and virtual, don't be shocked if it behaves oddly under a new ComfyUI frontend release - virtual nodes are more exposed to frontend churn than normal ones. If the whole pack is missing, that's an import failure (ffmpeg or NumPy), not this node specifically; check the startup log and reinstall through Manager.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| filename_prefix | STRING | output/AnimateDiff | β |
| filename_postfix | STRING | β |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| Filename | STRING | β |