πΌοΈ+π Load Text-Image Pair (Single)
Spot-check one caption/image pair from a dataset
- image_input
- image_single
- string_single
- image_path_single
- image_filename_single
- total_count
If you've got a folder set up dataset-style - image1.png sitting next to image1.txt, same basename, the standard convention for LoRA and finetune captioning - this node is the spot-check tool. It loads exactly one pair, picked by index, and hands you both halves plus the bookkeeping you need to know where you are in the set.
How it works
Point folder_path at the dataset and it matches image files to text files by basename. seed is the index - pick which pair comes back. It also accepts image_input and text_input directly as connections from elsewhere in the graph, and those take priority over folder_path whenever they're wired up, which matters if your pairs are being produced earlier in the workflow rather than sitting on disk. text_format_extension controls which caption file extension it looks for (default txt), useful if your captions use something else like .caption.
The inputs and outputs that matter
seed- the index of the pair to load.folder_path- the dataset folder. Only used ifimage_input/text_inputaren't connected.image_input/text_input(optional) - direct connections, overridefolder_pathwhen present.text_format_extension(optional, defaulttxt) - the caption file extension to match.
Outputs: image_single, string_single (the matched caption), image_path_single, image_filename_single, and total_count (how many pairs exist in the whole dataset).
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 - it's reading local files.
Common issues & troubleshooting
A pair comes back with an empty caption. Matching is strictly by basename - image1.png needs an image1.txt (or whatever extension you've set) sitting in the same folder. A missing or misnamed caption file just produces an empty string_single for that pair rather than an error, so a quiet mismatch can slip through unless you're specifically checking for it.
The output looks wrong even though folder_path seems right. Check whether image_input or text_input is wired up - if either is connected, folder_path is silently ignored entirely, which is an easy thing to forget once a graph has grown a few nodes.
Why this over just loading the folder directly? It's the right tool specifically for QC - stepping through a dataset one caption at a time to catch bad, truncated, or missing captions before you burn GPU hours on a training run that inherited them. For processing the whole dataset in one shot instead of one pair at a time, this pack's sibling node Load Text-Image Pairs (List) is the one to reach for.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| seed | INT | 00β18446744073709550000 | The index of the pair to load. |
| 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. | |
| 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. | |
| text_format_extensionopt | STRING | txt | The file extension for the text files to look for (without the dot). |
Outputs (5)
| Name | Type | Description |
|---|---|---|
| image_single | IMAGE | The single image selected by the seed. |
| string_single | STRING | The text string that is paired with the selected image. |
| image_path_single | STRING | The full absolute path of the selected image. |
| image_filename_single | STRING | The filename (without extension) of the selected image. |
| total_count | INT | The total number of pairs found in the dataset. |