πΌοΈ+π Load Text-Image Pairs (List)
A whole caption dataset as parallel lists
- image_input
- image_list
- string_list
- image_path_list
- image_filename_list
- total_count
This is the batch version of this pack's Load Text-Image Pair (Single) node. Instead of picking one image/caption pair out of a dataset folder, it hands you the entire dataset at once as parallel lists - every image, every matching caption, rotated so the pair your seed points at comes first.
How it works
Same basename-matching logic as the Single node - image1.png pairs with image1.txt (or whatever extension text_format_extension is set to) - but the output is a full set of lists rather than one item. seed still matters here, but as a rotation point rather than a strict pick: it's where the returned lists start from, cycling through the rest of the set after that. force_reload bypasses whatever's cached from disk, which you want after editing caption files and re-running without restarting ComfyUI. limit_count caps how many pairs come back at all (0 means everything).
The inputs and outputs that matter
seed- the rotation starting point into the dataset.folder_path- the dataset folder, used only whenimage_input/text_inputaren't connected.force_reload- forces a fresh read from disk instead of using a cached result.limit_count(optional, default0) - cap the number of pairs returned;0= no cap.image_input/text_input(optional) - connections that take priority overfolder_path.text_format_extension(optional, defaulttxt) - the caption file extension to match.
Outputs: image_list, string_list, image_path_list, image_filename_list, and total_count.
How to install it
Via ComfyUI Manager: search ComfyUI-mnemic-nodes, install, restart. Manually:
cd ComfyUI/custom_nodes
git clone https://github.com/MNeMoNiCuZ/ComfyUI-mnemic-nodes
Restart ComfyUI. No model downloads or extra dependencies.
Common issues & troubleshooting
Mismatched counts between images and captions. Same caveat as the Single node, just at scale - if a caption file is missing for one image in the set, that pair still comes back but with an empty string in string_list at that position rather than the whole load failing. Worth a quick scan of the lists (or total_count against a manual folder count) before trusting a large dataset is fully paired.
Editing captions and not seeing the changes. This is what force_reload is for - leave it off during normal use and it's fine, but if you've just hand-edited a .txt file and re-queue without seeing the update, that's a caching issue force_reload fixes.
Loading way more than you meant to. For a large dataset, set limit_count while you're still testing a downstream pipeline - there's no reason to pull ten thousand images into memory just to check that your batch captioning or metadata-stripping logic works on the first fifty.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| seed | INT | 00β18446744073709550000 | The seed determines the starting point for selecting pairs. Set to 'increment' in the workflow options to cycle through all available pairs sequentially. |
| folder_path | STRING | Path to a folder containing image and text files with matching basenames. This is used only if image_input and text_input are not connected. | |
| force_reload | BOOLEAN | false | If true, forces a reload of data from disk, bypassing the cache. |
| image_inputopt | IMAGE | A single image or a list/batch of images. This input has priority over the folder_path. | |
| text_inputopt | STRING | A single text string or a list of strings. This input has priority over the folder_path. | |
| limit_countopt | INT | 00β10000 | The maximum number of pairs to return in the output lists. If set to 0, all found pairs will be returned. |
| text_format_extensionopt | STRING | txt | The file extension for the text files to look for (without the dot). |
Outputs (5)
| Name | Type | Description |
|---|---|---|
| image_list | IMAGE | A list of all images from the dataset, rotated so that the selected image is the first item in the list. |
| string_list | STRING | A list of all text strings from the dataset, rotated so that the selected text is the first item in the list. |
| image_path_list | STRING | A list of full absolute paths of all images. |
| image_filename_list | STRING | A list of filenames (without extension) of all images. |
| total_count | INT | The total number of pairs found in the dataset. |