🪠️ WWAA Advanced Text File Reader
Feed a text file into your prompt, one line at a time
- current_line_text
- current_line_number
- total_lines
- remaining_lines
The WWAA Advanced Text File Reader is the node you grab when you have a list of prompts sitting in a .txt file and want ComfyUI to walk through it automatically, feeding one line into your CLIP Text Encoder at a time. That's the whole job, and it's genuinely handy for batch work: write your prompts in any editor, save them to a file, and let the workflow chew through them without you pasting text between runs.
It's made by the team at WeirdWonderfulAI.Art (Reddit's Wwaa-2022), as part of their WWAA-CustomNodes pack - the same folks who ship the Image Batch Loader and the LLM Prompt To Text File node. Those three are designed to work together: one writes prompt lines to a file, this one reads them back out.
How it works
The node is stateful. Give it a file_path, and on the first run it loads the file, splits it into lines, and remembers where it is. Every subsequent run advances to the next line and returns it - unless you hit reset_counter, which jumps back to the start (starting_index if you set one). Because it needs to keep stepping on every run, it reports itself as always-changed, so ComfyUI re-executes it even when nothing else in the graph changed. That's also why you'll see it in the queue when you think you didn't touch it.
Three traversal_mode options: forward walks lines top to bottom and wraps around at the end; reverse does the opposite; random draws lines without repeating any until you've seen them all, then reshuffles. skip_lines (0–10) jumps ahead extra lines each step, and hold_current_text keeps returning the same line so you can inspect or reuse it while you fiddle with other nodes.
The outputs are current_line_text (feed this straight into a CLIPTextEncode positive prompt), plus current_line_number, total_lines, and remaining_lines for progress tracking or conditional logic.
The inputs that matter
file_path- absolute path to your text file. Onreload_fileor when the path changes, it rescans the file, so edits pick up next run.traversal_mode-forwardis what you want 90% of the time.reset_counter- flip this toTrueonce to restart from the top (orstarting_index).hold_current_text- keep the current line frozen for a few runs.
Installing it
This ships in the WWAA-CustomNodes pack, so install the pack, not the node:
cd ComfyUI/custom_nodes
git clone https://github.com/hgabha/WWAA-CustomNodes
Restart ComfyUI. Easier: ComfyUI Manager → search "WWAA Custom Nodes" → Install → restart. It lives in the 🪠️ WWAA/String menu. No model files, no API keys, and the pack's requirements.txt claims nothing beyond what ComfyUI already ships.
Where people get burned
Two things trip people up. First, the state: because it remembers its position, re-running a workflow continues from where you left off - if you expect it to start over every run, you'll wonder why it's skipping lines. Hit reset_counter (or toggle reload_file) to force a clean start. Second, the same "missing node" song and dance the ComfyUI ecosystem is known for: if any of the pack's nodes don't appear, it's usually the install/restart dance, not this node - the image half of the pack imports OpenCV at module load, so a ComfyUI Python environment without opencv can fail to register the whole pack. If everything under 🪠️ WWAA is missing, check for that first.
Beyond that it's about as simple as file-reading gets: point it at a file, wire current_line_text into your encoder, and run the batch.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| file_path | STRING | — | |
| traversal_mode | COMBO | forward | 3 options: forward, reverse, random |
| skip_lines | INT | 00–10 | — |
| reset_counter | BOOLEAN | false | — |
| reload_file | BOOLEAN | false | — |
| hold_current_text | BOOLEAN | false | — |
| starting_indexopt | INT | 0 | — |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| current_line_text | STRING | — |
| current_line_number | INT | — |
| total_lines | INT | — |
| remaining_lines | INT | — |