- text_list
- filename_text
- count
It assembles a text batch so you don't have to
PD_TextListPack (display name "PD文本列表打包", "pack text list") is the front door of the pack's text-batch pipeline. You drop up to five text contents into text_1 through text_5, give each an optional filename, and it hands you back a proper text list, a matching newline-joined filename_text string, and a count. You can also feed in a pre-existing list via input_text_list and it merges with the manual slots.
Why bother? ComfyUI's text nodes are famously one-string-at-a-time, and the moment you want to save ten captions, sort a batch, or drive a loop you need a list. This node is the "many boxes in, one list out" step - the exact repetition-fighting plumbing the KB describes in comfyui-node-plumbing.md. Pair it with the pack's sort node (PD_TextListSort) and the folder loader, and you have a mini batch pipeline with zero Python.
How it works
Straight from the source: it collects the five optional text_N/filename_N pairs, filters out empty text, merges in anything from input_text_list, and then pads the filename list to match - any text without a filename gets a default file_N.txt. The filenames are joined with newlines into filename_text, and the node returns the list plus its length.
The subtle part: text_list is a real list output (OUTPUT_IS_LIST). That's deliberate - it's meant to feed other list-aware nodes in the pack. But it's also the thing that will confuse you the first time you wire it into a plain text node and get a type error.
Inputs and outputs
text_1throughtext_5- the contents. All optional, multiline.filename_1throughfilename_5- one per text. Leave blank and you getfile_N.txt.input_text_list- feed an existing list in here to merge with the manual slots.input_filename_text- newline-joined filenames to go with that list.- Outputs:
text_list(list),filename_text(newline string),count(int).
Installing it
Ships in Comfyui_PDuse:
cd ComfyUI/custom_nodes
git clone https://github.com/7BEII/Comfyui_PDuse.git
cd Comfyui_PDuse
pip install -r requirements.txt
Or search "Comfyui_PDuse" in ComfyUI Manager and restart.
The traps
First and biggest: a list is not a string. The text_list output won't plug into an ordinary STRING socket - you need a list-capable consumer, or run it through the pack's unpack node (PD_TextListUnpack) to pull one item out. Second, the filename-count padding is silent: type four texts and forget a filename, and you get a default name instead of an error, which can produce surprising filenames when you save. Third, if every slot is empty the node returns [""] and count = 0 - a technically valid empty list that some downstream nodes will cheerfully process as one blank item. Fill at least one slot and you're fine. For assembling a clean batch before sorting or saving, it does the job with no fuss.
Inputs (12)
| Name | Type | Default | Description |
|---|---|---|---|
| text_1opt | STRING | — | |
| filename_1opt | STRING | — | |
| text_2opt | STRING | — | |
| filename_2opt | STRING | — | |
| text_3opt | STRING | — | |
| filename_3opt | STRING | — | |
| text_4opt | STRING | — | |
| filename_4opt | STRING | — | |
| text_5opt | STRING | — | |
| filename_5opt | STRING | — | |
| input_text_listopt | STRING | 可选:直接输入text_list列表(会与单独输入的文本合并) | |
| input_filename_textopt | STRING | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| text_list | STRING | — |
| filename_text | STRING | — |
| count | INT | — |