Nodes/ComfyUI-Gallery/Gallery Button
ComfyUI Node

Gallery Button

Stop Digging Through ComfyUI/output — This Button Opens a Real Gallery

By PanicTitan·Created about a year ago·Updated 2 months ago· 114
Gallery Button

      Let's get the honesty out of the way first: this node does nothing. GalleryNode has zero inputs, zero outputs, and its entire function is return (). The "Gallery Button" is a bookmark, not a computation - a little door handle you drop on your graph so you can click your way into the pack's real feature. That feature is a full-screen media gallery for everything ComfyUI saves to your output folder: images, videos, GIFs, audio, even 3D models, with metadata, search, sort, and file management. You don't need the node to use the gallery (there's a global "Open Gallery" button and a Ctrl+G shortcut), but it's a nice way to keep the door within reach of a specific workflow.

      Why you'd reach for it

      Anyone who has run ComfyUI for more than a week has stared into ComfyUI/output - a flat graveyard of ComfyUI_00001_.png files with no idea which one came from which prompt. That pain is exactly why this pack exists. The author built it in early 2025 specifically for people running ComfyUI in WSL or on a cloud box, where you can't casually open the output folder in Explorer and your PreviewImage thumbnails vanish between sessions. The gallery is your answer: it watches the output directory in real time, and every new image slides into a virtualized grid the moment it's saved - no refresh, no digging.

      The killer feature is metadata. ComfyUI embeds the whole workflow JSON into saved PNGs and JPEGs. Click a card, hit Info, and you can read the prompt, seed, and model, copy any value to your clipboard, or view the raw JSON. That turns a folder of anonymous images into a searchable record of what you actually made - and, when you find the one you love, a copy of the workflow that made it.

      How it works

      Under the hood this is a server-and-frontend project wearing a node's clothing. gallery_node.py is a stub so ComfyUI registers the pack; the real work lives in server.py, which hooks into ComfyUI's PromptServer and adds /Gallery/* routes via aiohttp. A watchdog-based file monitor watches the output folder for new files, and folder_scanner.py builds the folder tree with os.scandir. The React frontend (a prebuilt bundle in web/dist, mounted through the node's WEB_DIRECTORY) talks to that backend. It's the same pattern as any UI-centric custom node: the "node" is incidental, the pack is the product.

      The inputs and outputs that matter

      There are none, and that's deliberate. This is a utils-category node with OUTPUT_NODE = True and an empty INPUT_TYPES - nothing wires into it, nothing comes out. Don't go looking for a socket to connect. All the knobs you actually care about live in the gallery's settings panel: the Relative Path (the one you'll touch first, see below), button label and position, Ctrl+G toggle, dark mode, thumb-fit behavior, and which file extensions get scanned.

      Installing it

      No models, no heavy dependencies, no CUDA - the requirements.txt is just Pillow, aiohttp, piexif, watchdog, and asyncio. The frontend ships prebuilt, so there's nothing to compile. Easiest route:

      # or: ComfyUI Manager → Install Custom Nodes → search "ComfyUI-Gallery"
      cd ComfyUI/custom_nodes
      git clone https://github.com/PanicTitan/ComfyUI-Gallery.git
      # restart ComfyUI
      

      If Manager flags missing dependencies, let it run pip install -r requirements.txt. Then restart - the gallery won't appear until the server restarts and mounts the new routes.

      Common issues

      The big one, and the reason the Relative Path setting exists: the gallery opens but shows nothing. That was the first bug people hit in the wild - local installs couldn't auto-detect the output folder, and early versions were useless for WSL users. The fix is built in: open the gallery, go to Settings, and set Relative Path to your actual output directory. If you're on Windows in WSL, note the path is the Linux-side one ComfyUI sees, not the Windows C:\... one.

      Second: metadata shows up empty or garbled. The early metadata parser was genuinely shaky and the author rewrote it completely in v1.5 (and again for v2.0). If you're on an old version, update - that's the fix, not a workaround.

      Two smaller gotchas. Batch download of thousands of images runs client-side in your browser and can choke on very large selections - grab a few dozen at a time. And the initial scan of a huge output folder is asynchronous now, but give it a moment before you assume it's broken. One honest limitation: dragging a gallery image straight into your graph wasn't possible at launch - you copy its workflow from the metadata instead.

      Categoryutils

      Inputs (0)

      No inputs

      Outputs (0)

      No outputs