Nodes/ComfyUI-BCNodes/Caption Audit
ComfyUI Node

Caption Audit

Audit a LoRA caption set for tokens fused with the trigger word. Point 'directory' at a folder of images + same-named .txt captions; the audit runs there and the report card renders inside the node. The primary measure is document frequency — in how many captions a term appears at least once, across words, phrases and whole comma segments. A term near 100% cannot be prompted in or out at inference: the model cannot tell it apart from the trigger. This reads .txt files only, never the images. Every flagged term has two possible causes needing opposite fixes, so the card ends with the question you have to answer by looking at the pictures. Wire 'critical' into a gate to stop a training workflow before it starts.

By 0xBeycan·Created 3 days ago·Updated a day ago· 0
Caption Audit
    • report_image
    • report_text
    • report_json
    • critical
    • warning
    ◄directory►
    ◄trigger►
    ◄class_words►
    ◄fuse►
    ◄critical_threshold0.85►
    ◄warn_threshold0.60►
    ◄info_threshold0.35►
    ◄ngram_max3►
    ◄no_stopwordsfalse►
    ◄recursivefalse►
    ◄table_rows12►
    ◄images_dir►
    CategoryBCNodes/analysis

    Inputs (12)

    NameTypeDefaultDescription
    directorySTRINGFolder holding the caption set: images plus .txt sidecars sharing each image's basename. Empty = ComfyUI's working directory.
    triggerSTRINGThe trigger word this LoRA is supposed to own. Leave empty to have it inferred from the captions — the card marks that [INFERRED], and an inferred guess is worth checking.
    class_wordsSTRINGComma-separated class words, e.g. 'woman, car'. Shown as EXPECTED and never flagged: they are supposed to be everywhere. Coverage is measured and shown per word — one you declare but never wrote into the captions is a WARNING, not a silent pass.
    fuseSTRINGComma-separated attributes you WANT welded to the trigger, e.g. 'red scarf'. Covers the phrase and its fragments, shown as INTENDED, excluded from the critical count. Keeps its row even at 0%, so a --fuse that no longer matches your captions is visible rather than inert.
    critical_thresholdFLOAT0.850.05–1Document frequency at or above which a term counts as fused with the trigger.
    warn_thresholdFLOAT0.600.05–1Strong bias: will bleed into unrelated prompts.
    info_thresholdFLOAT0.350.01–1Below this a term is not reported at all.
    ngram_maxINT31–5Longest phrase analysed. Phrases never cross a comma, so tag lists produce no phantom n-grams.
    no_stopwordsBOOLEANfalseOff (default) hides function words like 'a' / 'with' from the flag list. On shows everything.
    recursiveBOOLEANfalseDescend into subdirectories.
    table_rowsINT121–60Rows in the card's term table. This is the only input that changes the card's size — the canvas is otherwise fixed, so the node does not resize between runs. Unused rows show an em dash. Terms you declared always keep a row here.
    images_diroptSTRINGWhere the images live, when captions are kept in a separate folder. Empty = alongside the captions; with no images anywhere the audit runs in caption-only mode.

    Outputs (5)

    NameTypeDescription
    report_imageIMAGE—
    report_textSTRING—
    report_jsonSTRING—
    criticalINT—
    warningINT—