Nodes/ComfyUI-SingleLinePicker/SLP Filename Prefix
ComfyUI Node

SLP Filename Prefix

Make Save Image stamp dates and your LoRA name in the filename

By hetima·Created 7 months ago·Updated 6 months ago· 5
SLP Filename Prefix
  • $1
  • $2
  • $3
  • $4
  • STRING
filename_prefix%date:yyyy-MM-dd%/$1

Here's a ComfyUI quirk you've probably hit and blamed yourself for: filename_prefix supports %date:yyyy-MM-dd% for date-stamping, but the substitution happens in the frontend - so the moment you wire an input into that widget, the date magic silently stops working. And if you want the selected LoRA's name in the filename, you can't do it at all, because a plain string widget can't reach the backend at runtime. SLP Filename Prefix exists to fix both problems.

It builds a filename_prefix string with up to four placeholders - $1 through $4 - and fills them in at execution time, while still processing the %date:% format. The default template even shows the intended use: %date:yyyy-MM-dd%/$1, i.e. a dated folder with your first value as the filename.

How it works

It's a two-stage handoff, which is why it works at all. The frontend takes the filename_prefix template and runs ComfyUI's own applyTextReplacements on it - that's what expands %date:% - then the backend replaces $1$4 with whatever values you've connected, and sanitizes them for the filesystem. Anything illegal in a filename (? / < > \ : * | ") gets turned into underscores, only the first line of each value survives, and numbers and booleans are converted to strings. So a selection that reads like a path or has weird characters can't blow up Save Image with an invalid filename.

The inputs that matter

  • filename_prefix (required STRING) - your template, including %date:% and any of $1$4. Defaults to %date:yyyy-MM-dd%/$1.
  • $1 through $4 (optional, any type) - each replaced into the template where the matching placeholder appears. Wire anything in: strings, numbers, another node's output.

The single STRING output is the finished prefix, and you plug it into the filename_prefix input of Save Image or Preview Image. That's the entire node.

The killer pairing

This is where the pack clicks together: the SLP Lora Loader outputs a stem - the LoRA filename without its extension. Run that into $1 and suddenly every saved image is filed under 2026-08-16/<lora-name>.png. If you're batch-generating through a list of LoRAs (which is the whole reason the SingleLinePicker pack exists), knowing exactly which LoRA produced which image without opening the PNG metadata is a genuine quality-of-life upgrade. No custom loader, no Python, just wires.

Install

Same as the rest of the pack - ComfyUI Manager (search ComfyUI-SingleLinePicker) or:

cd ComfyUI/custom_nodes
git clone https://github.com/hetima/ComfyUI-SingleLinePicker

Restart ComfyUI afterward. No pip dependencies, no model files to download.

One small note: it's an output node, so it always executes - fine for this use, just don't be confused when it runs even in bypass-heavy graphs. And if your workflow's Save Image accepts the wired prefix but still shows the raw template in the widget, that's normal; the substitution happens at execution.

CategorySingleLinePicker

Inputs (5)

NameTypeDefaultDescription
filename_prefixSTRING%date:yyyy-MM-dd%/$1can include "%date:%", "$1", "$2", "$3" and "$4"
$1opt*replace "$1" with this value
$2opt*replace "$2" with this value
$3opt*replace "$3" with this value
$4opt*replace "$4" with this value

Outputs (1)

NameTypeDescription
STRINGSTRINGbuilt filename_prefix