Nodes/was-node-suite-comfyui/Load System Prompt
ComfyUI Node Runs on cloud

Load System Prompt

Stop retyping your captioning instructions into every graph

By WASasquatch·Created 4 years ago·Updated about 9 hours ago· 1,884
Load System Prompt
    • system_prompt
    • name
    • documents
    ◄system_prompt▾►

    Why bother

    Once you're using a VLM to caption a LoRA set, or a small local LLM to rewrite prompts, the system prompt stops being an afterthought and becomes the actual product. Six paragraphs of "describe the variable, leave the fixed, one dense paragraph, no preamble" is the difference between a usable dataset and 800 captions full of "Certainly! Here's a detailed description…".

    And what do people do with that paragraph? Paste it into the text box on every graph. Then tweak it in one graph and not the others, and wonder why the captions changed. Load System Prompt puts those instructions in files on disk and pulls one into the graph by name.

    The pack's own text nodes - Fast Generate Text, Generate Text - take a system_prompt input, and that's the socket this node feeds. It's the same division of labour the KB's LLM-in-ComfyUI doc describes: the model is a short structured rewriter, and the instructions that keep it from drifting belong somewhere stable, not in a widget you re-edit per workflow.

    How it works

    The library is a folder: ComfyUI/user/was-node-suite/system_prompts. Everything under it, eight folders deep, becomes the tree you pick from. Files are .txt or .md, UTF-8, up to 256 KB, and the node will list at most 2000 of them. Names starting with a dot are ignored, which is a quiet convenience - drop a .git in there and nothing complains.

    Each file can open with YAML front matter fenced by --- lines. A name key overrides the filename, description gets drawn under it in the picker, model_family groups it (Qwen, Gemma), tags get searched. Then the fenced block is stripped and only the text after it is what reaches the model. If the front matter isn't a valid YAML mapping or doesn't close within the first 16 KB, it's treated as part of the prompt instead - worth knowing if your carefully written preamble suddenly shows up verbatim in the output.

    The picker key looks like a path: Captioning/Detailed Caption.txt. On execution the node re-reads the file from disk (it fingerprints it on modified time and size, so editing the file mid-session invalidates ComfyUI's cache and triggers a fresh run), strips the front matter, and hands the body out.

    A folder containing a SKILL.md is listed under the folder's name rather than as a loose file, which is the convention you want if you're keeping agent-style skill files in the same library.

    Inputs and outputs

    One input: system_prompt, the combo of everything in the library.

    Two outputs:

    • system_prompt - the prompt's text with the front matter removed. This is the one you wire to a model's system_prompt input.
    • name - the name from the front matter, or the filename if there isn't one. Useful when you're captioning a set and want the output filename to say which instruction set produced it.

    Install

    cd ComfyUI/custom_nodes
    git clone https://github.com/WASasquatch/was-node-suite-comfyui.git
    

    Or Manager → search WAS Node Suite v3. ComfyUI 0.14.0+, Python 3.10+, and no pip install: requirements.txt in the repo is an empty comment. The first start creates ComfyUI/user/was-node-suite/ (config, state database, wildcard and LUT folders) and compiles the pack's bytecode - a couple of seconds, once per update.

    Nothing to download. The library starts empty; make the folder and drop a .txt in, or use Save System Prompt and let the node write it.

    Where people get burned

    A new file doesn't appear. Save it, then press the refresh button at the top of the library on the node. The list is built when the node draws, not continuously.

    A file never appears at all. Four usual suspects: the extension isn't .txt or .md, the file is over 256 KB (and the path is only logged to console, not shown), a folder above it starts with a dot, or the file isn't UTF-8. Re-save it as UTF-8 and it'll show.

    is not in the system prompt library. You opened someone else's workflow and it names a prompt you don't have. Either pick another one on the node, or create a file at the path in the error message. Nothing is bundled - a shared graph can't ship its prompts with it, which is arguably a feature.

    Blank prompt, no error. A file with front matter and nothing after the closing --- reads as empty. The console warns; the run doesn't stop. If your VLM suddenly captions like a machine with no instructions, check that first.

    CategoryWAS Suite/Text/System Prompts

    Inputs (1)

    NameTypeDefaultDescription
    system_promptCOMBOWhich prompt or skill to load, by its place in the library, such as `Captioning/Detailed Caption.txt` or `Built-in/FLUX/FLUX.2 Prompt Upsampler.md`. `Built-in/` entries ship with the pack; Copy on the library makes an editable copy in ComfyUI/user/was-node-suite/system_prompts.

    Outputs (3)

    NameTypeDescription
    system_promptSTRINGThe prompt's text without its front matter, for a model's system_prompt input.
    nameSTRINGThe prompt's name from its front matter, or its file name when it has none.
    documentsWAS_LLM_DOCUMENTSA skill's other text files, such as `references/layout.md`, one document each, for LLM Vector Index or another LLM index. Empty for a plain prompt, and while the LLM nodes are off.