Nodes/ComfyUI Neural Nodes/Load Recent File đź“‚
ComfyUI Node

Load Recent File đź“‚

Grab whatever file just landed in a folder

By xobiomesh·Created 2 years ago·Updated 2 years ago· 1
Load Recent File đź“‚
  • trigger
  • image
  • mask
  • filepath
  • filename
  • width
  • height
â—„output_folderâ–ş
â—„file_typesimagesâ–ş
â—„custom_pathâ–ş

If something outside your main graph is dropping files into a folder - a script, a second ComfyUI process, this same pack's own Workflow Runner or Test Script Runner - and you want your graph to pick up whatever just showed up without hunting for it by name, this is the node for that. Point it at a folder, tell it what kind of file you're after, and it hands you back the newest one, already loaded.

How it works

It checks a folder for the newest file matching your file_types filter and loads it. The one genuinely clever design detail is the trigger input, typed as * - meaning it'll accept a wire from anything at all. That's a standard ComfyUI idiom, not something unique to this node: ComfyUI caches a node's result as long as its inputs haven't changed, so a "load the newest file" node with nothing forcing a re-check would just return the same cached file forever. Wiring something into trigger - even a value you don't otherwise use - forces this node to re-check the folder every time the upstream node fires. That's exactly what pairs it with this pack's own xO_WorkflowRunner or xO_TestScriptRunner: run something that produces a new file, chain its output into trigger, and the new result flows straight back into your graph.

The inputs and outputs that matter

  • trigger (required, any type) - the re-run signal described above.
  • output_folder - an enum populated dynamically, the same pattern as OllamaModelSelect's dropdown; expect it to list folders ComfyUI already knows about, likely under your output directory.
  • file_types (images / text / all, default images) - filters what counts as the "recent" file.
  • custom_path (optional STRING) - overrides output_folder with a literal path, for when what you want isn't in the dropdown.
  • Outputs are generous for a small utility: image and mask for when the recent file is an image, filepath and filename as strings, and width / height as ints - content and metadata in one node.

How to install it

Standard install. ComfyUI Manager: search ComfyUI Neural Nodes. Manually:

cd ComfyUI/custom_nodes
git clone https://github.com/xobiomesh/ComfyUI_xObiomesh

then restart. Filesystem I/O only - no models, nothing heavy to download.

Common issues & troubleshooting

Same file loads every time. Check what's actually wired into trigger. If nothing's connected, or the upstream value genuinely isn't changing between runs, ComfyUI's caching will keep serving you the same cached result rather than re-checking the folder.

output_folder dropdown looks empty or stale. Like the Ollama model dropdown elsewhere in this pack, this list is populated once when the page loads. Reload ComfyUI after adding new folders before trusting what's in it.

Image outputs come back empty on a text file. file_types filters what counts as "recent," but the output slots are static - image/mask and the string/int slots all exist regardless of what type of file you loaded. Treat the image-shaped outputs as only meaningful when file_types is set to images, and the rest as noise otherwise.

custom_path doesn't seem to be doing anything. It's optional and layered on top of output_folder, not a swap in the dropdown UI - make sure it's actually filled in rather than left at its empty default if you meant to use it.

Categoryđź’¦xObiomesh/Utils

Inputs (4)

NameTypeDefaultDescription
trigger*Connect to node output that should trigger this node
output_folderCOMBOSelect folder to load from
file_typesCOMBOimagesType of files to look for
custom_pathoptSTRINGOptional: Custom directory path (overrides output_folder if provided)

Outputs (6)

NameTypeDescription
imageIMAGE—
maskMASK—
filepathSTRING—
filenameSTRING—
widthINT—
heightINT—