Nodes/ComfyUI-Path-Helper/Add Folder Advanced
ComfyUI Node

Add Folder Advanced

Date-stamped and variable-driven folders for ComfyUI output

By Billius-AI·Created 2 years ago·Updated 2 years ago· 21
Add Folder Advanced
  • path
  • input_variables
  • PATH
folder_name
add_date_time
date_time_format%Y_%m_%d_%H:%M:%S

Plain Add Folder appends a folder name you already know. This one is for when you don't know it yet at design time - because it should be today's date, or because it should contain the seed, the checkpoint name, or some other value that only exists once the workflow is actually running. Add Folder Advanced is the same append-a-folder mechanic, plus two extra tricks: datetime stamping and {}-style variable formatting.

The two extra tricks, and how they actually work

Datetime stamping is the simpler of the two. Set add_date_time to prefix or postfix and this node will glue a formatted timestamp onto your folder name - automatically, every run, no manual typing. The format string uses strftime codes (the same ones Python, and most languages, use for date formatting - %Y for year, %m for month, and so on), so you have full control over what the timestamp looks like. This is the node you want if you're doing batch runs and don't want run 47 to silently overwrite the folder from run 46.

Variable formatting is the more powerful one, and the one that trips people up. Put {} inside your folder_name string, and whatever you feed into the optional input_variables input gets substituted in at that position - like a template. Want multiple variables in one folder name? Pass a comma-separated string into input_variables (order matters, it fills the {} slots left to right), which is exactly what the Join Variables node in this same pack exists to build for you.

The inputs and outputs that matter

  • path (required) - the PATH you're building on, from Create Project Root or an earlier Add Folder node.
  • folder_name (required) - your folder name string, with optional {} placeholders if you're using variable formatting.
  • add_date_time (required, enum) - disable, prefix, or postfix. Disabled by default behavior; pick one of the other two to actually get a timestamp.
  • date_time_format (required, default %Y_%m_%d_%H:%M:%S) - your strftime format string. The default is safe and sortable; customize it if you want something shorter or differently ordered.
  • input_variables (optional) - accepts basically anything (strings, ints, floats) and tries to format it into your {} placeholders. The author's own caution here is worth repeating: because this input is unrestricted by type, feeding it something exotic like a raw LATENT will break the formatting. Stick to primitive-ish values - strings, numbers, things that print sensibly as text.

Output is a PATH, same as the plain version, so it chains the same way into more Add Folder nodes or into Add File Name Prefix (Advanced or otherwise) to finish the chain.

How to install it

Via ComfyUI Manager, search ComfyUI-Path-Helper and install. Manually:

cd ComfyUI/custom_nodes
git clone https://github.com/Billius-AI/ComfyUI-Path-Helper

Restart ComfyUI. No extra dependencies, no models - it's os and datetime from Python's standard library.

Common issues & troubleshooting

My {} isn't getting replaced. Make sure input_variables is actually connected - if it's left empty, there's nothing to substitute and the literal {} stays in your folder name.

I tried wiring a ComfyUI Primitive node into input_variables and it didn't work. This is a known limitation the author calls out directly - primitive nodes don't play nicely as the source for input_variables. Feed it from a real upstream value (a string node, a seed output, something with a concrete type) instead of a Primitive.

Formatting broke with a weird error. You're probably passing a type this node can't stringify sensibly - the README specifically flags LATENT as an example that breaks it. If in doubt, convert to a string before it reaches input_variables, or route it through Show String first to confirm what you're actually sending.

Multiple variables aren't landing in the right slots. Order matters - the comma-separated values fill your {} placeholders left to right, in the order you joined them. If you're using Join Variables, double-check the var order there matches the order your placeholders appear in folder_name.

Categorypath_helper

Inputs (5)

NameTypeDefaultDescription
pathPATH
folder_nameSTRING
add_date_timeCOMBO3 options: disable, prefix, postfix
date_time_formatSTRING%Y_%m_%d_%H:%M:%S
input_variablesopt*

Outputs (1)

NameTypeDescription
PATHPATH