Nodes/TrentNodes/Custom Filename Generator
ComfyUI Node

Custom Filename Generator

Stop Hand-Typing PROJ_SEQ_SHOT_Version Filenames

By TrentHunter82·Created 9 months ago·Updated 4 days ago· 36
Custom Filename Generator
    • filename
    projectPROJ
    sequenceSEQ
    shotSHOT
    departmentDEPT
    workflowWORKFLOW
    pass_namePASS
    initialsAB
    versionv001
    separator_
    force_uppercasetrue

    Any pipeline that produces files for a real project eventually collides with the filename question. You can dump everything into ComfyUI/output/ with the default random names, but then finding "the beauty pass for shot 004, v3" is archaeology. Custom Filename Generator exists so your files come out of the graph already named like a production: PROJ_SEQ_SHOT_DEPARTMENT_WORKFLOW_PASS_INITIALS_VERSION.

    That format is straight out of studio conventions - the standard project_sequence_shot_department_workflow_pass_artist_version naming that VFX and animation houses use so a filename alone tells you what, where, and who. If you've ever wanted that without a spreadsheet, this is the node.

    How it works

    Eight required fields, each a plain string: project, sequence, shot, department, workflow, pass_name, initials, and version. They get joined in that fixed order by separator (default _), and by default force_uppercase runs the whole thing through .upper(), so project="myfilm" comes out as MYFILM. Turn that off if you want case preserved.

    The fields are literal by design - there's no timestamp variable, no counter magic. This is a naming template, and the variables are you: each one gets its value from a widget (or, if you convert a widget to an input, from another node like the pack's Number Counter or a workflow value node). The classic setup: convert version to an input, feed it a counter, and every run stamps out a fresh v001, v002, v003… while everything else stays fixed.

    One filename output, a single STRING. Wire it anywhere a filename is wanted: a Save Image node's filename prefix, a text-file writer, or a metadata field. Because the node is just string concatenation, it has zero dependencies and zero side effects - it's about as safe a utility as ComfyUI has.

    Honest take: for a solo hobbyist this is optional polish. For anyone who has ever shipped deliverables, hunted for the right render, or handed files to a collaborator with a naming convention, it's the difference between chaos and a folder you can actually search. It's also a great little pattern for learning why utility nodes exist in the first place: one source of truth for a value that would otherwise be typed, inconsistently, in ten places.

    Install

    Search "Trent Nodes" in ComfyUI Manager, or:

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

    Pure Python, no models, nothing heavy. Restart ComfyUI after installing. (The author has flagged Manager install issues on this pack from an early repo rename; the manual clone always works.)

    Common issues

    • Everything came out UPPERCASE and you didn't want it. That's force_uppercase defaulting to true. Flip it.
    • Filename is empty or wrong. Every field is required - a blank project propagates as an empty segment. You'll get a leading or doubled separator (_SEQ_...) rather than an error.
    • Versions don't auto-increment. Nothing here counts on its own. Wire the version input (convert the widget to an input) from the pack's Number Counter if you want per-run versioning.

    For consistent, searchable, self-describing filenames, this is the one. Set it once, wire the version counter once, and let the graph name your files forever after.

    CategoryTrent/Utilities

    Inputs (10)

    NameTypeDefaultDescription
    projectSTRINGPROJ
    sequenceSTRINGSEQ
    shotSTRINGSHOT
    departmentSTRINGDEPT
    workflowSTRINGWORKFLOW
    pass_nameSTRINGPASS
    initialsSTRINGAB
    versionSTRINGv001
    separatoroptSTRING_
    force_uppercaseoptBOOLEANtrue

    Outputs (1)

    NameTypeDescription
    filenameSTRING