Shima File Namer
File names that don't collide, with every part where you want it
- full_path
- folder_path
- filename
- collision_id
- timestamp
- user_notes
Default ComfyUI output names are ComfyUI_00001_, ComfyUI_00002_... - fine for a few runs, miserable when you're iterating on a project and hunting for "the good one from Tuesday." Shima.FileNamer is the organized answer: it builds file paths and names from composable parts - project, base name, timestamp, a random collision ID - and emits every piece as its own STRING output so a saver downstream uses exactly what you configured. Think of it as the naming half of a proper file pipeline, with the FileSaver being the other half.
How it works: the node assembles a filename from ordered components. There's a base_folder (default output, relative to ComfyUI root or absolute) and a project_name (default project) that becomes both the subfolder and part of the name. base_name is your own word; prefix and suffix bookend it; output_type is a label like rgb, depth, or mask for multi-pass pipelines. Two dedup weapons keep files from colliding: timestamp_enabled with a Python strftime format (%Y%m%d_%H%M%S by default), and collision_id_enabled which appends a 6-character random ID, with collision_id_mode set to new_each_run for unique files or fixed to keep the same ID across runs (that one matters when several savers must produce matched sets).
The input that makes this node feel designed rather than bolted together is filename_order, an enum of presets like PRE,PRJ,BN,ET,SUF,TS,CID - prefix, project, base, output type, suffix, timestamp, collision ID - in the order you choose. Want the timestamp up front so files sort chronologically? Pick the preset that does that. separator chooses the character between parts (_, -, ., space, or none).
Outputs are all STRINGs and all useful:
- full_path - folder + filename (no extension yet).
- folder_path - just the folder.
- filename - just the name.
- collision_id and timestamp - the exact values used, so a second node (a log, a metadata writer, a matched saver) can reference them.
- user_notes - your freeform notes, passed through for downstream savers to embed as metadata.
It also has external_project, external_folder, and external_collision_id optional inputs, so a Shima.Commons controller or another node can override those parts - which is exactly how a project-wide setup stays consistent without editing every namer.
A couple of notes. It only names - nothing is written to disk until a saver consumes the paths. And because the collision ID is random per run, expect every batch to produce new names; if you need stable names for A/B comparisons, set collision_id_mode to fixed. Everything else is configuration that just works.
Install the pack via ComfyUI Manager (search "Shima") or
cd ComfyUI/custom_nodes
git clone https://github.com/KDB-USJP/shima_wf
then restart. No models or downloads.
Inputs (17)
| Name | Type | Default | Description |
|---|---|---|---|
| base_folder | STRING | output | Base output folder (relative to ComfyUI root or absolute path). |
| project_name | STRING | project | Project name - used as subfolder and in filename. |
| base_name | STRING | User-supplied base filename. Leave blank to omit. | |
| collision_id_enabled | BOOLEAN | true | Add 6-char random ID to prevent overwrites. |
| collision_id_mode | COMBO | new_each_run | new_each_run = unique files; fixed = same ID across runs. |
| timestamp_enabled | BOOLEAN | true | Add timestamp to filename. |
| timestamp_format | STRING | %Y%m%d_%H%M%S | Python strftime format (e.g., %Y%m%d_%H%M%S). |
| prefix | STRING | Text to prepend to filename. Skip if blank. | |
| suffix | STRING | Text to append before extension. Skip if blank. | |
| output_type | STRING | Label for output type (e.g., 'rgb', 'depth', 'mask'). Skip if blank. | |
| filename_order | COMBO | PRE,PRJ,BN,ET,SUF,TS,CID | Order of filename components. PRE=Prefix, PRJ=Project, BN=BaseName, ET=OutputType, SUF=Suffix, TS=Timestamp, CID=CollisionID. |
| separator | COMBO | _ | Character between filename parts. |
| user_notes | STRING | Optional notes to pass to downstream saver nodes for metadata. | |
| external_projectopt | STRING | Override project name from external source. | |
| external_folderopt | STRING | Override base folder from external source. | |
| external_collision_idopt | STRING | Use specific collision ID (for matched outputs). | |
| allow_external_linkingopt | BOOLEAN | false | If ON, this node broadcasts/receives OUTSIDE the Island (ignores group regex) |
Outputs (6)
| Name | Type | Description |
|---|---|---|
| full_path | STRING | Complete path including folder and filename (no extension). |
| folder_path | STRING | Folder path only. |
| filename | STRING | Filename only (no extension). |
| collision_id | STRING | The collision ID used (for matching related outputs). |
| timestamp | STRING | The timestamp used. |
| user_notes | STRING | User notes passthrough for downstream savers. |