Image Directory Reader
Batch a whole folder with captions and metadata intact
- image
- image_info
- file_stem
- caption
- path_source
- path
Image Directory Reader loads a folder of images - and their sidecar captions and embedded metadata - as aligned lists. Point it at a subdirectory under ComfyUI's input or output, and for every image you get the image itself, its reconstructed image_info (parsed from A1111-style infotext), its extensionless filename, and any same-name .txt caption. Four parallel lists, one node, sorted and sliced reproducibly.
The problem it solves
ComfyUI has an ordinary Load Image node, but it's a single-file affair, and batching a whole directory is where people end up building little workflows or reaching for script-heavy packs. If your job is "regenerate a folder of images from their own metadata," or "run a detail pass over 40 crops," or "turn a batch of tagged images into captioned outputs," you need four things per file that Load Image can't give you in one go: the pixels, the metadata, the name, and the caption. That alignment is the whole feature.
The inputs that matter
path_source-inputoroutput, the base directory.path- the relative subdirectory. The combo walks the tree, so you can pick a nested folder without typing.image_load_limit- how many files to load;0means unlimited.start_index- the sorted file index to start from, so you can process a folder in reproducible chunks across runs.
Files are selected after case-insensitive filename sorting, which makes batch selection deterministic - the same folder always yields the same order, which is what you want when results depend on "the first 12 images." The README is explicit about it, and it's a detail batch people usually learn the hard way.
The outputs, and the gotcha
Outputs are image, image_info, file_stem, and caption - all as lists - plus pass-through path_source and path (handy for wiring straight into a caption saver).
The list shape is the gotcha. A list of images isn't a batch; downstream nodes that expect batch tensors will balk, and the pack's own README points this out for its video reader too. Route through the pack's Image List To Batch (or the equivalent) when the next node wants a single batched tensor. Similarly, caption is an empty string for files with no .txt - that's your signal, not an error.
One more honest note: image_info is reconstructed and normalized from the A1111 infotext. If the images came from outside the pack's ecosystem and their metadata is malformed, the parse can be partial. Check the metadata side with the pack's debug node if things come back blank.
Installing it
Part of the ComfyUI-Info-Prompt-Toolkit pack. ComfyUI Manager - search "Info Prompt Toolkit" - or:
cd ComfyUI/custom_nodes
git clone https://github.com/kinorax/comfyui-info-prompt-toolkit.git
cd comfyui-info-prompt-toolkit
pip install -r requirements.txt
Restart ComfyUI. No model downloads. Small single-author pack (GPL-3.0) with a modest footprint - but a directory reader that keeps captions and metadata aligned is one of its most immediately useful nodes.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| path_source | COMBO | input | Base directory for path |
| path | COMBO | . | Directory path relative to selected base directory |
| image_load_limit | INT | 0 | 0 = unlimited |
| start_index | INT | 0 | Sorted file index to start from |
Outputs (6)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| image_info | IPT-IMAGEINFO | — |
| file_stem | STRING | — |
| caption | STRING | — |
| path_source | * | — |
| path | * | — |