Nodes/ComfyUI-YogurtNodes/Create Directory (Yogurt Nodes)
ComfyUI Node

Create Directory (Yogurt Nodes)

The two-wire node that quietly un-breaks your save paths

By yogurt7771·Created 2 years ago·Updated 4 days ago· 1
Create Directory (Yogurt Nodes)
    • path
    path

    This node does exactly one thing and does it well: it creates a directory. That sounds like a nothingburger until you've had a Save Image node silently fail because the folder it was writing to didn't exist yet. Create Directory (Yogurt Nodes) is the "make sure the folder is there first" step, and once you start using it you'll wonder why every save path in ComfyUI doesn't work this way.

    It's a two-wire node. You feed it a path string, it makes that folder (including any missing parents, so outputs/2026-08/try-3 creates all three levels), and it hands the same path right back to you. The path comes out of the output socket, which is the whole trick: you can chain this in front of the save nodes in the Yogurt pack (Save Image Bridge, Save Text Bridge, and friends) so the folder gets created and the exact path it used flows into the rest of the graph. One node, one job, no surprises.

    How it works

    Under the hood it's one line of Python: Path(path).mkdir(parents=True, exist_ok=True). That exist_ok=True matters - the node is idempotent. Run the workflow twice and the second run doesn't error because the folder already exists; it just passes the path through. parents=True is why it can create a whole tree at once rather than one level at a time.

    The inputs and outputs that matter

    There's just one of each, which is the entire appeal.

    • path (STRING, in and out) - the directory to create. Type the full path, or wire it from another node so the folder name derives from a seed, a date, or a prompt tag.

    Output is the same path string, so treat the node as a pass-through with a side effect: it guarantees the folder exists before whatever comes next tries to write to it.

    Installing it

    Create Directory ships as part of ComfyUI-YogurtNodes, a grab-bag pack from yogurt7771 with over 150 nodes, so you're installing the whole thing to get one small utility. Easiest route is ComfyUI Manager - search for "ComfyUI-YogurtNodes" and hit install. Or do it by hand:

    cd ComfyUI/custom_nodes
    git clone https://github.com/yogurt7771/ComfyUI-YogurtNodes.git
    cd ComfyUI-YogurtNodes
    pip install -r requirements.txt
    

    Restart ComfyUI and the nodes show up under the "Yogurt Nodes" category. No model downloads, nothing heavy - the requirements are just numpy, pillow, requests, and the API clients for the pack's LLM nodes.

    Where people get burned

    Two small gotchas. First, relative paths resolve relative to wherever the ComfyUI process was started, which is usually but not always your ComfyUI root - if a folder turns up somewhere you didn't expect, use an absolute path and stop guessing. Second, if you're on Windows, keep an eye on backslashes in the text widget; forward slashes work fine and avoid the escaping headaches. That's about it - the node is too simple to fail in interesting ways, and that's the point of it.

    CategoryYogurtNodes/IO

    Inputs (1)

    NameTypeDefaultDescription
    pathSTRING

    Outputs (1)

    NameTypeDescription
    pathSTRING