Nodes/IF_LLM/IF LLM Load Images S 🖼️
ComfyUI Node

IF LLM Load Images S 🖼️

Point It at a Folder, Get a Whole Batch of Images and Masks Back

By if-ai·Created 2 years ago·Updated about a year ago· 158
IF LLM Load Images S 🖼️
    • images
    • masks
    • image_paths
    • filenames
    • count_str
    • count_int
    ◄image▾►
    ◄input_path►
    ◄start_index0►
    ◄stop_index10►
    ◄load_limit1000►
    ◄image_selectedfalse►
    ◄available_image_count1►
    ◄include_subfolderstrue►
    ◄sort_method▾►
    ◄filter_type▾►
    ◄channelalpha►

    Stock ComfyUI's LoadImage wants one file at a time, and you drag it in like a caveman. This node is the pack's answer for anyone who wants to feed a whole folder to a vision model or a batch job: give it a directory, and it loads a range of images from disk as a list, alongside their masks, paths, filenames, and counts. It was one of the features the author (Impact Frames) called out directly in the launch post - "lets you import and display images within any folder on your computer."

    In practice the classic setup is: IF_LLM_LoadImagesS → images into the main IF_LLM node → LLM writes a prompt for each image, either one at a time or via the main node's auto batch mode.

    How it works

    The clever bit is the thumbnail system. ComfyUI's image picker widget only lists files that are actually in its input directory, so this node writes 300px thb_-prefixed thumbnails there - that's why the image dropdown suddenly shows you folder previews. Pick a representative thumbnail to drive the widget, and the node loads the real, full-resolution files from input_path between start_index and stop_index. It even encodes subfolder structure into the thumbnail filenames so nested directories don't collide.

    sort_method (alphabetical, numerical, date_created, date_modified) controls order, filter_type whitelists extensions (png, jpg, webp, gif, bmp), and include_subfolders decides whether recursion happens. The channel dropdown - alpha, red, green, blue - picks which color channel gets extracted as a mask, alpha by default.

    Inputs that matter

    • input_path - the folder to read from.
    • start_index / stop_index - the range of files to load. stop_index defaults to 10, so it loads the first ten unless you widen it.
    • include_subfolders, sort_method, filter_type - order and scope.
    • channel - which channel becomes your mask.
    • load_limit - a hard cap (10 to 100,000), safety valve for huge folders.

    The other inputs are worth a mention but rarely touched: image is the preview thumbnail selector, image_selected toggles single-image mode, and available_image_count is read-only - it reflects how many thumbnails are present.

    Outputs

    Six list outputs: images (the IMAGE batch), masks, image_paths, filenames, and the count as both count_str and count_int. Wire images into the LLM node or a batch sampler; the path/filename lists are handy if you later want to save results alongside their sources.

    Installing it

    Part of the same pack, so install once via ComfyUI Manager (search "IF_LLM") or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/if-ai/ComfyUI-IF_LLM
    

    then restart. Heads-up from the README: this pack conflicts with IF_AI_tools - uninstall that first. The dependency list is chunky (transformers, torch, triton, decord, moviepy), so budget for a slow first install.

    Troubleshooting

    • Thumbnails piling up in your input folder - yes, that's by design, and they're tiny. If your image dropdown gets cluttered, delete the thb_ files; they regenerate.
    • Wrong images loading - double-check sort_method. Numerical sorting with alphabetical filenames that lack zero-padding is a classic source of 1, 10, 100 chaos.
    • Mask looks wrong - switch channel from the default alpha if your source images don't actually carry alpha.
    • Nothing appears in the dropdown - the node scans for thb_ files at startup; if the thumbnails were cleared, refresh and re-run once to regenerate.
    CategoryImpactFrames💥🎞️/IF_LLM

    Inputs (11)

    NameTypeDefaultDescription
    imageCOMBO0 options:
    input_pathSTRING—
    start_indexINT00–9999—
    stop_indexINT101–9999—
    load_limitCOMBO10005 options: 10, 100, 1000, 10000, 100000
    image_selectedBOOLEANfalse—
    available_image_countINT10–99999—
    include_subfoldersBOOLEANtrue—
    sort_methodCOMBO4 options: alphabetical, numerical, date_created, date_modified
    filter_typeCOMBO7 options: none, png, jpg, jpeg, webp, gif, +1
    channelCOMBOalpha4 options: alpha, red, green, blue

    Outputs (6)

    NameTypeDescription
    imagesIMAGE—
    masksMASK—
    image_pathsSTRING—
    filenamesSTRING—
    count_strSTRING—
    count_intINT—