Nodes/ComfyUI-TJ_NODE/PromptDBSave(TJ)
ComfyUI Node

PromptDBSave(TJ)

PromptDBSave (TJ)

By designloves2·Created 4 months ago·Updated 4 days ago· 13
PromptDBSave(TJ)
  • images
  • images
positive_prompt
excel_path
thumbnail_size256
modetrue
auto_extracttrue
negative_prompt
model_name
seed0
steps8
cfg1.0
sampler_nameeuler
schedulersimple
extra_settings
note
get_name(none)
setnode_namePromptDB

Somewhere between a save node and a lab notebook lives PromptDBSave (TJ): it takes an image batch and appends one row per image to an Excel workbook, with the prompt, the sampler settings, the seed, a thumbnail, and a free-text note. Run it every generation and you slowly build a searchable record of everything you've ever made - the "which prompt was that again" problem, solved with xlsx.

How it works

Each image in the incoming batch becomes a row: positive/negative prompt, model, seed, steps, CFG, extra settings, thumbnail, note, sampler, scheduler. Workbooks live in a promptDB/ folder inside the custom node directory (the pack ships Anime Style.xlsx and Photography.xlsx as examples). One workbook = one category; each row gets an auto-incrementing ID, and thumbnails are embedded in the sheet plus kept as sidecar files so the gallery can display them fast.

The feature that makes this genuinely useful is auto_extract (on by default). Instead of making you wire every field in by hand, the node walks your workflow graph backward from the images input and figures out the sampler settings itself - it even distinguishes your main sampler (the one starting from an EmptyLatentImage at denoise 1.0) from a refiner, logging the main config into the main columns and the refiner as a summary in extra_settings. Any field you connect manually always overrides the auto-extracted value. It's the rare automation that actually matches how people build these graphs, and it means you can drop the node in, connect images, and get useful rows on the first run.

There's also a SAVE / BYPASS toggle (the mode input) - flip to BYPASS and the node stops logging and just passes images through, without you ripping it out of the graph. And a thumbnail_size control so your workbook doesn't balloon to 100 MB after a few hundred rows (the embedded images are capped at 128 px for file-size reasons; the gallery's on-disk thumbnails are separate and can be bigger).

Inputs and outputs

Required: images (the batch), positive_prompt, excel_path, thumbnail_size, mode, auto_extract. Optional: negative_prompt, model_name, seed, steps, cfg, sampler_name, scheduler, extra_settings, source_path - all the manual overrides, plus get_name / setnode_name for wireless. Output: images, passed straight through, so you can chain a save node after it.

Installing it

Standard pack install:

cd ComfyUI/custom_nodes
git clone https://github.com/designloves2/ComfyUI-TJ_NODE

or ComfyUI Manager → ComfyUI-TJ_NODE → restart. Needs openpyxl - auto-installed.

Common issues

If a save fails, the node retries a few times before erroring (file-lock handling for when Excel has the workbook open - close it). One quirk to know: rows use the pack's fixed column layout, and the workbook is the single source of truth shared with the Loader, so don't reorder columns manually in Excel and expect the Loader to stay sane. If you want a repeatable compare loop, pair it with Queue Loop so each iteration lands as its own row - that's the intended workflow.

Category ✨ TJ_Node/Utility

Inputs (17)

NameTypeDefaultDescription
imagesIMAGE
positive_promptSTRING
excel_pathSTRING
thumbnail_sizeINT25616–512
modeBOOLEANtrue
auto_extractBOOLEANtrue
negative_promptoptSTRING
model_nameoptSTRING
seedoptINT00–18446744073709550000
stepsoptINT80–10000
cfgoptFLOAT1.00–100
sampler_nameoptSTRINGeuler
scheduleroptSTRINGsimple
extra_settingsoptSTRING
noteoptSTRING
get_nameoptCOMBO(none)1 options: (none)
setnode_nameoptSTRINGPromptDB

Outputs (1)

NameTypeDescription
imagesIMAGE