Nodes/Symbiotica/NS Prompt Tuner Save
ComfyUI Node

NS Prompt Tuner Save

The Other Half of the Self-Tuning Prompt Loop

By symbiotica-ai·Created 6 months ago·Updated about 12 hours ago· 2
NS Prompt Tuner Save
    • status
    tuner_iddefault
    response

    NS Prompt Tuner Save is the tail of a loop that starts at NS Prompt Tuner Load. On its own it does one thing: it takes the refiner LLM's critique of your last render, parses it, and appends the improved system prompt as the next version in the tuning state. Load serves it next run. Rinse, repeat, and your prompt rewriter gets a little better every queue - which is why this node exists at all.

    If you only ever use Load, you have a prompt that never improves and a loop that can't advance. The pair is the feature. Think of Save as the "commit" step in a self-improving pipeline: no save, no progress.

    How it works

    Save receives the refiner's response - the fixed-format text a refiner LLM produces (CRITIQUE section, a VERDICT: IMPROVE|CONVERGED line, then PROMPT: … ending with END PROMPT). It matches tuner_id against the Load node's id, parses that response, and appends the rewritten prompt as version v+1 in output/prompt_tuner/<tuner_id>.json. The state file is append-only - nothing is ever overwritten, so every version plus its critique stays on disk, human-readable, for rollback later.

    It's smarter than a blind saver. A reply without a PROMPT: section is rejected (refusals and pure commentary don't become prompts). An identical repeat of a previous version is recorded as CONVERGED - that's the oscillation stop that tells Load the loop is done. And in pinned/production mode (version_override ≥ 0 on Load), Save records nothing, so a pinned graph costs zero API calls on repeat runs.

    Inputs and output

    Two required inputs: tuner_id (must match the Load node's id exactly - they're folded the same way) and response, which comes from the refiner NS LLM Chat's output. One output: status (a STRING saying what was recorded - version number, verdict, or the reason it was rejected), useful wired to a Preview Any so you can watch the loop think.

    Install and setup

    Part of the Symbiotica pack. ComfyUI Manager → search "Symbiotica", or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/symbiotica-ai/comfyui-nodes.git symbiotica
    pip install -r symbiotica/requirements.txt
    

    Restart. Needs the same LLM keys as the Load side (via Settings → Symbiotica or env vars), and a refiner LLM wired to feed it.

    Troubleshooting

    • Nothing is being recorded - check the wiring. The refiner's response must be connected, and the node must be unmuted. Save being muted or bypassed is the classic silent killer of this loop.
    • tuner_id mismatch - Load and Save must agree. The node folds case and punctuation identically on both sides, so Bakery Sheet matches bakery-sheet, but two genuinely different ids mean the save lands in the wrong state file (or a fresh one).
    • The response looks like prose, not the fixed format - that's the refiner refusing or being verbose. Save rejects it loudly rather than saving garbage; check your refiner's system prompt.
    • The loop converged and you didn't mean it to - that's a CONVERGED verdict from an identical repeat. Change Load's guidance to reopen it, and the next run should produce an IMPROVE and a new version.
    Categoryneuralsins/LLM

    Inputs (2)

    NameTypeDefaultDescription
    tuner_idSTRINGdefaultMust match the NS Prompt Tuner Load node's tuner_id.
    responseSTRINGThe refiner LLM's response (CRITIQUE / VERDICT / PROMPT … END PROMPT).

    Outputs (1)

    NameTypeDescription
    statusSTRING