Nodes/ComfyUI-ZMongo/06 Document File Browser
ComfyUI Node

06 Document File Browser

Browse your disk from inside ComfyUI and hand files to your workflow

By CentralFloridaAttorney·Created 5 months ago·Updated 2 months ago· 1
06 Document File Browser
    • file_path
    • file_path_link
    • filename
    • filename_link
    • content_type
    • size_bytes
    • exists
    • browser_root
    • refresh
    • file_paths
    • filenames
    • indexed_file_paths
    • discovered_count
    • status
    • selectable_items
    • indexed_items
    • item_count
    root_modeDocuments
    selected_file
    manual_path
    custom_root
    recursivetrue
    extensions.pdf,.docx,.txt,.md,.csv,.json,.log,.rtf
    search_text
    max_results500
    max_depth6
    include_hiddenfalse
    refresh_token

    Every document pipeline starts the same way: you have files on disk and you need to get their paths into the graph. "06 Document File Browser" is the node that does that - it scans a folder on the machine running ComfyUI, filters by extension and name, and hands you a path (plus a whole batch of them as a list) ready for Ingest, Upload, or anything else that wants a file_path_link. The display name says "File Browser" and it's exactly that, but the useful part is that it's batch-aware: it's built to feed streaming pipelines, not just one file at a time.

    How it works

    Pick a root_mode from the dropdown: Documents, Comfy Input (the standard input folder), Home, Current Working Directory, Filesystem Root, or Custom Root (where you fill in custom_root). Then:

    • recursive (default true) - descend into subfolders
    • extensions (default .pdf,.docx,.txt,.md,.csv,.json,.log,.rtf) - comma/space-separated; * means all files
    • search_text - optional case-insensitive filename/path filter
    • max_results (default 500, up to 10k) and max_depth (default 6, up to 25) - cap the scan so you don't walk your whole home directory
    • include_hidden (default false) - the scanner also skips .git, node_modules, venv-style dirs, and system folders out of the box, which keeps scans sane

    The single-file outputs - file_path, filename, content_type, size_bytes, exists, browser_root - describe the currently selected file (use selected_file dropdown or manual_path to pick it). But for pipelines, the list outputs are the real deal: file_paths and filenames as lists, discovered_count, indexed_file_paths (numbered), plus the standard selectable tail. And there are typed links - file_path_link and filename_link - which are what you wire into "06 Ingest Text PDF / DOCX" or "06 Upload Document File" so the file travels around the graph with its identity intact.

    Install

    cd ComfyUI/custom_nodes
    git clone https://github.com/CentralFloridaAttorney/ComfyUI-ZMongo
    

    Restart ComfyUI, or install "ComfyUI-ZMongo" via ComfyUI Manager. The README's minimal deps (pymupdf, python-docx, requests, python-dotenv) cover this node; the heavier requirements.txt extras are only needed if you use the embedding/agent features.

    Where people get burned

    The single biggest confusion: paths are resolved on the ComfyUI machine, not your browser. If ComfyUI runs on a remote box and you browse your laptop's files, the node won't find them. The error payloads hammer this point for a reason - "must exist on the machine running ComfyUI."

    Second, a directory is not a file. This node's file_path outputs point at files (or the browser root when nothing's selected). If you wire browser_root into an Upload or Ingest node expecting it to "just handle the folder," you'll get a clean "that's a directory" rejection. Select a real file.

    And third: with recursive on and a big tree, you can hit max_results (500) quickly and think the scan found nothing weird - you just hit the cap. Raise it or narrow extensions/search_text. Watch discovered_count and you'll see it coming.

    CategoryZMongo/03 Documents

    Inputs (11)

    NameTypeDefaultDescription
    root_modeCOMBODocuments6 options: Documents, Comfy Input, Home, Current Working Directory, Filesystem Root, Custom Root
    selected_fileCOMBO1 options:
    manual_pathSTRING
    custom_rootSTRING
    recursiveBOOLEANtrue
    extensionsSTRING.pdf,.docx,.txt,.md,.csv,.json,.log,.rtfComma/space-separated extensions. Use * for all files.
    search_textSTRINGOptional case-insensitive filename/path filter.
    max_resultsINT5001–10000
    max_depthINT60–25
    include_hiddenBOOLEANfalse
    refresh_tokenoptSTRING

    Outputs (17)

    NameTypeDescription
    file_pathSTRING
    file_path_linkZMONGO_FILE_PATH
    filenameSTRING
    filename_linkZMONGO_FILENAME
    content_typeSTRING
    size_bytesINT
    existsBOOLEAN
    browser_rootSTRING
    refreshSTRING
    file_paths*
    filenames*
    indexed_file_pathsSTRING
    discovered_countINT
    statusSTRING
    selectable_items*
    indexed_itemsSTRING
    item_countINT