Nodes/comfyui-flower-tools/🌸Flower File Name Combination
ComfyUI Node

🌸Flower File Name Combination

Timestamped, sanitized output filenames without the regex rabbit hole

By weichenglin0215·Created 8 months ago·Updated 2 months ago· 0
🌸Flower File Name Combination
    • FullNameOut
    • PathNameOut
    • FileNameOut
    ◄MainFolderNameWildcardsTest/Z-Image-Turbo►
    ◄SubFolderNameArtStyle_Test►
    ◄same_as_subfoldertrue►
    ◄FileNameArtStyle_Test►
    ◄SuffixTake2►
    ◄DATE_format%Y-%m-%d►
    ◄TIME_format%H-%M-%S►
    ◄DATETIME_format%Y%m%d-%H%M%S►
    ◄FullNameFormat%MainFolderName/%DATE-%SubFolderName/%FileName-%DATETIME-%Suffix►
    ◄PathNameFormat%MainFolderName/%DATE-%SubFolderName/►
    ◄FileNameFormat%FileName-%DATETIME-%Suffix►

    ComfyUI's default SaveImage names files ComfyUI_00001_.png forever unless you babysit the filename_prefix widget. Flower File Name Combination is the pack's answer: a dedicated filename builder that assembles a full path and a filename from template tokens, stamps in the current date and time, and strips illegal characters so the save never fails on a ? or | that snuck into your prompt.

    It won't make your files prettier to look at - it makes them findable. If you batch-generate for days, "which run produced this?" becomes a filename question, and this node bakes the answer in.

    The tokens

    Every format field is a template that accepts these tokens, all self-explanatory:

    • %MainFolderName, %SubFolderName, %FileName, %Suffix
    • %DATE (formatted per DATE_format), %TIME (per TIME_format), %DATETIME (per DATETIME_format)

    The defaults are sane: FullNameFormat gives you %MainFolderName/%DATE-%SubFolderName/%FileName-%DATETIME-%Suffix, which resolves to something like outputs/2026-08-28-RunA/job_20260828-143022_Take2. Date/time formats are standard strftime strings, so %Y-%m-%d becomes 2026-08-28 - change them if you want a different order or a custom clock format.

    The three outputs

    • FullNameOut - the complete path+filename, backslashes normalized to forward slashes, illegal chars removed, // collapsed.
    • PathNameOut - just the directory portion (keeps its trailing slash).
    • FileNameOut - just the filename, no path separators, no illegal chars.

    The division is the useful part: you can save with FullNameOut, or build a custom save path by wiring PathNameOut and FileNameOut separately into a save node that takes them as distinct inputs (the pack's own recommended pattern feeds the fileName output of Flower Audio Merge into the FileName slot here).

    The checkbox that saves you typing

    same_as_subfolder (default on) makes the filename follow the SubFolderName instead of the separate FileName field. If your convention is "one folder per project, file named after the project," you type the name once instead of twice. Leave it off when the file genuinely needs a different name than its folder.

    How the timestamps stay fresh

    The node's IS_CHANGED returns the current time, so ComfyUI re-runs it every execution and the date/time tokens update - which is what you want for a filename, but it does mean the node is always "dirty" and defeats caching for anything behind it. Keep it close to the save node and don't hang heavy computation downstream of it.

    Install

    Same pack, same drill:

    cd ComfyUI/custom_nodes
    git clone https://github.com/weichenglin0215/comfyui-flower-tools.git
    

    Restart, or use ComfyUI Manager → search ComfyUI Flower Tools. No models, no downloads.

    Gotchas

    • Windows drive letters survive, everything else colons are removed - C: is preserved, but a stray : elsewhere in the name is dropped. By design, but surprising on first use.
    • It's a string builder, not a saver - you still wire the outputs into an actual save node. It just makes the naming deterministic.
    • The note parameter the source mentions is a leftover; the field isn't exposed in the current UI schema, so don't go hunting for a notes box that won't be there.
    Categoryflower-tools

    Inputs (11)

    NameTypeDefaultDescription
    MainFolderNameSTRINGWildcardsTest/Z-Image-Turbo—
    SubFolderNameSTRINGArtStyle_Test—
    same_as_subfolderBOOLEANtrue—
    FileNameSTRINGArtStyle_Test—
    SuffixSTRINGTake2—
    DATE_formatSTRING%Y-%m-%d—
    TIME_formatSTRING%H-%M-%S—
    DATETIME_formatSTRING%Y%m%d-%H%M%S—
    FullNameFormatSTRING%MainFolderName/%DATE-%SubFolderName/%FileName-%DATETIME-%Suffix—
    PathNameFormatSTRING%MainFolderName/%DATE-%SubFolderName/—
    FileNameFormatSTRING%FileName-%DATETIME-%Suffix—

    Outputs (3)

    NameTypeDescription
    FullNameOutSTRING—
    PathNameOutSTRING—
    FileNameOutSTRING—