Nodes/AUN ComfyUI Nodes/Path Filename V2
ComfyUI Node

Path Filename V2

The filename builder you'll actually want for new workflows

By loz2754·Created 8 months ago·Updated about 24 hours ago· 5
Path Filename V2
    • path_filename
    • date_format
    MainFolderMain
    Date_Subfoldertrue
    Subfolder_A
    Subfolder_B
    manual_nameName
    name_modetrue
    Datetrue
    prefix_1
    prefix_2
    Modelfalse
    Samplertrue
    Schedulertrue
    Seedtrue
    Stepstrue
    CFGtrue
    Labels
    suffix_1
    suffix_2
    delimiter
    max_num_words1
    date_format
    batch_size1
    auto_nameName

    If you generate images in ComfyUI more than twice a week, you've already lost files to ComfyUI_00001_.png. Path Filename V2 is the AUN pack's recommended cure: one node that turns your model name, seed, CFG, steps, date, and a few free-text parts into a sensible, consistent filename - and it's the piece the whole AUN "V2" save pipeline is built around. If you're starting a new workflow, this is the one to use.

    What changed vs the legacy node

    The headline: it outputs one combined path_filename string instead of separate path and filename wires. One wire, no sync problems, and it plugs straight into AUN Save Image V2 (the node the README pairs it with). It also returns date_format as a second output, which the V2 saver needs to keep the dated subfolder logic consistent.

    The other big addition is real naming modes. Where the legacy node just had a name field, V2 has:

    • name_mode - Manual uses your manual_name; Auto uses auto_name (an optional input you can wire from a prompt or label node).
    • max_num_words - when Auto, crops auto_name to this many words. Set 0 for no limit. This is where AUN NameCrop's job gets absorbed for free.

    The rest of the inputs

    The familiar assembly stays: MainFolder (root), Date_Subfolder (now keyed to the date_format enum - the format you pick drives the subfolder name), Subfolder_A/Subfolder_B, prefix_1/prefix_2, suffix_1/suffix_2, Labels, and delimiter for joining parts. The token toggles are back too - Model (%model_short%), Sampler (%sampler_name%), Scheduler, Seed (seed_%seed%), Steps (steps_%steps%), CFG (CFG_%cfg%), Date (%date%) - and an optional batch_size for savers. Note the syntax: canonical AUN placeholders are now %token% (with percent signs both sides), and savers still accept the legacy %token form for backward compatibility.

    How you'd set one up

    Say you want 2026-08-16/portfolio/portrait_juggernautXL_seed_1234_cfg_7_steps_30.png. Set MainFolder to outputs/portfolio, Date_Subfolder on, name_mode to Manual with manual_name = portrait, switch on Model, Seed, CFG, Steps, and the delimiter to _. Wire path_filename into AUN Save Image V2 and you're done. The same node also feeds AUN Filename Resolver Preview V2 if you'd rather save with ComfyUI's stock Save Image node - that resolver converts the combined string back to resolved path + filename for the standard saver.

    Install

    It's part of AUN ComfyUI Nodes (loz2754):

    cd ComfyUI/custom_nodes
    git clone https://github.com/loz2754/AUN-ComfyUI-Nodes
    

    or ComfyUI Manager → search "AUN ComfyUI Nodes" → install → restart. Deps (piexif, opencv-python-headless, imageio-ffmpeg, requests) come via Manager; nothing to download manually.

    The honest caveats

    Long MainFolder + long filename still hits Windows path limits - keep both modest. And a placeholder that comes out unresolved (a literal %model_short% in a filename) almost always means the string was consumed by something that doesn't know AUN's token syntax, so check the saver, not the builder. But for the 95% case - want a real filename, wired in two connections - this is the node the pack wants you to reach for.

    CategoryAUN Nodes/File Management

    Inputs (23)

    NameTypeDefaultDescription
    MainFolderSTRINGMainThe root output folder.
    Date_SubfolderBOOLEANtrueIf on, creates a subfolder using the selected date_format.
    Subfolder_ASTRINGFirst level of custom subfolders. Add more levels by adding a / between them.
    Subfolder_BSTRINGSecond level of custom subfolders.
    manual_nameSTRINGNameManual base name used when Name Mode is Manual.
    name_modeBOOLEANtrueManual uses manual_name. Auto uses auto_name.
    DateBOOLEANtrueInclude the date placeholder (%date%) in the filename.
    prefix_1STRINGFirst custom prefix for the filename.
    prefix_2STRINGSecond custom prefix for the filename.
    ModelBOOLEANfalseInclude model placeholder (%model_short%) in the filename.
    SamplerBOOLEANtrueInclude sampler placeholder (%sampler_name%) in the filename.
    SchedulerBOOLEANtrueInclude scheduler placeholder (%scheduler%) in the filename.
    SeedBOOLEANtrueInclude the seed placeholder as seed_%seed% in the filename.
    StepsBOOLEANtrueInclude the steps placeholder as steps_%steps% in the filename.
    CFGBOOLEANtrueInclude the CFG placeholder as CFG_%cfg% in the filename.
    LabelsSTRINGAdditional labels to include in the filename.
    suffix_1STRINGFirst custom suffix for the filename.
    suffix_2STRINGSecond custom suffix for the filename.
    delimiterSTRING The character used to separate parts of the filename.
    max_num_wordsINT10–32Maximum number of words to keep from auto_name. Set to 0 for no limit.
    date_formatCOMBODate format used for the dated subfolder output when Date_Subfolder is enabled.
    batch_sizeoptINT11–1000The batch size for the output.
    auto_nameoptSTRINGNameAuto mode base name source. Cropped using max_num_words.

    Outputs (2)

    NameTypeDescription
    path_filenameSTRING
    date_formatSTRING