Nodes/honda-nodes/πŸ“‚ Create Directory
ComfyUI Node

πŸ“‚ Create Directory

The node that quietly doesn't run

By AvarayΒ·Created 14 days agoΒ·Updated 12 days agoΒ· 0
πŸ“‚ Create Directory
    • Path
    β—„pathβ–Ί

    A one-line node with a real gotcha

    Create Directory takes an absolute path and makes it, parents included. That's os.makedirs(path, exist_ok=True) in a trench coat; if the folder already exists, nothing happens and nothing complains. You use it at the head of an output pipeline: generate a dated run folder, then save into it, then move things around inside it.

    The gotcha is not in the node, it's in ComfyUI's execution model, and it's worth the first paragraph because it wastes people's afternoons: this node is not an output node, so ComfyUI will not run it unless something downstream needs its result. Drop a Create Directory on the canvas, hit Queue, and if its Path output goes nowhere, no folder appears - and no error appears either. The engine evaluates backwards from output nodes (Save Image, Preview, and anything else marked as an output), so a node with no consumer is simply not part of the job.

    How it works

    Strip the path, and if it's non-empty, makedirs it with exist_ok=True. Then emit the same path as a STRING so the next node can use it.

    Two consequences of that brevity. First, an empty path is a silent no-op - the node returns an empty string, creates nothing, and doesn't warn you. If your folder isn't appearing and the path field is blank, that's your answer. Second, relative paths are relative to ComfyUI's working directory, not to your workflow file. outputs/run7 will land wherever the ComfyUI process thinks it is, which for the portable Windows build is the ComfyUI folder and for a Linux service might be /. Use absolute paths; the tooltip asks for absolute paths for exactly this reason.

    There's no recursion question to answer, no permission handling, no error surface. A path you can't write to (a protected directory, a missing mount) raises the ordinary Python exception, which lands in the ComfyUI console rather than in a friendly node error.

    Inputs and output

    Path is a STRING you type - no socket required, which makes this one of the few nodes in the pack you can drive by hand. It is also fine to connect it: paths from πŸ“‚ Directory or πŸ“‚ Path Join arrive as STRINGs and slot straight in, which is the intended pattern for building dated or per-run folders without retyping.

    The single output, Path (STRING), is the point of the thing. Chain it into πŸ“‚ List Files to enumerate what's there, into the pack's save node as the destination, or into πŸ“‚ Move File / πŸ“‚ Delete File later in the graph. Because the output is a plain string, everything in the pack's file-system group can consume it.

    Install

    Manager: Extensions β†’ Node Pack β†’ search "Honda Nodes" β†’ Install β†’ restart. Or:

    cd ComfyUI/custom_nodes
    git clone --depth 1 https://github.com/Avaray/honda-nodes.git
    cd honda-nodes
    python install.py     # ComfyUI's python; portable Windows: ..\..\..\python_embeded\python.exe install.py
    

    Filesystem nodes in this pack are pure Python - no binaries. The install.py step exists because the JSON nodes need jq and the metadata nodes need ime; run it once and you don't have to think about it again. ComfyUI 0.38.0+ is required, since the pack is written entirely against the V3 schema.

    Common issues

    No folder appears. Two candidates: the node never executed (no downstream consumer - give Path to literally anything that runs), or the path field is empty (silent no-op).

    "Permission denied" in the console. The ComfyUI process can't write there. On Windows this is often a folder under C:\Program Files; in Docker it's a volume that isn't mounted. This node doesn't create anything outside what the OS allows, and it doesn't do a pre-flight check to tell you nicely.

    The folder is created somewhere unexpected. Relative path. It resolved against the process's working directory. Check the console for the resolved path by wiring Path into πŸ› οΈ Print to Console - a two-node trick that resolves most "where did it go" questions in this whole group.

    It runs on every queue. Correct, and usually harmless. There's no cache trick to skip it because makedirs(exist_ok=True) is cheaper than deciding whether to run it.

    Category⚑️ Honda Nodes/πŸ“‚ File System

    Inputs (1)

    NameTypeDefaultDescription
    pathSTRINGAbsolute path to the directory to create.

    Outputs (1)

    NameTypeDescription
    PathSTRINGβ€”