Nodes/ComfyUI-Kie-API/KIE System Prompt Selector
ComfyUI Node

KIE System Prompt Selector

System prompts for your gen nodes, organized as files

By gateway·Created 11 months ago·Updated 26 days ago· 41
KIE System Prompt Selector
    • prompt
    ◄user_prompt►
    ◄system_template▾►

    If you use an LLM inside your ComfyUI workflows - and the pack's own grid workflow does, to turn an input image into prompt variations - you will eventually find yourself pasting the same long system prompt into node after node. This helper is the antidote: it keeps your system prompts as plain .txt files on disk and gives you a dropdown to pick one, then merges it with your user prompt into a single output string.

    The value is organizational, not magical. Instead of system-prompt text buried in a thousand-node workflow JSON (which then breaks every time you edit it and re-export), your prompt library lives in the pack's prompts/ folder, survives workflow exports untouched, and is swap-in/swap-out from a dropdown. If you've ever spent twenty minutes un-nesting a prompt that got mangled through workflow JSON round-trips, that alone justifies the node.

    How it works

    The dropdown (system_template) is populated by scanning two folders:

    • prompts/images/*.txt
    • prompts/videos/*.txt

    Each template file must follow a strict format for the node to pick it up:

    name: Character Consistency v1
    system prompt below
    You are a helpful assistant. Always preserve the character's identity.
    When the user says: {user_prompt}
    Return concise instructions for image generation.
    

    The name: line becomes the dropdown label; the system prompt below line marks where the body starts; and the optional {user_prompt} placeholder is where your prompt gets injected. If a file is missing either marker, it's silently ignored - so a typo'd template just won't appear in the dropdown, which is a friendly failure mode for debugging. If {user_prompt} isn't present in the body, the user prompt is simply appended to the end.

    Inputs and outputs

    • user_prompt (required) - the text to inject or append.
    • system_template (required) - the dropdown of templates found in prompts/.
    • prompt (STRING) - the combined system + user output, ready to wire into an LLM node.

    That's the whole surface. No optional inputs, no knobs.

    Install and usage

    Manager (search "ComfyUI-Kie-API") or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/gateway/ComfyUI-Kie-API
    

    Restart, then create a .txt file in prompts/images/ (or prompts/videos/) using the format above. The dropdown refreshes on restart, so after adding a template you'll need to reload ComfyUI.

    Where it trips people up

    • Templates vanish after edits. The scan happens at node-construction time; new or fixed files require a ComfyUI restart before they show up.
    • "No templates found." That's the literal dropdown entry when the scan finds nothing valid - almost always a missing name: or system prompt below line in a new file. Check those two lines before anything else.
    • It doesn't call an LLM. This node only assembles a string. The LLM call happens in whatever model node you wire the prompt output into. Pairing it with KIEParsePromptGridJSON downstream is the intended pattern: one standardized system prompt, one parsed grid of prompt outputs.

    For anyone running LLM-assisted generation more than once, this is the pack's quiet quality-of-life win - the kind of node you don't miss until you've rebuilt a workflow a third time from a workflow JSON that ate your prompt.

    Categorykie/helpers

    Inputs (2)

    NameTypeDefaultDescription
    user_promptSTRING—
    system_templateCOMBO2 options: images: Grid Visual Director (Real Camera - Influencer Style), videos: WAN 2.1/2.2 I2V Grid Story Director (v5)

    Outputs (1)

    NameTypeDescription
    promptSTRING—