Nodes/ComfyUI-TJ_NODE/Multi Image Loader (TJ)
ComfyUI Node

Multi Image Loader (TJ)

Batch-loading with Multi Image Loader (TJ)

By designloves2·Created 4 months ago·Updated 3 days ago· 13
Multi Image Loader (TJ)
    • BATCH
    • WIDTH
    • HEIGHT
    • FILENAMES
    image_paths_json[]
    auto_settrue
    match_modeKeep Input Ratio
    resize_inputnone
    edge_size1024
    custom_width1024
    custom_height1536
    megapixel1.0
    interpolationlanczos
    scale_methodCenter Crop
    batch_select

    If you've ever built a ControlNet batch or a dataset pass by chaining eight Load Image nodes into a make_batch, you know how fast that turns into a mess. Multi Image Loader (TJ) is that mess, unbuilt: it loads a whole stack of images into one IMAGE batch tensor, normalizes their resolutions, and hands you the batch plus its dimensions in a single node. It's the input hub of the TJ_NODE batch system, and honestly it's the node from this pack I'd tell a stranger to grab first.

    How it works

    The node gives you a thumbnail grid in its body. You drag and drop files in, hit a folder picker, or paste a URL to download - then reorder them by dragging. All of that just fills an internal image_paths_json list; on run, the node resolves each path and stacks the decoded images into one tensor. Two details make it feel different from a plain loader:

    • Path sandboxing. It refuses anything outside ComfyUI's input/, output/, and download/ folders, and blocks .. escapes. Load from there and you'll never trip over it, but if you point it at an absolute path elsewhere it'll throw a deliberate error instead of silently reading your whole disk.
    • FILENAMES output. The loader tracks the original filename for every image it loaded. That one string output is what makes Save With Original Names (TJ) work - you load a batch and save it back out under the same filenames later.

    The inputs that matter

    Most of the grid is UI, so you'll only touch a few fields directly:

    • match_mode / resize_input - decide how images get normalized. Keep Input Ratio with a resize_input of long edge / short edge scales to edge_size on one side; Megapixel mode normalizes everything to roughly megapixel total pixels. This is what you want when your batch mixes portrait and landscape.
    • scale_method - Center Crop pads/crops to a clean shape; Force Fit squashes to exactly the custom dimensions. Crop, almost always.
    • batch_select - a quick way to pull a subset (1,2,4), handy when you don't want to delete anything from the grid.

    Outputs

    • BATCH (IMAGE) - wire this into your sampler, ControlNet preprocessor, or whatever eats the batch.
    • WIDTH, HEIGHT (INT) - the normalized dimensions, useful for a latent or resolution node so everything downstream stays in sync.
    • FILENAMES (STRING) - original names, newline-separated. Feed it to Save With Original Names or grep it for bookkeeping.

    With auto_set on (default), the node also publishes TJ / BATCH, TJ / WIDTH, and TJ / HEIGHT as wireless providers, so other TJ nodes can receive the batch without a wire crossing your whole canvas.

    Installing it

    The pack installs the standard way - ComfyUI Manager, search ComfyUI-TJ_NODE, Install, restart. Or by hand:

    cd ComfyUI/custom_nodes
    git clone https://github.com/designloves2/ComfyUI-TJ_NODE
    

    Then restart ComfyUI. This node has no special dependencies beyond the pack itself (PIL, numpy, torch - all standard).

    Where people get burned

    Mixed resolutions are the classic trip-up: throw a 512×512 and a 4K landscape into the same batch and your sampler will silently work on mismatched tensors or the node will crop things you didn't mean to crop. Decide what the batch should look like before you load, set match_mode accordingly, and keep scale_method on Center Crop. And remember the path rule - files living outside the ComfyUI folders are refused by design. If you're loading a stack of reference images for a compare or an upscale grid, this is the loader you want.

    Category ✨ TJ_Node/Image

    Inputs (11)

    NameTypeDefaultDescription
    image_paths_jsonSTRING[]
    auto_setBOOLEANtrue
    match_modeCOMBOKeep Input Ratio2 options: Keep Input Ratio, Megapixel
    resize_inputCOMBOnone4 options: none, long edge, short edge, Custom
    edge_sizeINT102464–8192
    custom_widthINT102464–8192
    custom_heightINT153664–8192
    megapixelFLOAT1.00.1–16
    interpolationCOMBOlanczos4 options: lanczos, nearest, bilinear, bicubic
    scale_methodCOMBOCenter Crop2 options: Center Crop, Force Fit
    batch_selectSTRING

    Outputs (4)

    NameTypeDescription
    BATCHIMAGE
    WIDTHINT
    HEIGHTINT
    FILENAMESSTRING