Nodes/ComfyUI-SwissArmyKnife/Filename Generator
ComfyUI Node

Filename Generator

Stop naming your Wan renders like a monster — let the workflow do it

By sammykumar·Created 11 months ago·Updated 7 months ago· 6
Filename Generator
    • filename
    scheduler
    shift12.00
    total_steps40
    shift_step25
    high_cfg3.00
    low_cfg4.00
    base_filenamebase
    subdirectory_prefix
    add_date_subdirectorytrue

    Wan 2.2 is a two-pass model: a high-noise pass that sets motion and composition, and a low-noise pass that refines detail. That means your save folder ends up full of clips that only differ by a sampler here and a CFG there - and if you're naming them by hand, you will absolutely lose track of which one is which. Filename Generator solves the boring part of the problem: it builds a structured filename from the exact parameters in your workflow, so every render names itself.

    The inputs are the values you already have floating around your graph. scheduler comes in as a forced input (wire it from your Wan scheduler selector or equivalent - it gets cleaned to lowercase and spaces become underscores), plus shift, total_steps, shift_step, high_cfg, and low_cfg as numbers. On top of the parameters there's base_filename (default base, no extension), subdirectory_prefix (e.g. a project name, prepended to the folder), and add_date_subdirectory (a YYYY-MM-DD folder, on by default). It returns one STRING output, filename, which you feed straight into your save node's filename field.

    Mechanically it's a string builder, nothing clever. Floats get formatted to two decimals with the dot swapped for an underscore, so high_cfg of 3.0 becomes highCFG_3_00, and the final path looks something like project/2026-08-16/base_scheduler_wan2_2_shift_12_00_total_steps_40_shift_step_25_highCFG_3_00_lowCFG_4_00. Ugly? Sure. But it's deterministic, sortable, and grep-able - try finding "the one with shift 14" in a folder of output_001.mp4.

    The two-stage fields are where the Wan-ness shows: high_cfg/low_cfg and the shift_step (the step where the two passes hand off) are the parameters you actually tune in a 2.2 workflow, so they're baked into the name. If you're on a single-stage model, just set the two CFG values the same and move on.

    Installing

    Part of Swiss Army Knife:

    • ComfyUI Manager: search "Swiss Army Knife", install, restart.
    • Manual:
    cd ComfyUI/custom_nodes
    git clone https://github.com/sammykumar/ComfyUI-SwissArmyKnife.git
    cd ComfyUI-SwissArmyKnife
    pip install -e .
    

    Gotchas

    • It doesn't add an extension. The output is base_..._lowCFG_4_00, not .mp4. Your save node supplies the extension - if you wire the filename into a video save node that appends its own, great; if not, you'll get extension-less files.
    • The path is relative. It returns subdir/date/name; whether that lands under output/ depends on how the downstream save node treats it.
    • Decimal munging means no dot in filenames, which is deliberate (dots confuse some tools and shells). 12.0 becomes 12_00.
    • It's not an output node, so nothing displays in the UI - you just get the string on the wire.

    Is it glamorous? No. But it's the difference between a folder you can navigate and a graveyard of final_v2_REAL.mp4. For anyone running repeated Wan 2.2 experiments, this is the quiet workhorse that keeps your output directory sane.

    CategorySwiss Army Knife 🔪/Utils

    Inputs (9)

    NameTypeDefaultDescription
    schedulerSTRINGScheduler input from WanVideo Scheduler Selector or other scheduler nodes
    shiftFLOAT12.000–100Shift value
    total_stepsINT401–10000Total number of steps
    shift_stepINT251–10000Shift step value
    high_cfgFLOAT3.000–30High CFG value
    low_cfgFLOAT4.000–30Low CFG value
    base_filenameSTRINGbaseBase filename (without extension)
    subdirectory_prefixSTRINGOptional subdirectory prefix (e.g., 'project_name'). Will be added before date subdirectory.
    add_date_subdirectoryBOOLEANtrueAdd date subdirectory (YYYY-MM-DD format)

    Outputs (1)

    NameTypeDescription
    filenameSTRING