Nodes/ComfyUI-IntoTheLatent-Utils/ITL Multi Image Loader Advanced
ComfyUI Node

ITL Multi Image Loader Advanced

Multi Image Loader, plus masks and filenames per image

By Into-The-Latent·Created 29 days ago·Updated 15 days ago· 2
ITL Multi Image Loader Advanced
    • count
    • image_1
    • mask_1
    • filename_1
    • image_2
    • mask_2
    • filename_2
    • image_3
    • mask_3
    • filename_3
    • image_4
    • mask_4
    • filename_4
    • image_5
    • mask_5
    • filename_5
    • image_6
    • mask_6
    • filename_6
    • image_7
    • mask_7
    • filename_7
    • image_8
    • mask_8
    • filename_8
    files_json[]
    downscale_modeoff
    max_size1200
    output_slotsauto

    The Advanced flavor of ITL's Multi Image Loader does everything the basic one does - up to 8 files, each on its own socket - and adds two outputs per file that turn it into a real workhorse for inpaint and compositing workflows: a mask_N and a filename_N.

    If you're doing multi-image inpaint - loading a photo plus its prepared mask, or feeding several masked regions through the same pipeline - the stock ComfyUI answer is a web of Load Image + Load Image (mask) pairs that never quite stay aligned. This node gives you one place to load image_1 alongside mask_1, image_2 alongside mask_2, and so on, so the pairing can't drift.

    What the extra sockets do

    • mask_N - the image's alpha channel, inverted, exactly like stock Load Image's mask output. Files without an alpha channel yield the stock 64×64 empty mask, same as ComfyUI's built-in loader. So a flat JPEG still gives you a usable (empty) mask socket - it just won't mask anything.
    • filename_N - the file's name as a string. This is the socket people underestimate. Wire it into a filename node or a SaveImage prefix and suddenly each output can be named after its source, which is a genuine time-saver when you're saving a batch of processed variants and want to know which input each came from.

    Everything else is inherited from the basic loader, and it's worth repeating the two gotchas because they don't change here:

    1. The row on/off toggle keeps the socket position but outputs None. That's fine for OPTIONAL inputs downstream, fatal for REQUIRED ones. If you toggle a row off and a required input gets None, that node errors.
    2. output_slots can be pinned (1–8) to keep your sockets and wires in place while you swap files; auto follows the file list, so sockets appear and vanish as you edit.

    Same downscaling options as the basic node (off / keep aspect ratio / crop to square / stretch to square with a max_size threshold), and masks are resized along with their image so the pair always stays aligned. count counts enabled files actually emitted, not rows.

    Install

    ComfyUI Manager (search "ComfyUI-IntoTheLatent-Utils") or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/Into-The-Latent/ComfyUI-IntoTheLatent-Utils
    

    then restart. No extra dependencies.

    When should you reach for this over the basic version? The rule of thumb: grab Advanced if you're touching masks or need filenames anywhere in the workflow. If you just need reference images on separate sockets, the basic node is simpler and you won't miss the extra outputs. If you're doing any multi-image inpainting, the mask+image pairing here is exactly the ergonomics you want.

    CategoryInto The Latent/image

    Inputs (4)

    NameTypeDefaultDescription
    files_jsonSTRING[]Authoritative file list as JSON. Hidden in the UI and kept in sync by the front-end — drop files onto the node instead of editing this.
    downscale_modeCOMBOoffoff = images pass through untouched. keep aspect ratio = shrink keeping shape so the longest edge is max_size. crop to square = centered square, at most max_size. stretch to square = force a max_size square (ignores shape). Never upscales (keep aspect ratio/crop to square); masks follow their image.
    max_sizeINT12008–8192Size threshold/target in pixels for downscaling. Ignored while downscale_mode is off.
    output_slotsCOMBOautoHow many output sockets to show. 'auto' follows the number of loaded files, so sockets appear and disappear as you edit the list. Pick a fixed number to keep the sockets (and your wires) in place while you swap files around — extra sockets with no file behind them output nothing, so don't wire more than you load.

    Outputs (25)

    NameTypeDescription
    countINT
    image_1IMAGE
    mask_1MASK
    filename_1STRING
    image_2IMAGE
    mask_2MASK
    filename_2STRING
    image_3IMAGE
    mask_3MASK
    filename_3STRING
    image_4IMAGE
    mask_4MASK
    filename_4STRING
    image_5IMAGE
    mask_5MASK
    filename_5STRING
    image_6IMAGE
    mask_6MASK
    filename_6STRING
    image_7IMAGE
    mask_7MASK
    filename_7STRING
    image_8IMAGE
    mask_8MASK
    filename_8STRING