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.
Caption Statistics
- text
- names
- dataset
- report
- phrases
- flagged
- consistency
- coverage
◄subject[trigger]►
◄min_words5►
◄max_words0►
◄top40►
CategoryWAS Suite/Dataset
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| subject | STRING | [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_words | INT | 50–1000 | 0 = off; 5 = a caption under 5 words is flagged short and lowers consistency. |
| max_words | INT | 00–10000 | 0 = off; 75 = a caption over 75 words is flagged long, which is about where a CLIP text encoder cuts a caption off. |
| top | INT | 401–1000 | Most phrases in the table and the phrases output, most frequent first. 40 = the forty phrases in the most captions. |
| textopt | STRING,ARRAY | The 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. | |
| namesopt | ARRAY,STRING | One 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. | |
| datasetopt | WAS_DATASET | Unwired = 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)
| Name | Type | Description |
|---|---|---|
| report | STRING | The figures as plain text: counts, word lengths, consistency, subject coverage, the phrase table and every flagged caption with its reasons. |
| phrases | ARRAY | The phrases or tags in two or more captions, most frequent first, up to top. Empty when no phrase repeats. |
| flagged | ARRAY | Names of the captions flagged empty, short, long, identical or missing the subject, in caption order. Empty when none is. |
| consistency | FLOAT | 0 to 1; 1 = even lengths, no repeats, nothing short. Length spread costs up to half; identical and short captions cost their share. |
| coverage | FLOAT | 0 to 1: share of captions holding the subject; 1 = every caption. 0 when subject is empty. |