Ino Get Last File
Find the newest file in a folder, without a file browser
- success
- message
- filename
- abs_path
ComfyUI's file nodes love a fixed filename, but automation doesn't always get one. When your workflow produces a file with a timestamp or a batch number you can't predict, you need to grab "whatever is newest," and that's the whole job of Ino Get Last File. Point it at a folder, and it returns the most recently modified file in it - name and absolute path - so the next node can operate on a file you never had to name.
It's part of the Ino Nodes pack (nobandegani), in the file-helper category, following the pack's standard parent_folder / folder convention and the usual success/message reporting outputs.
What it does
You give it a location, it scans the folder, finds the entry with the newest modification time, and hands it back. Straightforward, but the outputs are what make it useful:
- filename - the name of the newest file (no path).
- abs_path - its full absolute path, ready to feed into nodes that take a path string, or into file nodes like Ino Get File Hash for verification.
- success / message - reporting, as with the whole pack's file family.
Inputs are just enabled, parent_folder (input/output/temp), and folder. Note there's no filename input - naming the file is the one thing this node refuses to do, because it exists precisely for when you can't.
One thing to know: "last" means most recently modified, not "largest" or "alphabetically last." So it pairs beautifully with anything that writes output files with unique names - a batch renderer, a downloader, an Ino Save Images node writing render_0001.png, render_0002.png, and so on.
Where it earns its place
The classic loop: a process (another workflow, a script, a remote job) writes files into a folder, and your ComfyUI graph needs to pick up the newest one and process it. Chain Ino Get Last File → a path-consuming node → your sampler, and the graph self-picks the current artifact every run. It's also a clean "did anything actually get produced?" check: no file found comes back through the message output, and you can gate the rest of the workflow on success.
The honest caveat: it's not recursive, it looks at the immediate folder only, and ties in modification time are resolved however the filesystem reports them. If you need "newest file including subfolders," you'd want the pack's file-counting or path helpers instead.
Installing it
It ships with the full Ino Nodes pack. ComfyUI Manager: search "ComfyUI Ino Nodes", install, restart. Or manually:
cd ComfyUI/custom_nodes
git clone https://github.com/nobandegani/ComfyUI-InoNodes.git
cd comfyui_ino_nodes
pip install -r requirements.txt
Restart after. Pack-wide caveats apply: it's built on ComfyUI's V3 schema (README wants v0.18.1+), and requirements.txt installs inopyutils, the helper library every node imports.
Common issues
If you're getting a file that isn't the one you expected, remember the sort key is modification time - an old file you just touched will "win." And an empty folder returns a failure through message rather than an empty filename, so wire that signal into your logic instead of assuming a file exists. Search "Ino Get Last File" in the node menu (grouped under InoFileHelper).
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| enabled | BOOLEAN | true | — |
| parent_folder | COMBO | 3 options: input, output, temp | |
| folder | STRING | — |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| success | BOOLEAN | — |
| message | STRING | — |
| filename | STRING | — |
| abs_path | STRING | — |