Nodes/ComfyUI-GadgetNodes/Select Input Folder
ComfyUI Node

Select Input Folder

Pick an input subfolder from a dropdown and get its path as a string

By 2daadv·Created 6 months ago·Updated 21 days ago· 1
Select Input Folder
    • folder
    folder
    with_base_pathtrue

    ComfyUI's input/ directory is where images you upload or drop end up. Once it fills up, you probably organize it into subfolders - and then every batch node that wants "the folder" makes you type a path, retype it, and typo it. Select Input Folder is the node that turns that chore into a dropdown: choose a folder, get its path out as a string, wire it wherever a path is needed.

    It's the smallest kind of plumbing node - the kind the ecosystem doc would file under "one source, many consumers." The string it produces is just a path; it does no reading, no listing, no file access of its own.

    How it works

    The input is a dropdown (folder) that the node builds from the actual subfolders ComfyUI knows about under input/, plus a "." entry for the input root itself. There's also a boolean toggle, with_base_path.

    The output logic is dead simple from the source: if with_base_path is on (the default), the output is input/<folder> - e.g. input/characters - which is the form ComfyUI's own folder-aware nodes expect. If you turn it off, you get just <folder>, a bare relative path.

    Why would you turn it off? Because some downstream nodes take a path relative to ComfyUI's base and already assume input/, or because you're handing the value to something that wants only the folder name. When in doubt, leave it on.

    Inputs and outputs

    • folder - dropdown of input/ subfolders (plus .).
    • with_base_path - boolean, default true.
    • Output: folder, a STRING path.

    That's everything. It plugs naturally into this pack's Load Images From Folder (which takes a folder path and regex-filters images) - pick the folder once here, fan the string out to the loader and to anything else that needs the same path. A classic single-source-of-truth wiring.

    Install

    Standard for this pack - ComfyUI Manager (search "ComfyUI-GadgetNodes"), or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/2daadv/ComfyUI-GadgetNodes.git
    pip install -r ComfyUI-GadgetNodes/requirements.txt
    

    Restart; it lives under Gadget/core.

    The honest caveats

    • The list is a snapshot. The dropdown is populated when the node is created, so if you add a subfolder while ComfyUI is running, you'll need a new node or a restart to see it. Annoying, but every ComfyUI enum-with-filesystem node behaves this way.
    • It's relative, not absolute. The output is a ComfyUI-relative path, not a full filesystem path. Nodes that want an absolute OS path (some external tools) will need the base path glued on yourself.
    • No validation. Nothing checks the folder still exists at runtime. If you rename the folder mid-workflow, the string still outputs the old name and the downstream node is the one that fails.

    A one-trick node, but the trick is one you'll use constantly once you batch-process folders. It's not glamorous, it won't make your images prettier - it just saves you from retyping input/cats/v3_final_2 for the sixth time.

    CategoryGadget/core

    Inputs (2)

    NameTypeDefaultDescription
    folderCOMBO2 options: ., 3d
    with_base_pathBOOLEANtrue

    Outputs (1)

    NameTypeDescription
    folderSTRING