π¦ AK Image List Loader (Scheduler)
Images one at a time, not one giant batch tensor
- images
- filenames
The AK Image List Loader is the worker half of this pack's batch setup. It doesn't decide anything - it takes a folder, a sort order, a pattern, a start index and a count, loads exactly that slice, and hands you the images as a list. Most of the interesting behaviour is in how that list is declared, because that's what keeps a 40-image run from blowing up your VRAM.
How it works
All five of its real inputs - folder_path, sorting, file_pattern, start_index, list_size - are declared as forced inputs. In ComfyUI terms that means they show up as sockets, not widgets: you cannot type a folder path into this node. It's built to be wired from π AK Image List Scheduler (or the all-in-one AK Auto Image List Loader, which has the same logic inline), and the only knob you actually click is file_name_without_extension.
Once it has the slice, each file goes through Pillow: EXIF orientation applied, converted to RGB, scaled to float 0β1, wrapped in a tensor, and pushed into a Python list. The declaration OUTPUT_IS_LIST = (True, True) is the load-bearing line. It tells ComfyUI's execution engine to feed downstream nodes one list item per call instead of concatenating everything into a single batch. That's why a 20-image run at 3K doesn't spike VRAM the way Load Image Batch does: the images are queued, not co-resident on the GPU. It's the same list-versus-batch distinction the whole AK batch family is built on, and it's the reason this pack exists at all.
The other implementation detail worth knowing: it re-scans and re-lists the folder on every execution, and its IS_CHANGED always reports a fresh timestamp, so the engine treats it as changed every single time. Good for a batch that should keep moving; bad if you were hoping ComfyUI's cache would skip re-reading a folder you just processed.
The input that matters after the wiring
file_name_without_extension, default on. Leave it on and the filenames output gives you shot_014; turn it off and you get shot_014.png. It exists so you can wire filenames into a Save Image filename_prefix (or a text node) and get output files that match their inputs one-for-one. That's the difference between a batch you can review and a pile of ComfyUI_00042_.png.
Outputs
Two: images (an IMAGE list) and filenames (a STRING list). Wire images into the first per-image node - VAE Encode, a background remover, an upscaler, an image-to-video stage - and filenames wherever you want names. Downstream nodes run once per item, so a graph that does RMBG β upscale β save behaves like a for-loop over your folder.
Install
ComfyUI Manager, search ComfyUI-AngelosKar, install, restart. Manual:
cd ComfyUI/custom_nodes
git clone https://github.com/AngelosKar-code/ComfyUI-AngelosKar.git
# restart ComfyUI
Dependencies are torch, numpy, Pillow, aiohttp - no new packages land in your environment, since every ComfyUI install already has them. Python 3.10+.
Where people get burned
It can't be used alone. Five sockets and no widgets means a lone Image List Loader does nothing until the scheduler is wired in. If the node looks "broken" with nothing to configure, that's the design talking.
Failed files are skipped silently. The load loop catches exceptions per file, prints Failed to load <name> to the console, and moves on. Only if every file in the slice fails do you get an error. So a slice of 10 that gives you 9 images means one file is corrupt or unreadable - check the console, not the node.
Transparency doesn't survive. Images are converted to RGB, so alpha is dropped and transparent regions come out black. If your workflow is a cutout pipeline, load first and remove the background downstream, not the other way around.
Flat folders and a fixed extension list. .jpg .jpeg .png .webp .bmp .tiff .tif .gif only, no recursion. Point it at a parent folder of dated subfolders and it will cheerfully report no images.
Sorting is not free. natural gives you 2 before 10; alphabetical gives you 10 before 2. If you're processing numbered frames, natural is the one you want, and it has to match what the scheduler sent - the loader receives sorting as a string and applies it locally, so a mismatch between the two nodes' idea of order means your slices are shuffled.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| folder_path | STRING | β | |
| sorting | STRING | β | |
| file_pattern | STRING | β | |
| start_index | INT | β | |
| list_size | INT | β | |
| file_name_without_extension | BOOLEAN | true | β |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| images | IMAGE | β |
| filenames | STRING | β |