Nodes/Prompt Palette-F/Node Value Template
ComfyUI Node

Node Value Template

Paste %KSampler.seed% into anything — this node steals Save Image's best trick

By id-fa·Created about a year ago·Updated 7 days ago· 2
Node Value Template
    • text
    template

    If you've ever used ComfyUI's Save Image node, you know its quiet superpower: you can write %KSampler.seed% in the filename prefix and it becomes the actual seed at queue time. Node Value Template is that trick, detached from Save Image and turned into a general-purpose string node. You write %NodeTitle.widget% tokens into a template, it resolves them from the live widget values of any node in your graph, and hands you the finished string.

    Why bother? Because there's a whole category of things you want to embed in a prompt or a metadata string, not just a filename. Embedding %KSampler.seed% or %KSampler.cfg% inside a prompt lets you actually see the settings that produced an image. Building output_%date:yyyy-MM-dd%/%LoadImage.image|basename% gives you organized folders named after what you loaded. It's the difference between writing a tiny custom node and just typing a template.

    How it works

    The substitution happens in the frontend, right before you queue. A small JS widget scans your template, replaces each token with the matching widget's current value, and sends the resolved string to the backend. The template field itself keeps its raw %...% form - same mechanism as Save Image, so your workflow stays readable.

    Beyond the basics, two things push it past a curiosity:

    • Date tokens - %date:yyyy-MM-dd% and friends (year, month, day, time in zero-padded or plain forms; a bare %date% expands to yyyy-MM-dd). Uses your browser's local time at queue.
    • Modifiers - Smarty-style post-processing chained with |. %LoadImage.image|basename% strips the path and extension from a file value; firstword:'_' keeps only the first word split on _. You can chain them: |basename|firstword:'_'. An unknown modifier leaves the whole %...% token in place so you can spot the typo.

    You don't have to type tokens from memory, either. There's an insert helper button on the node that opens a modal: pick a node title from a dropdown, get its widget names and current values, click to insert, optionally chain a modifier. There's always a "date format" entry even if your graph has nothing else to reference.

    Inputs, outputs, and honest limits

    One input - template, multiline - and one text output. That's the whole surface.

    The limits are worth internalizing, because they'll bite:

    • Matching is by node title. Untitled nodes use their display name (KSampler). If two nodes share a title, the first one found wins.
    • Only widget values resolve. No output values, no metadata.
    • Titles containing a . are unsupported - the split happens on the first dot, same limitation as Save Image.
    • Unresolvable tokens stay as %...% - deliberate, so a typo is visible rather than silently empty.
    • If the frontend JS doesn't load (rare), the template passes through unresolved. Check that your ComfyUI is reasonably current.

    Installing it

    Same one-pack install:

    cd ComfyUI/custom_nodes
    git clone https://github.com/id-fa/ComfyUI-PromptPalette-F prompt-palette-f
    cd prompt-palette-f
    pip install -r requirements.txt
    

    Restart, and it's under Prompt Palette-F. Manager users: search "Prompt Palette-F" (slightly older snapshot possible). No models, no extra deps - this is one of those "how did I live without it" text nodes once you start embedding seeds in prompts and auto-generating folder names.

    CategoryPrompt Palette-F

    Inputs (1)

    NameTypeDefaultDescription
    templateSTRING

    Outputs (1)

    NameTypeDescription
    textSTRING