🪠️ WWAA LLM Prompt To Text File
Batch LLM captions into one text file, ready for Flux testing
- log_output
The WWAA LLM Prompt To Text File node (class WWAA_ImageToTextFile) exists for one specific, useful job: collecting captions generated for many images and appending them all into a single text file, one per line. The author's stated reason for building it: they needed a big batch of prompts to feed into Flux to test LoRA performance. Load images with the WWAA Image Batch Loader, caption each one with an LLM/vision model, and this node writes every prompt to the same file - which you then hand to a model or a tester.
It's part of WWAA-CustomNodes from WeirdWonderfulAI.Art, and it's the sibling of Prompt Writer with a different philosophy: Prompt Writer creates one .txt per image (for training folders); this one creates one shared file (for batched prompt testing). Pick based on what you're feeding downstream.
How it works
You give it text (multiline) and an output_path; optionally filename (default output.txt) and prefix_text. It cleans the text before writing: converts line breaks to spaces, strips special characters (keeping letters, numbers, spaces, commas, periods, quotes, hyphens, semi-colons), collapses runs of whitespace to single spaces, and trims. Then it appends the cleaned line to the file - creating it if needed, or adding a newline before the entry if the file already exists. Prefix text, if given, gets prepended to each entry.
That cleaning is a feature, not a bug: LLM captions come out with stray newlines and markup, and this normalizes them so each line in the output file is one clean prompt. The output is a log_output string - a detailed account of the parameters, cleaning, and file operation, which you'll want to glance at the first few runs to confirm entries are landing where you expect.
Inputs that matter
text- the caption/prompt for the current image.output_path- where the file lives (defaults to ComfyUI's output dir when empty).filename- the shared target file.prefix_text- prepended to each entry (handy for a common style tag).
Installing it
It's in the pack:
cd ComfyUI/custom_nodes
git clone https://github.com/hgabha/WWAA-CustomNodes
Restart ComfyUI. Or ComfyUI Manager → search "WWAA Custom Nodes" → install → restart. It's under 🪠️ WWAA/String. No models to download.
Gotchas
Because it always appends, the file grows across runs - if you re-run the whole batch for a fresh test, old entries stay unless you delete the file (the node won't truncate it for you; that's what Prompt Writer's overwrite is for, and it doesn't apply here). And the character filter is strict: if you rely on colons, exclamation marks, or unicode in your prompts, they'll be stripped. That's fine for Flux-style tag prompts but surprising if you're feeding creative prose. Used for its intended batch-LoRA-testing loop, it turns a folder of images into a ready prompt file with essentially zero ceremony.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| text | STRING | — | |
| output_path | STRING | — | |
| filenameopt | STRING | output.txt | — |
| prefix_textopt | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| log_output | STRING | — |