Nodes/ComfyUI-JNK-Tiny-Nodes/Image Filter Loader JNK
ComfyUI Node

Image Filter Loader JNK

Batch-load every matching image in a folder, in order

By AljnkΒ·Created about a year agoΒ·Updated 12 months agoΒ· 3
Image Filter Loader JNK
    • images
    • paths
    • total
    β—„folder_pathβ€”β–Ί
    β—„file_filter*.pngβ–Ί
    β—„sort_methodnumericalβ–Ί
    β—„use_cachefalseβ–Ί
    β—„skip_imgfalseβ–Ί

    Image Filter Loader is the batch-reader of the JNK pack: point it at a folder, give it a filename pattern, and it loads every matching image as a list, in a defined order, while also giving you each file's path and the total count. If you've got a directory of frames from a video rip, a stack of renders, or a folder of assets you want to process in one queue, this is the node that pulls them all in without dragging fifty Load Image nodes onto the canvas.

    It sits naturally alongside the pack's Save Video Images node - the README's workflow is literally "rip video to frames, process some, reassemble" - and its ordering matters for that: a frame sequence that comes back in the wrong order is a broken video. The node's numerical sort is there to handle frame_1.png, frame_2.png, ..., frame_10.png correctly (alphabetical would slot frame_10 right after frame_1). It's the little detail that separates this from a naive sorted().

    Inputs that matter

    • folder_path - the directory to scan (filesystem path, not the ComfyUI input dropdown).
    • file_filter - a glob pattern, default *.png. *.png, *.jpg, or render_*.png all work.
    • sort_method - numerical (extracts digits for sorting; filenames with no digits sort as 0) or alphabetical.
    • use_cache - keep the loaded images in memory across runs so re-queues don't re-read the disk.
    • skip_img - don't actually decode the images; return only paths and count. Useful for building a file list without the memory cost.

    Outputs: images (a list of IMAGEs), paths (a list of STRINGs, absolute), and total (INT).

    Installing it

    Pack install: search JNK in ComfyUI Manager, or

    cd ComfyUI/custom_nodes/
    git clone https://github.com/Aljnk/ComfyUI-JNK-Tiny-Nodes.git
    

    PIL-based, no extra pip packages needed.

    Where people get burned

    This node fails loudly by design: if the folder doesn't exist, or no file matches your filter, it raises an exception and the queue stops with an error. That's actually the good news - it catches typos instantly instead of silently feeding you an empty batch. The things to watch: the images output is a list, not a single stacked tensor, and the images can be different sizes - downstream nodes must accept lists (many ComfyUI batch nodes do, but some want a uniform tensor). The use_cache flag is also a class-level cache, so it persists across runs: if you add or remove files and forget to turn it off, you'll keep getting the stale list. And skip_img with a cache means you get paths from cache too. It's a workhorse node; just remember it's list-shaped, not batch-shaped.

    CategoryπŸ”§ JNK

    Inputs (5)

    NameTypeDefaultDescription
    folder_pathSTRINGβ€”
    file_filterSTRING*.pngβ€”
    sort_methodCOMBOnumerical2 options: numerical, alphabetical
    use_cacheBOOLEANfalseβ€”
    skip_imgBOOLEANfalseβ€”

    Outputs (3)

    NameTypeDescription
    imagesIMAGEβ€”
    pathsSTRINGβ€”
    totalINTβ€”