Nodes/ComfyUI-KikoTools/Project File Path
ComfyUI Node

Project File Path

The One-Node Fix for an Output Folder Full of ComfyUI_00047_.png

By ComfyAssetsΒ·Created about a year agoΒ·Updated about 16 hours agoΒ· 20
Project File Path
    • STRING
    β—„rootβ–Ί
    β—„project_nameMyProjectβ–Ί
    β—„subfolderimagesβ–Ί
    β—„filenameimageβ–Ί
    β—„date_folderfalseβ–Ί
    β—„separatorautoβ–Ί

    Every workflow you've ever built has been quietly stuffing files into the same folder. ComfyUI/output/ fills up with ComfyUI_00001_.png, ComfyUI_00002_.png, and by the time you've done three client projects and a face-swap experiment you're scrolling through four months of renders trying to find the good one. It's the least glamorous problem in ComfyUI, and it bites at 11pm when you actually need to hand files to someone.

    Project File Path is the boring, correct fix: a node that outputs one string - a save prefix - and nothing else.

    Why a whole node for a folder name

    Because typing it by hand, everywhere, is where it goes wrong. The point is the same one behind every plumbing node: kill repetition so the graph has one authoritative source for a value - and this one keeps working when everything around it churns, since path handling isn't tied to whichever model shipped this week.

    The output lands in SaveImage.filename_prefix, and that prefix isn't just a name - it's a mini template language that already takes a slash for subfolders and even %date:yyyy-MM-dd%. So if all you want is today's date on your files, you don't need this node. What you get here is the structured version: project name, optional date folder, nested subfolders, and a sanitiser.

    What it actually builds

    Four required fields, two optional ones, one output. The output socket is labelled plain STRING (no custom name, same as the djz-nodes node this is based on), and it takes no image or latent input - it's pure string assembly that runs before anything renders.

    • root - an optional top folder inside output/. Leave it empty and it's skipped entirely, which is the right default.
    • project_name - defaults to MyProject. This is the folder that actually groups your work.
    • subfolder - defaults to images; the tooltip is explicit that a/b gives you nested folders.
    • filename - defaults to image. Known extensions (.png, .mp4, .wav, …) are stripped, so image.png and image are the same thing. render_v1.5 survives intact, since .5 isn't on the extension list.
    • date_folder - off by default. Turn it on and you get a YYYY-MM-DD folder after the project name.
    • separator - auto, forward_slash, or backslash.

    So with defaults you get MyProject/images/image, and with the date folder on, MyProject/2026-10-14/images/image. Wire that string into filename_prefix on Save Image, Kiko Save Image, or a video combine node, and Save Image appends its own counter suffix like it always does - the files land as MyProject/images/image_00001_.png.

    The mechanism, and why it's safer than it looks

    Everything gets sanitised before it's joined. Characters that are illegal on Windows (< > : " | ? * and control codes) are deleted, spaces become underscores, leading and trailing dots and spaces are trimmed, and any .. or . segment is dropped outright. That last part matters: ../.. as a project name can't climb out of output/, and C:\x loses its colon. It's a deliberate containment guarantee, not a coincidence of string-munging - worth caring about if you ever wire another node's text into project_name.

    date_folder also has a nice trick. The node implements IS_CHANGED to return today's date only when the date folder is enabled, which invalidates its cache at midnight. Toggle it off and it returns a constant and caches normally. That's the author thinking about the real failure case: a workflow left open overnight quietly writing into yesterday's folder.

    Install

    ComfyUI Manager is the easy road - search ComfyUI-KikoTools, install, restart. Manually:

    cd ComfyUI/custom_nodes
    git clone https://github.com/ComfyAssets/ComfyUI-KikoTools
    

    Then restart. The README tells you to run pip install -r requirements-dev.txt after cloning; don't. That file is pytest, black, flake8 and mypy - the runtime requirements.txt in the repo contains exactly one line, google-genai, and it's only needed by the Gemini prompt node. This node's dependency list is nothing. It shows up under Add Node β†’ ComfyAssets β†’ Utils.

    Where people get burned

    An empty filename is a hard error. If filename cleans down to nothing - you passed .png, or ///, or a string of only illegal characters - the node raises rather than handing you a broken path. The error text tells you it's the filename, which is at least honest.

    Backslash is for Windows. On Linux or macOS, \ isn't a path separator, it's just a character, so choosing backslash won't nest your folders the way forward slashes do. Leave it on auto unless your ComfyUI is genuinely running on Windows.

    The kikotools/essentials pairing. Half this pack is a maintained fork of cubiq's comfyui-essentials-nodes, and older threads show people hitting node conflicts after installing both. If you already run ComfyUI_essentials and start seeing duplicate or conflicting node errors, that overlap is the first place to look. The Project File Path node itself is unrelated to that lineage, so if that's all you're here for, install in peace.

    Category🫢 ComfyAssets/πŸ› οΈ Utils

    Inputs (6)

    NameTypeDefaultDescription
    rootSTRINGOptional top folder inside the output folder
    project_nameSTRINGMyProjectβ€”
    subfolderSTRINGimagesUse a/b for nested folders
    filenameSTRINGimageFile extensions like .png are removed
    date_folderoptBOOLEANfalseInsert a YYYY-MM-DD folder after the project
    separatoroptCOMBOauto3 options: auto, forward_slash, backslash

    Outputs (1)

    NameTypeDescription
    STRINGSTRINGβ€”