ComfyUI Node Runs on cloud
Load Text Batch
Read a folder of text files, such as a training set's captions, as one LIST and as a STRING list that runs the graph below once per file, each with its name. Wired filenames read the caption beside each image instead, in the images' order, ready to edit and save back by name.
Load Text Batch
- filenames
- texts
- names
- text
- name
- count
- missing
- folder
◄folder▾►
◄pattern*.txt►
◄extension.txt►
CategoryWAS Suite/IO
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| folder | COMBO | Which folder to read. A bare 'input', 'output' or 'temp' is that folder itself; 'training/cats [input]' is that folder below it. Folders under paths.allow_read in config.yaml are listed under their own names. A wired path, such as `E:\images`, works too. | |
| pattern | STRING | *.txt | Which files to read when filenames is not wired: `*.txt` = every .txt in the folder; `**/*.txt` = in its subfolders too; `cat_*.txt` = only those named that way. Ignored while filenames is wired. |
| extension | STRING | .txt | Ending added to each wired name: `.txt` reads cat.txt for `cat`; `.caption` reads cat.caption. An image ending on the name, as `cat.png`, is dropped first. Ignored while filenames is not wired. |
| filenamesopt | ARRAY,STRING | One name per text to read, as filename_list from Load Image Batch: `cat` reads cat.txt, `set_b/cat` reads set_b/cat.txt. A name with no readable file gives an empty text in its place, so entry 3 always belongs to name 3. Several lines are several names. |
Outputs (7)
| Name | Type | Description |
|---|---|---|
| texts | ARRAY | Every text on one wire, in order, for Text List Get, Text List Slice and Text List Length. Entry 3 here is the text of name 3 in names. |
| names | ARRAY | The name each text came from, on one wire and in the same order: the path below the folder without its ending, as `cat` or `set_b/cat`, the form Image Save and Save Text File take as filenames. |
| text | STRING | The same texts as a STRING list, so the graph below runs once per file: wire it into a text edit, then into Save Text File's text. |
| name | STRING | The name that goes with each run of text. Wire it into Save Text File's filenames to write each edited text back under its own name. |
| count | INT | How many entries both lists hold: files read, or names wired. |
| missing | INT | 0 = every wired name had a readable file; 3 = three names got an empty text. Always 0 while filenames is not wired. The log names each file that was unreadable or not UTF-8. |
| folder | STRING | The picked folder below its root with a trailing slash: `training/tus [input]` = `training/tus/`; a root itself = empty. Wire it into Save Text File's filename_prefix to write back into the same folder. |