Nodes/WAS Node Suite v3/Caption Statistics
ComfyUI Node Runs on cloud

Caption Statistics

Measure a set of captions, from a text list or a dataset, before training: word counts, repeats, short or overlong captions, how many name the subject, and the phrases most of them share, which a LoRA learns to lean on. Hands on a report, the phrase list, the flagged captions and two 0 to 1 scores.

By WASasquatch·Created 4 years ago·Updated 3 days ago· 1,900
Caption Statistics
  • text
  • names
  • dataset
  • report
  • phrases
  • flagged
  • consistency
  • coverage
◄subject[trigger]►
◄min_words5►
◄max_words0►
◄top40►
CategoryWAS Suite/Dataset

Inputs (7)

NameTypeDefaultDescription
subjectSTRING[trigger]What every caption should name: `[trigger]`, `woman`, `ohwx man`. Case ignored, whole words. Phrases holding it leave the phrase table; coverage counts captions holding it. Empty = no subject check.
min_wordsINT50–10000 = off; 5 = a caption under 5 words is flagged short and lowers consistency.
max_wordsINT00–100000 = off; 75 = a caption over 75 words is flagged long, which is about where a CLIP text encoder cuts a caption off.
topINT401–1000Most phrases in the table and the phrases output, most frequent first. 40 = the forty phrases in the most captions.
textoptSTRING,ARRAYThe captions, one per picture, such as Load Text Batch's text. A LIST of captions works too. A blank entry counts as an empty caption. Ignored while dataset is wired.
namesoptARRAY,STRINGOne name per caption, in the captions' order, such as Load Image Batch's filename_list, so flagged captions are named. A caption with no name is shown by its position, counted from 0. Ignored while dataset is wired.
datasetoptWAS_DATASETUnwired = captions come from text; wired = the captions and names of a dataset, such as Load Dataset's, as edited upstream. A picture with no caption counts as an empty one. text and names are ignored while it is wired.

Outputs (5)

NameTypeDescription
reportSTRINGThe figures as plain text: counts, word lengths, consistency, subject coverage, the phrase table and every flagged caption with its reasons.
phrasesARRAYThe phrases or tags in two or more captions, most frequent first, up to top. Empty when no phrase repeats.
flaggedARRAYNames of the captions flagged empty, short, long, identical or missing the subject, in caption order. Empty when none is.
consistencyFLOAT0 to 1; 1 = even lengths, no repeats, nothing short. Length spread costs up to half; identical and short captions cost their share.
coverageFLOAT0 to 1: share of captions holding the subject; 1 = every caption. 0 when subject is empty.