Nodes/comfyui-watdafox-nodes/Output Dir By Model Name (watdafox)
ComfyUI Node

Output Dir By Model Name (watdafox)

Never manually type an output filename again — build it from the model name

By postosh·Created 9 months ago·Updated 8 months ago· 0
Output Dir By Model Name (watdafox)
    • str_model_name
    • full_path
    • output_dir
    • file_name
    model_name
    folder_prefix
    extra_filename
    extra_number-1
    use_first_dirtrue
    use_ckpt_nametrue
    use_time_foldertrue
    use_time_file_nametrue
    full_path
    output_dir
    file_name

    Output Dir By Model Name is a path builder: you give it a model name (or any path-ish string), it generates an output_dir, a file_name, and a combined full_path - timestamped and organized by default, so you can wire them straight into a Save Image-style node that accepts a filename. If you generate a lot and your output folder is a wasteland of ComfyUI_00001_.png, this is the node that fixes your life.

    The default behavior tells you what it's for: take models/checkpoints/someModel.safetensors, and it produces an output dir like someModel/2026-08-16/ and a filename stamped with the exact time (2026-08-16-123456). Every model gets its own dated folder. That's the whole organizing principle, and it's a good one.

    How it works

    The path logic is all toggles. use_first_dir takes the first path component of the model string (models if you pasted a full path, the model filename's folder otherwise). use_ckpt_name uses the file stem (no extension) as the model folder name. use_time_folder adds a YYYY-MM-DD directory; use_time_file_name adds a full timestamp to the filename. folder_prefix, extra_filename, and extra_number (only appended when > -1) let you tag runs - e.g. a prompt variant name or a batch counter. If you end up with an empty filename, it falls back to a random integer so you never collide. The node always re-executes (it's marked as an output node and reports "always changed"), because timestamps are the point.

    It also pushes the generated values back into its own full_path / output_dir / file_name widgets via the pack's web extension, so what you see in the node is what you'd save.

    The inputs and outputs

    • model_name - the string you're building from. Paste the checkpoint path/name.
    • The four use_* toggles - this is where the layout is decided. Flip use_time_folder off and you get one folder per model; flip use_ckpt_name off and the model name disappears from the path.
    • Outputs str_model_name (echo of the input), full_path, output_dir, file_name - all STRING.

    Category: watdafox/string. Note the (English) display name is "Output Dir By Model Name"; the class name has the classic "Ouput" typo.

    Install

    cd ComfyUI/custom_nodes
    git clone https://github.com/OhSeongHyeon/comfyui-watdafox-nodes.git
    

    Restart ComfyUI, or ComfyUI Manager → "comfyui-watdafox-nodes". No pip dependencies, no model files.

    What's worth knowing

    If you want the same path logic bundled into a checkpoint loader (so the model loads and the path builds from it), this pack's Checkpoint Loader Advanced does both - its enable_make_path toggle controls the same path machinery. And if your Save node expects a full path rather than a filename, feed it full_path and test once before you commit, because save-node filename conventions vary between packs.

    Categorywatdafox/string

    Inputs (11)

    NameTypeDefaultDescription
    model_nameSTRING
    folder_prefixSTRING
    extra_filenameSTRING
    extra_numberINT-1-1–18446744073709550000
    use_first_dirBOOLEANtrue
    use_ckpt_nameBOOLEANtrue
    use_time_folderBOOLEANtrue
    use_time_file_nameBOOLEANtrue
    full_pathSTRING
    output_dirSTRING
    file_nameSTRING

    Outputs (4)

    NameTypeDescription
    str_model_nameSTRING
    full_pathSTRING
    output_dirSTRING
    file_nameSTRING