Nodes/APZmedia Naming Tools/APZmedia Generate File Path
ComfyUI Node

APZmedia Generate File Path

Build a folder path ComfyUI can actually save into, without guessing slashes

By APZmedia·Created 2 years ago·Updated 5 months ago· 8
APZmedia Generate File Path
    • generated_path
    root_folder
    project_name
    episode_name
    shot_name
    pass_name
    slash_type
    toggle_root_folderInclude
    toggle_project_nameInclude
    toggle_episode_nameInclude
    toggle_shot_nameInclude
    toggle_pass_nameInclude

    The biggest complaint about ComfyUI output is that everything lands in one folder with numbered names. Save Image does let you type a folder into filename_prefix - outputs/myproject/shot01/ - but typing it by hand per workflow is exactly the kind of thing you'll screw up at the end of a long session, and hardcoding paths into shared workflows breaks them for everyone who downloads them. APZmedia Generate File Path is the APZmedia Naming Tools answer: assemble the folder path from components, toggle which ones are in, and let the node sort out the slashes.

    It's a sibling of the Standard Filename Builder, but for directories instead of file names. You get five text fields - root_folder, project_name, episode_name, shot_name, pass_name - each with an Include/Exclude dropdown, plus the one control this node has that the filename builders don't: slash_type, with Forward (/), Backslash (\), and Auto. The output is a single STRING called generated_path.

    How it works: the node joins only the included, non-empty components, then normalizes the separators according to your slash_type choice. Two things are worth knowing from the source. First, empty fields are skipped the same way as the filename builders, so you never get // where a component was left blank. Second, the Auto setting effectively produces forward slashes on every platform - useful because ComfyUI's Save Image treats forward slashes as subfolder separators cross-platform. If you genuinely need backslashes (say, you're handing the path to something Windows-only downstream), pick Backslash explicitly instead of assuming Auto will do it.

    The natural wiring: generated_path → the filename_prefix of Save Image, which will create the folders on write. Or feed it into a node that needs a full directory before you append a filename built by one of the naming nodes. Because every segment is free text, you can drive them from anything - a project name widget, a shot from APZmediaCycleInt, a version you bump per run - and your outputs start organizing themselves into a tree instead of a single dumping ground.

    Same caveats as the rest of the pack: this node assembles paths, it doesn't sanitize them. Spaces and odd characters in components go straight through, so if a component could contain something a filesystem objects to, run the pieces through the Clean File Name Node first (and note that the slash normalization only happens between components - a slash typed inside a component will survive, so keep components clean).

    Install

    ComfyUI Manager → search "APZmedia Naming Tools". Or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/APZmedia/ComfyUI-APZmedia-cleanName-from-string
    cd ComfyUI-APZmedia-cleanName-from-string
    pip install -e .
    

    Restart ComfyUI and the node appears under APZmedia. No models, no downloads, single tiny dependency (unidecode) that this node barely uses. This is the one I reach for when a workflow is about to start generating hundreds of files I need to find again.

    CategoryAPZmedia

    Inputs (11)

    NameTypeDefaultDescription
    root_folderSTRING
    project_nameSTRING
    episode_nameSTRING
    shot_nameSTRING
    pass_nameSTRING
    slash_typeCOMBO3 options: Forward (/), Backslash (\), Auto
    toggle_root_folderCOMBOInclude2 options: Include, Exclude
    toggle_project_nameCOMBOInclude2 options: Include, Exclude
    toggle_episode_nameCOMBOInclude2 options: Include, Exclude
    toggle_shot_nameCOMBOInclude2 options: Include, Exclude
    toggle_pass_nameCOMBOInclude2 options: Include, Exclude

    Outputs (1)

    NameTypeDescription
    generated_pathSTRING