ComfyUI Node

Image Hub

LoadImage, but with a searchable dropdown and a paste button

By jjmaden·Created 27 days ago·Updated 23 days ago· 0
Image Hub
    • IMAGE
    • MASK
    folder_type
    filename
    custom_path

    ComfyUI's built-in LoadImage is fine until you have more than a handful of files, and then it's a scroll through a flat list with no way to type. Image Hub fixes that with a searchable dropdown - the same combobox style as the checkpoint and LoRA loaders - scoped to ComfyUI's input, output, or any custom folder you point it at. It also adds two buttons LoadImage will never give you: Refresh File List and Paste from Clipboard.

    That second button is the sleeper feature. You screenshot something, or copy a reference image from a browser tab, and instead of saving it to disk yourself and restarting anything, you hit Paste - the node reads your clipboard, uploads the image into ComfyUI's input folder via /upload/image, adds it to the dropdown, and selects it. It needs a secure context (HTTPS or localhost) and clipboard permission in your browser, which is ComfyUI's normal dev-server setup anyway.

    The inputs:

    • folder_type - input, output, or custom.
    • filename - the searchable dropdown, populated by scanning that folder for image files (png/jpg/jpeg/webp/bmp/gif/tif/tiff). Subfolder files show up as subfolder/name.ext.
    • custom_path - only used when folder_type is custom, and it accepts any absolute path.

    Outputs are IMAGE and MASK. The mask behavior is nicer than core: if the image has an alpha channel, the (inverted) alpha becomes the mask; otherwise you get a zero mask at the image's own width/height, rather than ComfyUI's fixed 64×64 default for images with no alpha. There's also a small thumbnail preview under the dropdown, served from a server-resized JPEG - display only, not what gets loaded into the IMAGE/MASK outputs.

    Mechanism details worth knowing. The dropdown is scanned when ComfyUI rebuilds its node schema (server start or a page reload); the Refresh button re-scans immediately through a small API route the node registers, and it always bypasses the short-lived server-side scan cache. IS_CHANGED tracks the resolved file's modification time, so editing a file on disk under the same name is picked up without a manual re-queue-all. And when folder_type is input or output, the path is checked so a ..-style filename can't escape the folder - a real security fix, since the older free-typed version could read files outside ComfyUI's directories. custom deliberately allows any absolute path.

    The migration note is the thing to remember if you have saved workflows: filename changed from a free-typed STRING to a COMBO dropdown. Old saved values still load and run, but to pick a different file, click Refresh File List first if it isn't showing.

    Install:

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

    Restart ComfyUI. This one ships a paired JS file (web/image_hub.js, loaded via WEB_DIRECTORY) that adds the two buttons and the thumbnail - that's why a restart matters. ComfyUI Manager users can search "JJMaden Random Nodes". MIT, no extra Python dependencies, no model downloads; it's a small personal pack (author jjmaden).

    The honest tradeoff: it's a loader, not a workflow transformer, so the win is ergonomics - paste a reference without touching disk, browse your output folder in a searchable list, escape the 64×64-mask annoyance. If you spend any time swapping reference images in and out, that's worth a restart.

    Categoryimage

    Inputs (3)

    NameTypeDefaultDescription
    folder_typeCOMBO3 options: input, output, custom
    filenameCOMBO1 options: example.png
    custom_pathoptSTRING

    Outputs (2)

    NameTypeDescription
    IMAGEIMAGE
    MASKMASK