Nodes/ComfyUI-Path-Helper/Add File Name Prefix
ComfyUI Node

Add File Name Prefix

Turning a Path Helper chain into SaveImage's filename_prefix

By Billius-AI·Created 2 years ago·Updated 2 years ago· 21
Add File Name Prefix
  • path
  • STRING
file_name_prefix

Everything else in ComfyUI-Path-Helper builds and hands around a custom PATH value - but SaveImage doesn't know what a PATH is, it just wants a plain string for filename_prefix. Add File Name Prefix is that exit door: it takes your carefully built PATH chain and turns it, plus a filename prefix of your choosing, into the STRING that actually plugs into your save node. If your Path Helper chain isn't producing anything downstream can use, this is very likely the missing node.

Why not just type the prefix into SaveImage directly

You can, for a one-off image. But the moment you want the output folder to reflect a project, a client, or a shoot - and you want that structure to hold up whether the workflow runs on your desktop or someone else's on a different OS - hand-typing project/renders/img into SaveImage's box is exactly the brittle pattern this whole pack replaces. Add File Name Prefix is where a properly built PATH (from Create Project Root and however many Add Folder nodes) finally becomes real, and it does the join with Python's os module rather than naive string concatenation, so the separators are correct no matter what.

The inputs and outputs that matter

Only two required inputs, and they're both straightforward:

  • path - the PATH you've built up from Create Project Root and Add Folder nodes. This is the folder structure part.
  • file_name_prefix - a plain string, the actual filename prefix for this batch of images. Something like "render" or "portrait" - SaveImage will append its own numbering after this.

The single output is a STRING - and this is the one you plug directly into SaveImage's filename_prefix input. That's the whole job of this node: combine folder path + filename prefix into the one string SaveImage actually consumes.

How it fits the rest of the chain

A typical layout looks like: Create Project Root → Add Folder (maybe a few of them, nested) → Add File Name Prefix → SaveImage. If you want to sanity-check what string you're actually about to feed SaveImage before you run a full batch, wire the output through a Show String node first - it'll render the exact text on the node so you're not guessing.

How to install it

Search ComfyUI-Path-Helper in ComfyUI Manager and install - that's the route most people take, especially if you hit this as a "missing node" error opening someone else's shared workflow (it shows up as a dependency in a handful of community workflows built around organized output folders). Manually:

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

Restart ComfyUI afterward. It's pure Python standard library - no pip packages to install, no models to download, nothing else needed to get it running.

Common issues & troubleshooting

SaveImage still errors on the connection. Confirm you wired this node's STRING output - not the earlier PATH value - into filename_prefix. It's an easy mix-up if you're new to the pack: PATH and STRING look similar in a graph but ComfyUI won't let you connect a PATH output directly to a STRING input, so if the wire isn't landing, that's usually why.

My output folder structure isn't what I expected. Trace back through your Add Folder chain - this node just concatenates whatever PATH it's handed with your file_name_prefix; it doesn't validate or reorder anything. If a folder is missing or in the wrong spot, the fix is upstream, in how you built the PATH, not in this node.

I need the filename to include a date or a dynamic value. This plain version doesn't do that - it's a fixed string. Reach for Add File Name Prefix Advanced instead, which adds the same datetime and {} variable-formatting options that Add Folder Advanced has, applied to the filename prefix instead of a folder name.

Categorypath_helper

Inputs (2)

NameTypeDefaultDescription
pathPATH
file_name_prefixSTRING

Outputs (1)

NameTypeDescription
STRINGSTRING