Nodes/GPM-for-ComfyUI/GPM VLM Prompt Saver
ComfyUI Node

GPM VLM Prompt Saver

The node that rewrites how your scanner thinks

By Mystic419·Created 6 months ago·Updated 4 days ago· 1
GPM VLM Prompt Saver
  • source_preset
  • status_text
  • saved_preset_id
  • preset_json
◄actionLOAD FROM SOURCE►
◄load_presetSDXL►
◄preset_name►
◄system_prompt►
◄use_ban_listKEEP►
◄ban_list►

This is the only node in the pack that behaves like a tool rather than a pipe. It's an editor with a queue button: you load a preset, edit the text, pick an action, and the action happens when the graph runs - including deletes.

The thing it edits is the scanner's instruction prompt. That's the load-bearing text in this whole pipeline, and it's the same class of problem the local-prompt-enhancer crowd keeps running into: a chat model left to its own devices writes chat, not data. The built-in SDXL preset is a 2,700-character contract - strict JSON, exactly two keys, comma fragments not sentences, person and scene must not overlap, no invented details. Everything a scan writes out is downstream of that text. If your captions are wordy, vague, or full of "Here's your description:" preamble, this node is where you fix it.

Actions, and what each one actually does

The action dropdown is the whole interface:

  • LOAD FROM SOURCE - reads the bundle on the optional source_preset input (typically from GPM VLM Prompt Loader) and stores it as this node's source. Nothing is written to disk. The node emits a UI payload so the loaded name, system prompt and ban list fill the visible fields; you then edit those fields and run a second action.
  • SAVE AS NEW USER PRESET - writes a new user preset from the edited fields. Blank preset_name falls back to <loaded name> Copy, or User Preset. If system_prompt is blank it borrows the loaded source's prompt; if there's no source either, it refuses rather than saving an empty recipe.
  • UPDATE EXISTING USER PRESET - overwrites the loaded user preset. Requires a loaded source: with none it returns Cannot update preset: no source has been loaded. Run LOAD FROM SOURCE first. Built-ins are protected, so updating one comes back as builtin_read_only.
  • DELETE USER PRESET - removes a user preset. Built-in templates can't be deleted.

The dropdown load_preset is deliberately separate from the source_preset wire - it powers the node's own Load button in the front end, which is a UI convenience that does not queue anything.

The ban list

ban_list is a multiline field, one term per line. use_ban_list is KEEP, OFF or ON. KEEP inherits whatever the loaded source had, ON/OFF force it.

What it does is worth knowing before you flip it on: when use_ban_list is true and the list is non-empty, the scanner appends an instruction to the system prompt along the lines of "Avoid using these terms unless they are explicitly visible and necessary: term, term, term." It's a negative-space nudge to the captioner, not a filter - nothing gets scrubbed from the model's output after the fact, so a VLM that ignores the instruction ignores it.

That's how you stop a captioner from spraying score_9, source_anime, masterpiece across a photo set, or from writing "beautiful, elegant, stunning" for every image in your library. Note the shipped built-ins all carry an empty ban list, so ON on a stock preset changes nothing until you type terms.

Inputs and outputs

Required: action, load_preset, preset_name, system_prompt, use_ban_list, ban_list. Optional: source_preset (GPM_VLM_PROMPT_PRESET, force-input only).

Outputs: status_text (plain English - read it, it's the error channel), saved_preset_id (the stable ID your new preset got, e.g. for reuse elsewhere), preset_json (the saved payload). It's marked as an output node, so it runs whenever the graph runs - you don't need to wire anything downstream.

Install

ComfyUI Manager → Gallery Prompt Manager, or:

cd ComfyUI/custom_nodes
git clone https://github.com/Mystic419/GPM-for-ComfyUI GPM
cd GPM
python -m pip install -r requirements.txt
python install.py

User presets land at ComfyUI/user/default/GPM/vlm_prompt_presets.json; built-ins live in the pack as gpm_vlm_presets.json and are auto-created if missing. Loaded-source state is kept per node ID in gpm_vlm_prompt_saver_state.json - handy, but it means two workflows sharing a node ID can trip over each other.

Where people get burned

  • Two runs, one save. Load is a run, save is a run. People edit the fields, queue once with LOAD FROM SOURCE still selected, and wonder why nothing saved.
  • Editing the wrong thing. This node edits the scanner's prompt, not the caption of any image. If you want to correct one image's person/scene text, do it in GPM Gallery Browser and press Save to JSON.
  • Deleting a preset the scanner still references. Selecting a preset that no longer exists doesn't crash the scan - it falls back with a warning in status_text and an empty system prompt, which means a folder of very generic captions. Check GPM VLM Scanner (Internal)'s preset selection after any delete.
  • Dropdowns are stale until restart. The preset list is built when the node definitions load, so a preset saved in this session may not appear in the Loader/Scanner dropdowns until you restart ComfyUI. If you just edited a recipe and the scan still reads like the old one, confirm you didn't save it as a new preset while the scanner is still pointing at the built-in.
CategoryGPM / VLM

Inputs (7)

NameTypeDefaultDescription
actionCOMBOLOAD FROM SOURCE4 options: LOAD FROM SOURCE, SAVE AS NEW USER PRESET, UPDATE EXISTING USER PRESET, DELETE USER PRESET
load_presetCOMBOSDXL3 options: SDXL, Pony, Natural Language
preset_nameSTRING—
system_promptSTRING—
use_ban_listCOMBOKEEP3 options: KEEP, OFF, ON
ban_listSTRING—
source_presetoptGPM_VLM_PROMPT_PRESET—

Outputs (3)

NameTypeDescription
status_textSTRING—
saved_preset_idSTRING—
preset_jsonSTRING—