Nodes/ComfyUI vsLinx Nodes/Load Last Generated Image
ComfyUI Node

Load Last Generated Image

Load Last Generated Image — the 'previous run' input for feedback loops and chained workflows

By vslinx·Created about a year ago·Updated 26 days ago· 25
Load Last Generated Image
    • image
    • mask
    image
    auto_refreshtrue

    Some workflows need to feed the last thing you generated back in as an input - an img2img loop, an iteration chain, a "refine what I just made" setup. ComfyUI's built-in LoadImageOutput exists for this, but it's bare-bones: you pick a file, and when a new image lands you re-pick it by hand. This vsLinx node is a proper replacement. It lists everything in your output folder newest-first, auto-refreshes after each generation (only when a new file actually appears, so your current selection isn't yanked away mid-workflow), and even gives you a MaskEditor.

    What it does differently

    • Newest-first dropdown - the most recent generation is always at the top, which is the whole point of the node.
    • Auto refresh after generation - enabled by default via the auto_refresh boolean. When a new output file shows up, it's picked up automatically.
    • MaskEditor support - right-click → "Open in MaskEditor", and painted masks persist across workflow executions, tab switches, and page reloads. There was a real bug here (v1.7.1): after ComfyUI's frontend got a Vue-based node output store, the preview could get stuck on a stale mask after refreshing to a new image; the fix clears the store when switching back to an output image. If you see that behavior, update the pack.
    • Graceful failure - if no image exists or the selected file was deleted, it outputs a 512×512 black image instead of erroring, so a feedback loop doesn't brick itself mid-run.

    Inputs and outputs

    • image (STRING) - the dropdown selection.
    • auto_refresh (boolean, default on) - auto-pick up new outputs.
    • Outputs: image (IMAGE) and mask (MASK). The mask output is what makes the MaskEditor workflow possible - you can use a drawn mask downstream for inpainting.

    A include_subfolders property (right-click → Properties) controls whether subfolders inside output are scanned for the dropdown and refresh. Handy if you organize outputs by run.

    When to reach for it

    The obvious one is a "refine the last result" chain: generate → load last image → img2img at low denoise → save → repeat. Auto-refresh makes that loop genuinely hands-off. It's also great for building a quick gallery UI where the newest output should always appear at the top, and for img2img workflows where you iterate on whatever just came out without hunting through the output folder.

    Install

    Ships in the vsLinx pack. ComfyUI Manager → search "ComfyUI vsLinx Nodes", or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/vslinx/ComfyUI-vslinx-nodes.git comfyui-vslinx-nodes
    

    Restart, find it under vsLinx/image. No extra dependencies.

    The honest take

    It's a quality-of-life replacement, not a flashy new capability - if you never chain runs, you'll never need it. But for iteration workflows it quietly removes a recurring annoyance, and the mask persistence is a genuine step up from core. The one behavior to keep in mind: "load last" means last new file, so if your workflow saves multiple images per run (say a grid plus a full-size), make sure the one you want back is actually the newest - or the node will happily feed you the wrong one and your loop will drift.

    CategoryvsLinx/image

    Inputs (2)

    NameTypeDefaultDescription
    imageSTRING
    auto_refreshBOOLEANtrue

    Outputs (2)

    NameTypeDescription
    imageIMAGE
    maskMASK