Nodes/comfyui-ap-tools/AP Image File Path
ComfyUI Node

AP Image File Path

A filename builder so you stop fat-fingering paths

By Snoopick·Created 5 months ago·Updated 4 months ago· 0
AP Image File Path
    • full_path
    file_nameimage
    file_path

    AP Image File Path is a glorified string joiner, and that's fine - most of ComfyUI's "plumbing" layer is. It takes a file name and a base path, glues them together, and hands you a STRING you can wire anywhere a filename is expected. The genuinely useful part is the template manager: save your common output folders once, pick them from a dropdown, and every node that writes a file gets the same consistent path without you retyping E:\projects\characters\2026\v3 a hundred times.

    The obvious target is ComfyUI's SaveImage node - the README's own tip is to feed the full_path output into filename_prefix. Since a ComfyUI PNG carries its whole workflow in its metadata, keeping your output organized matters more than it sounds; a stable path convention is what lets you actually find the file behind the preview you're looking at. It also plays nice with any custom node that takes a filename string, which is a lot of them.

    How it works

    The Python side is two lines of real work: it joins file_path and file_name with os.path.join, then swaps every / for \ to force Windows-style output. That's it - no existence checks, no folder creation, no validation. The intelligence lives in the frontend. The file_path field is a hidden widget that the UI fills in when you pick a template; a dropdown lists saved templates, there's a text box to create a new one, and a delete button. Templates are stored server-side in a templates.json file in the pack's folder through small API endpoints (GET/POST/DELETE /ap-tools/templates), so they survive across workflows and reloads. Your selected template is remembered per-node in node properties.

    Inputs and outputs

    Two inputs, one output:

    • file_name (STRING, default image) - the filename without an extension. That's the author's own tooltip: name without extension, e.g. portrait_01.
    • file_path (STRING, default empty) - the base path, like Test\Lora. Normally you don't type this at all; the template dropdown manages it.
    • full_path (STRING) - the assembled path, backslashes included. Wire it to filename_prefix or any string input.

    The one real gotcha

    Only Windows path style is supported. The backslashes are literal characters, not separators, on Linux and macOS - a full_path of Test\Lora\image will not be interpreted as subfolders by a save node on those systems; you'd get a file whose name happens to contain backslashes. On Windows it's exactly what you expect. Also remember the node never creates directories - it builds a string, so the folder your path points at needs to exist (or be created by whatever consumes the string).

    Install

    In ComfyUI Manager, search "ap-tools", install, restart. Or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/Snoopick/comfyui-ap-tools
    

    Restart and it's under the ap-tools category. No models, no Python deps beyond stock ComfyUI.

    If you only save a handful of files a week, typing paths manually is fine and this is unnecessary. If you iterate on hundreds of images across a few output folders, the template manager saves real time and real typos. It's a small convenience node - priced accordingly.

    Categoryap-tools

    Inputs (2)

    NameTypeDefaultDescription
    file_nameSTRINGimageИмя файла без расширения
    file_pathSTRINGПуть (например, Test\Lora)

    Outputs (1)

    NameTypeDescription
    full_pathSTRING