Nodes/ComfyUI-Flux2Klein9Mod/Load RefMod Folder (Images)
ComfyUI Node

Load RefMod Folder (Images)

It Reads Your Disk, and the Default Path Is the Author's

By malcolmamal·Created a day ago·Updated about 21 hours ago· 1
Load RefMod Folder (Images)
    • images
    • count
    folder_pathC:/Development/ai-toolkit/datasets/billieeilish
    max_images16
    max_edge1024

    Three inputs, two outputs, no cleverness. This is the "stop dragging thirty LoadImage nodes around" node, and if you're building RefMods from a dataset, you'll use it every time.

    What you'd reach for it for

    The Extract node doesn't want one reference image, it wants a batch - enough images that the encoded bundle represents a concept rather than a single photo. The manual way to feed it is a chain of LoadImage nodes or a batch loader pointed at ComfyUI's input/ folder. Both are annoying if your references already live in a properly curated dataset folder, which is exactly where they'll be if you trained a LoRA on this character at any point.

    So the node takes a path, walks the folder, and hands you the images as a single batch. count tells you how many it actually picked up, which is the output you'll check most - "it says 4" is a very fast answer to why your RefMod looks thin.

    The three inputs

    folder_path is a plain string, and it's an absolute path read directly off disk - not a name from ComfyUI's input directory. The default value is the tell: it ships as C:/Development/ai-toolkit/datasets/billieeilish, which is the author's own local dataset directory. That should be the first thing you retype. Forward slashes work on Windows; on Linux and macOS just paste your real path. Spaces are usually fine, but if the load comes back empty, quoting and slash direction are the first two things to check.

    max_images defaults to 16 and is capped at 128. Sixteen is a sensible guard rather than a limitation, and it happens to sit right in the range a character dataset wants anyway - the LoRA-training rule of thumb is 15–25 images for a person, quality over quantity, and the same logic holds here: every image you feed in gets VAE-encoded, and the resulting bundle's token count is what your sampling pays for on every run afterwards. If you have 200 dataset images, raising this to 128 is the wrong fix; the right one is a tighter, more representative selection. Datasets are redundant by nature.

    max_edge defaults to 1024, runs from 256 to 2048 in steps of 64, and resizes the longest edge of each image. That default lines up with the token budget you'll pick in Extract: encode at 1024 and a 1024-token reference makes sense; feed it 2048-wide images and you're encoding detail the budget is about to throw away anyway.

    Outputs: images (the batch, into Extract's images) and count.

    Install

    It ships in the same pack as the rest of the Klein9 RefMod nodes:

    cd ComfyUI/custom_nodes
    git clone https://github.com/malcolmamal/ComfyUI-Flux2Klein9Mod.git
    

    Restart ComfyUI and you'll find all four under model/conditioning/klein9. No models to download, no requirements.txt rituals in the README - the pack's only setup step is the models/refmods-klein9/ folder for the files it produces.

    Gotchas

    It only sees files your ComfyUI process can see. On Docker or a remote box, the dataset folder has to be mounted inside the container at the path you type - a path that exists on your desktop but not in the container returns zero images, not an error.

    Order is whatever the filesystem hands back. For a RefMod that's mostly harmless since the result is an averaged bundle, but don't build anything on image N being the file you expect it to be.

    It is not a general-purpose image loader. It gives you no per-image control, and the README documents nothing about how it walks subfolders. It's scaffolding for one job: getting a folder of references onto the wire in one hop so the Extract node can do its thing.

    Categorymodel/conditioning/klein9

    Inputs (3)

    NameTypeDefaultDescription
    folder_pathSTRINGC:/Development/ai-toolkit/datasets/billieeilish
    max_imagesINT161–128
    max_edgeINT1024256–2048

    Outputs (2)

    NameTypeDescription
    imagesIMAGE
    countINT