Nodes/ComfyUI-Apt_Preset/IO_LoadTextBatch
ComfyUI Node

IO_LoadTextBatch

Cycle through a list of prompts or captions, card by card

By cardenluo·Created 2 years ago·Updated 22 days ago· 309
IO_LoadTextBatch
    • text_list
    • text_index
    • index
    • total
    text_list
    card_size120
    index0
    text_list_in

    The text member of this pack's "visualization batch loading" family - the same pattern shows up for images, audio, video, and shot data. IO_LoadTextBatch holds a list of text entries - one prompt per line, one caption per card, whatever you're managing - and displays them as a scrollable gallery you can step through with an index, rather than a single giant multiline box you have to scroll manually.

    How it works

    text_list is where the entries live, built in the widget. card_size (120–520, default 120, step 20) sets how big the cards render - a noticeably bigger range than the image/audio/video card loaders in this pack, which makes sense: a text card needs to actually show a readable chunk of a prompt or caption, not just a thumbnail. index (0–9999) selects which entry is current. There's an optional text_list_in (STRING) input, so you can feed this node a list computed elsewhere instead of typing it by hand - a natural source is IO_input_any, which splits a block of pasted text into a list, or IO_PathProcessor if what you're really cycling through is a set of filenames.

    Inputs and outputs

    • text_list - the multiline collection you're managing.
    • card_size - cosmetic card size in the gallery view.
    • index - which entry is currently selected.
    • text_list_in (optional) - feed the list in from an upstream STRING-list node.

    Outputs: text_list (the full list), text_index (the currently-selected entry), plus index and total so a downstream loop knows its position. Note there's no name_index output here the way the file-based batch loaders have - text entries don't have filenames, just content.

    How to install it

    ComfyUI Manager → search ComfyUI-Apt_Preset, install, restart. Manually:

    cd ComfyUI/custom_nodes
    git clone https://github.com/cardenluo/ComfyUI-Apt_Preset.git
    

    then run install.bat for dependencies - it's Windows-only, so on Linux/macOS run the pip install lines inside it by hand - and restart ComfyUI.

    Common issues & troubleshooting

    Reaching for this when a plain multiline text box would do. This node earns its keep once you're managing more than a handful of entries and want to visually scrub through them one at a time - for a single static prompt, a regular text node is simpler. It's built for the "batch of many prompts driving a batch of many generations" case.

    The card gallery doesn't render. As with the other visual batch loaders in this pack, the in-node gallery is a custom widget, and those are exactly what's been breaking on some packs during ComfyUI's ongoing frontend rewrite. If cards go blank after updating ComfyUI, try the legacy canvas before assuming the node broke.

    IMPORT FAILED at startup. This pack has at least one reported case in the wild of failing to import on a stock install, generally down to skipping install.bat's dependency step - which doesn't run automatically off Windows. Check the console log for the actual missing package before reinstalling.

    CategoryApt_Preset/IO_Port/batch_input

    Inputs (4)

    NameTypeDefaultDescription
    text_listSTRING
    card_sizeINT120120–520
    indexINT00–9999
    text_list_inoptSTRING

    Outputs (4)

    NameTypeDescription
    text_listSTRING
    text_indexSTRING
    indexINT
    totalINT