Nodes/ComfyUI-RvTools_v2/Add Filename Prefix
ComfyUI Node

Add Filename Prefix

Add Filename Prefix

By r-vage·Created about a year ago·Updated 5 months ago· 23
Add Filename Prefix
  • input_variables
  • string
path
file_name_prefiximage
add_date_time
date_time_format%Y-%m-%d_%H:%M:%S

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, or postfix) - disable just joins path and prefix. prefix puts the timestamp before the name (2026-08-13_10:30:00_image), postfix after it (image_2026-08-13_10:30:00).
  • date_time_format (default %Y-%m-%d_%H:%M:%S) - a standard Python strftime format string, so you can go as granular as %Y-%m-%d_%H-%M-%S for batch-by-batch uniqueness or as coarse as %Y-%m for 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 and prefix = "img_{}" becomes img_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.

Category🫦 RvTools II/ Folder

Inputs (5)

NameTypeDefaultDescription
pathSTRING
file_name_prefixSTRINGimage
add_date_timeCOMBO3 options: disable, prefix, postfix
date_time_formatSTRING%Y-%m-%d_%H:%M:%S
input_variablesopt*

Outputs (1)

NameTypeDescription
stringSTRING