Nodes/WWAA-CustomNodes/🪠️ WWAA Advanced Text Reader
ComfyUI Node

🪠️ WWAA Advanced Text Reader

The in-memory twin that cycles lines of pasted text into your prompt

By hgabha·Created 2 years ago·Updated 6 months ago· 38
🪠️ WWAA Advanced Text Reader
    • current_line_text
    • current_line_number
    • total_lines
    • remaining_lines
    text_input
    traversal_modeforward
    skip_lines0
    reset_counterfalse
    hold_current_textfalse
    starting_index0

    The WWAA Advanced Text Reader is the version of the Advanced Text File Reader for people who don't want to touch a file system. Instead of pointing it at a .txt file, you paste your multi-line prompt list directly into the node's text_input box, and it walks through one line at a time - forward, reverse, or random - feeding current_line_text into your CLIP Text Encoder. Same state machine, no file path.

    It's part of WWAA-CustomNodes from WeirdWonderfulAI.Art. If your prompt variations live in a text widget rather than on disk, this is the cleaner fit: edit the box, and the node reloads automatically because it detects that the input text changed. The file-based version (WWAA_AdvancedTextFileReader) exists for when you want prompts persisted in a real file - say, one produced by the pack's LLM Prompt To Text File node - but for casual batch prompting, pasted text is often the least ceremony.

    How it works

    On first run it splits text_input into lines, trims each, and remembers its position. Each subsequent run advances: forward walks down and wraps at the end, reverse walks up, random draws without repeating a line until you've seen them all, then reshuffles. skip_lines (0–10) jumps extra lines per step, reset_counter starts over (honoring starting_index), and hold_current_text freezes the current line for a few runs while you inspect the rest of the graph. It reports itself as always-changed, so ComfyUI re-executes it every pass - that's required for the stepping to work.

    Outputs are the same quartet as the file reader: current_line_text, current_line_number, total_lines, and remaining_lines. Wire current_line_text into a CLIPTextEncode and each run of the workflow generates from the next line.

    Inputs that matter

    • text_input - paste your multiline list here; edits trigger a reload.
    • traversal_mode - forward for normal sequencing.
    • reset_counter - restart from the top (or starting_index).
    • hold_current_text - keep the line fixed while you debug.

    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, no extra dependencies declared by the pack.

    Gotchas

    The same statefulness caveat as its file sibling: rerunning continues from where you stopped, so if your batch seems to start mid-list, hit reset_counter. And note it counts every line you paste including blank ones (the code splits on \n without filtering empties), so if your list has separator blank lines, total_lines will be higher than your actual prompt count. For the rest, it's a paste-and-go prompt cycler - arguably the most approachable node in this string family.

    Category🪠️ WWAA/String

    Inputs (6)

    NameTypeDefaultDescription
    text_inputSTRING
    traversal_modeCOMBOforward3 options: forward, reverse, random
    skip_linesINT00–10
    reset_counterBOOLEANfalse
    hold_current_textBOOLEANfalse
    starting_indexoptINT0

    Outputs (4)

    NameTypeDescription
    current_line_textSTRING
    current_line_numberINT
    total_linesINT
    remaining_linesINT