JDCN_BatchImageLoadFromList
Page through an image path list in batches
- Images
- ImageNames
- ImagePaths
- Index
JDCN_BatchImageLoadFromList is the "page through a list" version of the image loader: instead of scanning a folder itself, it takes a list of paths from somewhere else - JDCN_AnyFileList, a text file, another pack - and loads them in batches, one batch per queue run. If you have 200 images and want to process them 10 at a time across 20 runs, this is the node that turns "a big list" into "the next chunk."
How it works
Four inputs:
PathList- the paths to load from (list-input).Index- which batch to load, 1-based. This is the key mental shift: Index is a page number, not an element offset. WithBatchSize = 5,Index = 1loads items 1β5,Index = 2loads 6β10. Bump Index, re-queue, get the next page.BatchSize- items per batch.BatchDirection-TOPTOBOTTOM(front to back),BOTTOMTOTOP(back to front), orRANDOM(random sample ofBatchSizefrom the list).
Outputs: Images (the loaded tensors), ImageNames, ImagePaths (for exactly the items in this batch), and Index echoed back.
How to use it
The intended loop is the standard "chunked processing" pattern:
JDCN_AnyFileListscans your folder βPathList.- Feed
PathListintoJDCN_BatchImageLoadFromListwith yourBatchSize. - Queue with
Index = 1, then2, then3- each run loads the next slice of the list. ImageNames/ImagePathslet downstream nodes name outputs per batch.
RANDOM direction is a nice touch - random BatchSize-sized slices of your list, handy for variation runs where you don't care about order.
Two honest notes
The loaders expect paths to be real, loadable images. Unlike the path-listing nodes, this one actually opens the files - bad paths get skipped with a console error. And like BatchImageLoadFromDir, each image comes back as its own tensor in a list, so downstream consumers need to handle a list of IMAGE, not a single stacked batch.
Also, Index interacts with BatchSize in the paginated way described above - if you read "Index" as a per-element offset you'll get confused. The pack's own documentation hammers this exact point with the a/b/c/d example: Index = 2, BatchSize = 2 over a 4-element list returns c and d, not b and c.
Installing it
Part of ComfyUI-JDCN:
- ComfyUI Manager β Install Custom Node β search JDCN β install ComfyUI-JDCN β restart.
- Or:
cd ComfyUI/custom_nodes
git clone https://github.com/daxcay/ComfyUI-JDCN.git
cd ComfyUI-JDCN
pip install -r requirements.txt
Restart; under π΅ JDCN π΅. Only dependency is piexif, no models.
Common issues
An Index past the end of the list returns an empty batch rather than an error - if you see "no images," check whether you've paged past the last chunk. BatchSize = 0 is accepted by the schema but selects nothing meaningful, so keep it β₯ 1. And if you're pointing it at a PathList that came from a text file, make sure that list is actually a list of paths, one per line - a common copy-paste failure is feeding it raw filenames with no directory prefix.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| PathList | STRING | β | |
| Index | INT | 11β9999 | β |
| BatchSize | INT | 50β9999 | β |
| BatchDirection | COMBO | 3 options: TOPTOBOTTOM, BOTTOMTOTOP, RANDOM |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| Images | IMAGE | β |
| ImageNames | STRING | β |
| ImagePaths | STRING | β |
| Index | INT | β |