Nodes/CRT-Nodes/Load Last Image (CRT)
ComfyUI Node

Load Last Image (CRT)

Load Last Image (CRT)

By PGCRT·Created 2 years ago·Updated 2 days ago· 132
Load Last Image (CRT)
    • image
    folder_path
    sort_bydate
    invert_orderfalse

    Load Last Image (CRT) watches a folder and feeds the newest image in it back into the graph. You point it at a directory, and every time you run the workflow it re-reads that folder, picks the file you asked for, and hands it out as an IMAGE. It's the node that turns "render into a folder, then manually load the result" into a closed loop.

    The obvious job is two-pass and loop workflows. Render pass one with Save Image With Path (CRT) writing into a folder, then Load Last Image pointed at that same folder becomes the input to pass two - a hires-fix, an upscale-and-refine, a detail pass. Run it again and the loop picks up the new output automatically. No dragging files, no re-selecting from the input dropdown, no stale references. That's also why it has an IS_CHANGED that fingerprints the folder: it re-executes when the folder contents change, so ComfyUI knows to re-run the downstream graph instead of caching the old result.

    The three inputs are folder_path, sort_by, and invert_order. folder_path is an absolute path on your machine (not the ComfyUI input directory - this one reads the real filesystem, which is what makes it work for output folders outside output/). sort_by chooses between date (file modification time) and alphabetical (natural sort), and invert_order flips the direction. With the defaults - date, no invert - it grabs the most recently modified image. Flip invert_order and you get the oldest file, which is handy for walking a folder front-to-back across repeated runs.

    A couple of grounded gotchas. It supports the usual formats (.png, .jpg, .jpeg, .bmp, .tiff) and raises a clear error if the folder doesn't exist or contains no images - so check your path before you queue. Sorting is by mtime, which means if something else touches files in that folder, the "last" image can change under you; keep the folder dedicated to what the loop writes. And note the output is a single IMAGE - the newest file only, not a batch.

    Install with the pack (ComfyUI Manager → search "CRT-Nodes", or clone https://github.com/plugcrypt/CRT-Nodes.git into custom_nodes and restart). No models, no extra dependencies. It pairs naturally with the pack's other folder-aware nodes - Save Image With Path, Text Loader Crawl, Load Last Latent - and together they're a decent foundation for batch-processing folders without babysitting the graph.

    CategoryCRT/Load

    Inputs (3)

    NameTypeDefaultDescription
    folder_pathSTRING
    sort_byCOMBOdate2 options: alphabetical, date
    invert_orderBOOLEANfalse

    Outputs (1)

    NameTypeDescription
    imageIMAGE