Nodes/ComfyUI Local Folder Image/Local Folder Image (client folder)
ComfyUI Node

Local Folder Image (client folder)

Feed a folder on your machine to a server-side ComfyUI, one image at a time

By ArtemKo7v·Created 2 months ago·Updated 2 months ago· 1
Local Folder Image (client folder)
    • image
    • mask
    • filename
    • file_index
    file_index1
    index_modeincrement
    looptrue
    scantop_level
    extensionspng,jpg,jpeg,webp,bmp
    filename

    The problem with running ComfyUI on a server - a rented GPU box, a hosted instance, a friend's machine - is that every image you want to touch has to get to the server first. LoadImage reads from the server's input/ folder, so the standard move is uploading your whole library up front and hoping nobody notices the 4 GB transfer. Local Folder Image (client folder) is the answer for the very common case where you want to run a folder of your own images through a remote pipeline without shipping the archive.

    It's dead simple: you pick a folder on your machine, and on every workflow run the node uploads exactly one file from it to the server. The author built it because he had a disk full of old, low-res SD1.5/SDXL outputs he wanted a modern model to fix and upscale - the "restore my old archive" job from the upscaling playbook - and refused to upload the whole pile. He automated it with Run Instant and let the workflow eat through the folder file by file. That's the intended use, and it works.

    How it works

    The backend node is deliberately dumb. It knows nothing about your folder; all the filesystem work happens in the browser extension (js/local_folder_image.js). Before each prompt is submitted, the frontend filters and naturally sorts the stored file list (locale-aware, so img2 sorts before img10), validates file_index, POSTs the one selected file to /upload/image in the temp directory's artemko7v_local_folder_image subfolder, writes the returned path into the filename widget, and advances file_index for the next run.

    The Python side just resolves that path (rejecting anything outside the temp dir), loads the image, and hands it back. A couple of details make it feel well-made: it patches app.graphToPrompt rather than the queue button, so a batch count above 1 uploads one file per item, and its IS_CHANGED returns NaN so the node always re-executes - otherwise picking the same file twice would return a cached result. The File objects from the folder picker are lazy handles, not the bytes, so a folder of a thousand images costs about a megabyte of RAM in your tab and only the selected file is ever read.

    Inputs and outputs that matter

    The index logic is the clever bit, and it's the one you need to internalize. file_index + index_mode work exactly like a seed with control_after_generate: the value shown is the one used for the current run, then it's updated for the next.

    • file_index - 1-based position in the sorted, filtered list. Out of range means the run is never queued.
    • index_mode - fixed, increment, decrement, or random. Increment is the default and is what you want for "work through the folder in order."
    • loop - wraps at the ends. Forced on and greyed out for fixed/random. With increment and loop off, the current run executes but the next queue attempt fails with "all N files have been iterated" - that's the exhaustion guard, and it's easy to mistake for a bug the first time.
    • scan (top_level / recursive) and extensions (comma-separated) - the filter. Defaults are top-level and png,jpg,jpeg,webp,bmp, which is fine.
    • filename - filled in automatically with what actually got uploaded. Leave it alone.

    Outputs: IMAGE (wire this into your upscaler/restorer), MASK (from the alpha channel - empty if there is none), plus filename and file_index if you want to track progress by name or index.

    Installation

    Zero dependencies, no model downloads, no requirements.txt - it's a node class plus one JS file. Install with ComfyUI Manager (search "ComfyUI-LocalFolderImage") or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/ArtemKo7v/ComfyUI-LocalFolderImage
    

    Restart ComfyUI, then hard-reload the page (Ctrl+Shift+R) - the frontend caches extensions aggressively, and a missing button almost always means the JS didn't reload. It's also published to the Comfy registry if you install that way.

    The gotchas (they're honest ones)

    • The workflow must be queued from the browser. Queue via API or a script and nobody uploads a file - you get FileNotFoundError. This is inherent to the design: only the browser knows about your folder.
    • Folder selection dies on page reload and is not saved in the workflow JSON - pick it again (one click, it reopens at the last-used directory). Both are intended behavior.
    • Chrome's "Upload 1000 files to this site?" dialog is scary and harmless. Nothing is transferred at pick time; only the one file per run goes up.
    • Uploads land in temp/, which ComfyUI clears on restart. If a file was deleted on disk after you picked the folder, the run fails with the offending index named - deliberately, to keep the index contract honest.

    It's a small, well-documented corner of the ecosystem, but if you've ever stood in front of a remote ComfyUI with a folder of images you didn't want to upload, it's the one you'll actually reach for.

    CategoryArtemKo7v/image

    Inputs (6)

    NameTypeDefaultDescription
    file_indexINT11–4294967295
    index_modeCOMBOincrement4 options: fixed, increment, decrement, random
    loopBOOLEANtrue
    scanCOMBOtop_level2 options: top_level, recursive
    extensionsSTRINGpng,jpg,jpeg,webp,bmp
    filenameSTRING

    Outputs (4)

    NameTypeDescription
    imageIMAGE
    maskMASK
    filenameSTRING
    file_indexINT