Nodes/ComfyUI_MieNodes/Summary Text Files ๐Ÿ‘
ComfyUI Node

Summary Text Files ๐Ÿ‘

Dump every caption in a folder into one blob for review

By MieMieeeeeยทCreated about a year agoยทUpdated 21 days agoยท 225
Summary Text Files ๐Ÿ‘
  • trigger_signal
  • log
โ—„directoryX://path/to/filesโ–บ
โ—„add_separatortrueโ–บ
โ—„save_to_filefalseโ–บ
โ—„file_extension.txtโ–บ
โ—„summary_file_namesummary.txtโ–บ

SummaryTextFiles reads every text file in a folder and concatenates their contents into one string. That's the mechanism. The point of it is to get your whole set of captions in front of your eyes - or in front of an LLM - in a single pass, so you can actually review what you're about to train on.

It's part of ComfyUI-MieNodes, MieMieeeee's utility pack, sitting in the caption-tools group alongside the rest of the LoRA-prep kit.

Why you'd want it

Captions are scattered across dozens of tiny .txt files, one per image, which is a terrible format for spotting problems. You can't tell at a glance that half your set says "a woman" and the other half says "1girl," or that a stray tag snuck into ten files. The KB hammers that captioning quality makes or breaks a LoRA, and that the rule is describe-what-varies, leave-what's-fixed-undescribed - but you can only enforce that if you can see the whole set at once.

SummaryTextFiles gives you that. Point it at the caption folder, run it, and pipe the combined output into a ShowAnything node to read the lot. Or feed it into one of the pack's LLM prompt nodes and have a model flag inconsistencies for you. It's the "read my dataset back to me" node.

How it works

  • directory - the folder of text files.
  • add_separator (boolean, default on) - inserts a divider between each file's contents so the concatenated blob is readable and you can tell where one caption ends and the next begins. Leave it on for review; turn it off if you want a raw run-together dump.
  • save_to_file (boolean, default off) - write the combined result to disk as well as passing it downstream.
  • file_extension (optional, default .txt) - which files to read.
  • summary_file_name (optional, default summary.txt) - the filename used when save_to_file is on.

The single output is log (STRING) - the concatenated content. There's also an optional trigger_signal (*) for forcing run order relative to other file nodes.

Installing it

Install the whole pack. ComfyUI Manager โ†’ search ComfyUI-MieNodes (ComfyUI_MieNodes) โ†’ install โ†’ restart. Or by hand:

cd ComfyUI/custom_nodes
git clone https://github.com/MieMieeeee/ComfyUI-MieNodes

then restart. No model download. Nodes appear under the sheep-emoji ๐Ÿ‘ MieNodes menu.

Common issues

It concatenates, it doesn't literally summarize. The name oversells it a touch - on its own the node just glues the files together (with separators). The actual "summarize" step is when you feed that blob to an LLM. If you were expecting a one-paragraph digest straight out of the node, that's not what it does; wire it into a prompt node for that.

Big datasets make a big string. A few thousand captions concatenated is a lot of text. If you're piping it into an LLM node, mind the model's context limit - you may need to review in chunks rather than dumping 10,000 captions at once.

Nothing came out? Almost always the file_extension doesn't match your files (captions saved as .caption instead of .txt, say), or the directory path doesn't resolve on the ComfyUI host. Check both, and use GetAbsolutePath if you're unsure where a relative path is landing.

Category๐Ÿ‘ MieNodes/๐Ÿ‘ Caption Tools

Inputs (6)

NameTypeDefaultDescription
directorySTRINGX://path/to/filesโ€”
add_separatorBOOLEANtrueโ€”
save_to_fileBOOLEANfalseโ€”
file_extensionoptSTRING.txtโ€”
summary_file_nameoptSTRINGsummary.txtโ€”
trigger_signalopt*โ€”

Outputs (1)

NameTypeDescription
logSTRINGโ€”