ComfyUI Node

AZAll Prompt Template

{a}, {b}, {c}, {d} — fill in the blanks

By cronos3k·Created 5 months ago·Updated 5 months ago· 0
AZAll Prompt Template
    • text
    templateCharacter: {a} Setting: {b} Mood: {c}
    a
    b
    c
    d

    A reusable prompt skeleton with four named slots. AgentAZAll_PromptTemplate takes a template string containing {a}, {b}, {c}, and {d} placeholders, plus values for those slots, and returns the filled-in text. If you find yourself typing the same "Character: X, Setting: Y, Mood: Z" scaffolding over and over, this is the node that stops you - the default template is literally that.

    Its niche in this pack is the World Builder demo, where it's used to incrementally build a game world: each run supplies a type, name, and style through the slots, and the template turns them into a consistent prompt the LLM can act on. It's the pack's answer to "how do I keep my prompt structure stable while the content changes."

    How it works

    A straightforward string replace. It takes the template and substitutes {a} → the a value, {b} → b, and so on, in order. Two deliberate behaviors are worth knowing: unfilled slots are left as {a} in the output (no crash, just a dangling placeholder), and values aren't escaped or formatted in any way - they're spliced in verbatim. It's a pure function; nothing is written to disk.

    The inputs that matter

    • template (required) - the skeleton with up to four {a}{d} placeholders.
    • a, b, c, d - the slot values. Each is a typeable widget that also accepts an upstream connection, so you can wire a Recall result into {a} and a typed value into {b} in the same node.

    The text output is the completed prompt string, ready for an LLM's user_prompt or a Text Combine.

    Installing it

    In cronos3k/comfyui-agentazall - Manager search "AgentAZAll", or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/cronos3k/comfyui-agentazall.git
    pip install "agentazall>=1.0.13"
    # restart ComfyUI
    

    No models, no keys.

    Common issues

    The gotchas are the two behaviors above. Leave a slot empty and {c} will literally appear in your prompt - harmless to an LLM but ugly, and easy to miss until you see the text. And there's no escaping: if your values contain {a}, they'll be substituted too, which can produce surprises if you're injecting code or curly-brace-heavy content. It's also only four slots - if you need more, nest two templates or use Text Combine with the slots pre-joined. For a beginner it's one of the friendliest nodes in the pack, because the default template shows you the mechanism the second you add it to the canvas.

    CategoryAgentAZAll/Utility

    Inputs (5)

    NameTypeDefaultDescription
    templateSTRINGCharacter: {a} Setting: {b} Mood: {c}
    aoptSTRING
    boptSTRING
    coptSTRING
    doptSTRING

    Outputs (1)

    NameTypeDescription
    textSTRING