Nodes/ComfyUi-ImageGalleryLoader/Image Gallery Loader
ComfyUI Node

Image Gallery Loader

Stop squinting at the Load Image dropdown — pick from a thumbnail gallery instead

By BigStationW·Created 8 months ago·Updated 6 months ago· 48
Image Gallery Loader
    • IMAGE

    The default Load Image node has a dirty secret: once your ComfyUI/input folder passes a few hundred files, that dropdown becomes a wall of identical image_0042.png names and you're guessing which one is which. That's the exact itch Image Gallery Loader (class LocalImageGallery, from the ComfyUi-ImageGalleryLoader pack) scratches. Instead of a text list, it renders an actual scrollable thumbnail gallery inside the node - you eyeball the image, click it, and it feeds the selected file into your graph as an IMAGE tensor. Nothing else in stock ComfyUI does that, which is why people reach for this kind of node even though it "doesn't do anything" in the generation sense.

    One thing up front: the name lies a little. "Image Gallery Loader" sounds like it pulls from some online gallery or API. It doesn't - no network calls, no key, nothing. The Local in the class name is the honest half. It browses folders on your own disk.

    How it works

    The heavy lifting is split between a DOM widget and a set of backend endpoints. The node's JavaScript builds the gallery UI and talks to ComfyUI's server via /imagegallery/get_images, which scans your input directory (top level only, no subfolders) for .png, .jpg, .jpeg, .webp, .bmp, and .tiff files. Thumbnails aren't loaded at full res - the server generates small WebP previews into a thumbnail_cache folder keyed by file path + modification time, so a folder with a thousand images stays snappy.

    Click a thumbnail and the node stores your choice (selected_image plus which folder it came from) and the backend load_image function reads the file, honors EXIF rotation, converts to RGB, and hands back a standard 1×H×W×3 float tensor in the 0–1 range. Because IS_CHANGED is keyed on file path + mtime, the graph re-runs when you pick a different image - exactly the behavior you want from a loader. Click the same thumbnail again and it deselects.

    Two extras are genuinely useful:

    • Metadata filter - the "With metadata / Without metadata" dropdown only keeps PNGs that carry ComfyUI's embedded prompt or workflow text chunks. If you save generations with their workflow baked in (the convention this whole ecosystem runs on), "With metadata" is a great way to separate your own outputs from random downloads you dumped in input.
    • Source folders - via the 📁 Folder Manager you can point the gallery at folders outside input, so you're not forced to copy reference images in. Choices persist in a custom_source_folders.json next to the node.

    The inputs and outputs that matter

    There are no inputs for you to set - the node's only inputs are hidden (selected_image, source_folder, unique_id) and the UI fills them for you. All you get is one output:

    • IMAGE - the selected image as a tensor. Wire it anywhere a Load Image output goes: into VAE Encode for img2img, into an IPAdapter or ControlNet for conditioning, or straight to a Preview/SaveImage if you're just browsing.

    If nothing is selected, or the file vanished, it doesn't error - it quietly returns a blank 64×64 black image. Handy for keeping workflows loadable; also the reason for the occasional "why is my output black" panic.

    Installing it

    Easiest path is ComfyUI Manager - search for ComfyUi-ImageGalleryLoader and hit install, then restart ComfyUI. Or do it by hand:

    cd ComfyUI/custom_nodes
    git clone https://github.com/BigStationW/ComfyUi-ImageGalleryLoader
    cd ComfyUi-ImageGalleryLoader
    ..\..\..\python_embeded\python.exe -s -m pip install -r requirements.txt
    

    Then restart. Good news on dependencies: the requirements.txt contains a single line - send2trash. Everything else (PIL, numpy, torch, aiohttp) is already in ComfyUI. There are no model downloads, no heavy wheels, nothing to hunt down.

    Where people get burned

    The big one: right-click an image and "Delete Image" deletes the actual file. With send2trash installed it goes to the recycle bin, but if it isn't (you skipped the pip step, or it failed silently), the code falls back to os.remove - permanent. The startup warning spells it out. Treat that button like the delete key, not a soft remove.

    Other friction to expect: drop a new file into input and it won't show up until you hit the 🔄 refresh - directory listings are cached for 30 seconds. The node is also big by default (roughly 550×480) and eats canvas space. And like all single-purpose packs, this one has a tiny community footprint, so don't expect a lively Discord; the GitHub repo is where you'd file issues.

    Is it a must-install? No - it's a convenience. But if you live in img2img or reference-image territory, a visual picker pays for itself within a week.

    Category🖼️ Image Gallery

    Inputs (0)

    No inputs

    Outputs (1)

    NameTypeDescription
    IMAGEIMAGE