Nodes/comfyui_prompt_bench/Prompt Benchmark Store
ComfyUI Node

Prompt Benchmark Store

PBStore Is Prompt Bench's Filing Cabinet — Every Run Saved as JSON, No Database Required

By inflamously·Created 5 months ago·Updated 5 months ago· 0
Prompt Benchmark Store
  • rating
  • images
    prompt
    model
    text

    Iterative prompt work has a silent killer: you can't remember which rating produced the prompt that finally worked. PBStore fixes that by writing every run to disk as a numbered JSON file, so your "try #14 with a lighting score of 2" history survives the session - and your memory. It's the logging end of the Prompt Bench loop, and it's gloriously simple under the hood.

    What it does

    Feed it a prompt, a rating, a model name, and the generated text, and it saves the whole run as JSON in ComfyUI's user folder under prompt_bench/store/. That's the entire job - no database, no API, no cloud. Every file stays on your machine.

    The inputs

    Four required, one optional:

    • prompt (STRING) - the prompt that produced the image.
    • rating (RATING) - the structured rating payload from PBRating. Saved as JSON, so you keep the exact scores, not a paraphrase.
    • model (STRING) - which Ollama model was used.
    • text (STRING) - this is the sneaky one: it's not just a note, it decides the folder name. The pack strips non-word characters from it and uses the result as the store id.
    • images (IMAGE, optional) - the tooltip says "The images to save," and the honest caveat is that the save loop is currently a no-op. Your image files will not be written. Don't design a workflow around it.

    There are no outputs - it's an output node that does its work and shows nothing but a checkmark.

    How it saves

    Look in ComfyUI/user/prompt_bench/store/<your-text-id>/. Inside, files are numbered sequentially - 1.json, 2.json, and so on, counting existing files before writing the next. Each file holds the prompt, the serialized rating, the model, and the text. That numbering means the same text input appends to the same folder, which is a feature when you're iterating on one idea and a trap when you forget why run 9 of one idea and run 2 of another share a folder.

    Install and wiring

    Same as every node in this pack - ComfyUI Manager, search "Prompt Bench", or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/inflamously/comfyui_prompt_bench
    

    Restart, done. No pip packages, no models. The natural wiring is the README's loop: PBTextModelChat's enhanced_prompt into prompt, PBRating's rating into rating, the model string through, and the generated text into text. (Tip: feed PBListChatView's formatted transcript into text if you'd rather archive the whole conversation than just the reply.)

    Gotchas

    • Where the files go surprises people. Not your workflow folder - ComfyUI/user/prompt_bench/store/. Back it up if you care about the history.
    • text is the folder key. Empty or changing text means new folders; a repeated text means the files keep numbering up inside one folder.
    • Images are accepted and dropped. The optional input is wired into the signature but the save is a stub. It'll probably be implemented later; it isn't now.

    For a tool this young (it's a small pack, zero real community footprint as of this writing), the honest take is: use it for the JSON audit trail, not for image archiving. When you finally nail the prompt, that numbered file is your receipt.

    CategoryPrompt Bench

    Inputs (5)

    NameTypeDefaultDescription
    promptSTRING
    ratingRATING
    modelSTRING
    textSTRING
    imagesoptIMAGEThe images to save.

    Outputs (0)

    No outputs