ComfyUI Node

input dir

Stop hardcoding the ComfyUI input folder path

By StableLlama·Created about a year ago·Updated 4 days ago· 48
input dir
    • input_path

    Basic data handling: PathInputDir ("input dir") does one deceptively boring thing: it returns the absolute path of ComfyUI's input directory. No inputs, one STRING output. Boring is the point - it's the node you use instead of typing C:\ComfyUI\input into a path widget and praying your install matches.

    ComfyUI's input folder is where the core Load Image node looks for images (that dropdown is populated from it). If you're building a workflow that reads from or writes to that folder - and you're using this pack's path nodes instead of the built-in loaders - you need the actual path. Hardcoding it makes the workflow brittle: move your ComfyUI install, rename the folder, share the workflow with a friend on Linux, and your absolute path is now wrong. PathInputDir asks ComfyUI itself where the input folder is and returns the correct answer for this install.

    How it works

    The node calls ComfyUI's own folder_paths.get_input_directory() - the same internal API the built-in loaders use to find the input folder. That's the important part: it's not a hardcoded default and it's not the working directory; it's ComfyUI's registered, configurable input path (changeable via extra_model_paths.yaml). So the node gives you the path the rest of ComfyUI actually agrees on, no matter where you installed it or how you launched it.

    Combine it with PathJoin and you've got a fully portable "load from the input folder" that beats a typed path in every way:

    PathInputDir ──> PathJoin ──> PathLoadImageRGB
                              (path2 = "my_ref.png")
    

    Inputs and outputs

    • No inputs.
    • input_path (STRING) - absolute path to ComfyUI's input directory. It has a trailing layout detail: it returns whatever folder_paths returns, so treat it as a base to join onto rather than slicing it yourself.

    Installing it

    Ships in Basic data handling, the no-dependency pack. ComfyUI Manager → search "Basic data handling" → install → restart, or manually:

    cd ComfyUI/custom_nodes
    git clone https://github.com/StableLlama/ComfyUI-basic_data_handling
    

    Restart after. No models, no pip installs - the pack's whole pitch is that it runs on the Python stdlib and whatever ComfyUI already ships.

    Gotchas

    The main trap is conceptual: this returns the input directory, not cwd and not the output directory. If your save workflow needs the output folder, this pack has a matching PathOutputDir node for exactly that. And since the value depends on ComfyUI's config, it can change between machines - which is precisely why you'd use this node instead of typing the path. For anyone who shares workflows or runs the same graph on a desktop and a laptop, it's one of those tiny nodes that quietly prevents a whole class of "works here, not there" pain.

    CategoryBasic/Path

    Inputs (0)

    No inputs

    Outputs (1)

    NameTypeDescription
    input_pathSTRING