Add Filename Prefix
Add Filename Prefix
- input_variables
- string
If you generate a lot, you know the pain of a folder full of image_00001.png with no idea which run produced which file. Add Filename Prefix exists to fix exactly that: it builds a proper save path - directory plus filename prefix, optionally stamped with the current date and time - and hands you a string you can feed straight into a Save Image node. It's a small utility, but it's the difference between an archive you can actually search and a pile of guesses.
How it works
The node does three things, in order: format your prefix, optionally attach a timestamp, and join the result onto your path.
- path (required, input) - the directory you're saving into. In RvTools workflows this usually comes from the Project Folder node's output, so one change to the project folder renames every save downstream. It's
forceInput, so it arrives as a wire rather than a text box. - file_name_prefix (default
image) - the base name for your files. - add_date_time (
disable,prefix, orpostfix) -disablejust joins path and prefix.prefixputs the timestamp before the name (2026-08-13_10:30:00_image),postfixafter it (image_2026-08-13_10:30:00). - date_time_format (default
%Y-%m-%d_%H:%M:%S) - a standard Pythonstrftimeformat string, so you can go as granular as%Y-%m-%d_%H-%M-%Sfor batch-by-batch uniqueness or as coarse as%Y-%mfor monthly folders. - input_variables (optional, any type) - the sneaky useful one. If your prefix contains
{}placeholders, this node splits whatever you feed it on commas and slots the values in. Pass it a text string andprefix = "img_{}"becomesimg_whatever. Feed it a number from another node and it gets stringified and dropped into the name.
The output is a single string: your full path, ready to plug into a Save Image node's filename_prefix input.
Why bother
Two reasons, beyond simple tidiness. First, timestamp prefixes are your collision insurance - with prefix or postfix on, every run gets a unique filename, so you never silently overwrite earlier output. Second, it makes your workflow parameterised: because the path comes in as a wire, you can swap the folder without editing anything, and because input_variables accepts live values, you can bake the current prompt subject or seed straight into the filename. That's the kind of thing people end up building with a mess of string-concat nodes; this does it in one.
Installing it
Part of ComfyUI-RvTools_v2: ComfyUI Manager → search "ComfyUI-RvTools_v2", or manually:
cd ComfyUI/custom_nodes
git clone https://github.com/r-vage/ComfyUI-RvTools_v2
# restart ComfyUI
No extra dependencies beyond what ComfyUI already ships.
Gotchas
The date is stamped when the node executes, not when you queued the job - with a queue backed up, your timestamp reflects render time, not click time. Doesn't matter for most people, matters if you batch overnight and like exact records. And one thing worth knowing: the pack is deprecated in favor of ComfyUI_Eclipse, which carries this node forward. The old repo's node names (Float to Integer // RvTools and friends) pop up in shared workflows and Manager can't always match them to this pack's [RvTools] names - if you hit "missing node" on a downloaded workflow, that's usually why.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| path | STRING | — | |
| file_name_prefix | STRING | image | — |
| add_date_time | COMBO | 3 options: disable, prefix, postfix | |
| date_time_format | STRING | %Y-%m-%d_%H:%M:%S | — |
| input_variablesopt | * | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| string | STRING | — |