Nodes/ComfyUI-Prompter-fofrAI/Prompt from template 🪴
ComfyUI Node

Prompt from template 🪴

One sentence, a hundred variations

By fofr·Created 2 years ago·Updated 2 years ago· 80
Prompt from template 🪴
    • STRING
    â—„templateâ–º
    â—„seed0â–º

    The README's demo is the whole pitch, and it's a good one. Type this into the template box:

    A film still of [character.fantasy], [interaction.couple], [cinematic.keyword], [cinematic.coloring], [cinematic.effect], set in [time.year]
    

    and out comes "A film still of a ghost hunter, conflict, 8mm film, low-key color grading, cineon, set in 1890". Bump the seed and you get the same skeleton with different nouns: a siren holding a grudge, a demon princess assisting, each in a different decade. That's the entire node, and it does one thing well: it turns one template into endless prompt variations without you writing fifty prompts.

    First, the name is a lie in the best way. It says "fofrAI" but it doesn't call prompter.fofr.ai, doesn't hit any API, and needs no key. The curated lists ship inside the pack itself - a bundled prompt-lists repo holding the same YAML files that power the website - so it's fully local and works with your internet off. fofr is the Replicate-side creator (@fofrAI) known for fofr/* model pages and video experiments; this is his low-key local take on his prompter site.

    How it works is simple under the hood: the node scans your template for [square.brackets], looks the name up in its bundled lists, and replaces it with a random item. The syntax does three things:

    • [list.name] - one random item from that list
    • [list.name,2] - two random items, joined with ", " (no duplicates within a single expansion)
    • [random,2] - two items pulled from two different random lists

    Every expansion is seeded by the seed input, so a fixed seed gives you a fixed prompt - that's your reproducibility hook for batch testing. Items per placeholder are capped at 50.

    Only two inputs matter. template is the multiline box; because the widget is flagged dynamicPrompts, it also understands ComfyUI's native {a|b} alternates on top of the [list] brackets, so you can mix both styles in one sentence. seed is a plain integer, default 0. The single output is a STRING - wire it into the text input of a CLIP Text Encode node (positive or negative, works for SDXL/Flux/whatever your encoder is), or into a Show Text node to preview before you spend GPU time.

    Installing it is about as painless as custom nodes get. In ComfyUI Manager, search "ComfyUI-Prompter-fofrAI" and hit install; or the manual route:

    cd ComfyUI/custom_nodes
    git clone --recursive https://github.com/fofr/ComfyUI-Prompter-fofrAI
    

    then restart ComfyUI. There are no model downloads and no real dependencies - the code is pure Python stdlib (re, json, os, random), so install takes seconds. One gotcha on that clone command: the lists arrive as a git submodule, and if you skip --recursive the node will error out on a missing lists.json. Manager generally handles this for you; hand-cloners are the ones who hit it.

    Where people get burned: a typo in a list name doesn't crash - the node just leaves your [mistyped.list] literally in place, so the bracket text ends up in your conditioning as garbage tokens. Watch the console too: the node prints every generated prompt to the terminal, which is actually handy for confirming what got substituted. If the node errors at load time instead, the submodule didn't come with the clone - see above.

    CategoryPrompter

    Inputs (2)

    NameTypeDefaultDescription
    templateSTRING—
    seedINT00–18446744073709550000—

    Outputs (1)

    NameTypeDescription
    STRINGSTRING—