Nodes/NIX ComfyUI Plugin/NIX_PathLoading
ComfyUI Node

NIX_PathLoading

Point it at a folder and load a whole batch of images and masks — natural sort, sane order, no file-picker clicking

By J-ChenX·Created 11 months ago·Updated 11 months ago· 2
NIX_PathLoading
    • image
    • mask
    • filename
    • quantity_number
    image_path
    mask_path
    channelwhite
    load_quantity1
    start_index1

    NIX_PathLoading is the node that turns a folder full of images into a batch, without a file dialog in sight. You type a directory path, and it loads your images - and optionally matching masks - in a sane, natural order, ready to feed a batch img2img pass, a training-preprocessing loop, or a folder-based processing pipeline. If you've ever built a workflow that needed to process every image in a directory in sequence, this is the node that replaces the manual Load Image → swap → rerun grind.

    It's part of the NIX pack, a small dependency-free collection (numpy + Pillow, both already in ComfyUI), so one install gets you this plus the pack's crop, rotate, and utility nodes.

    How it works

    Three required inputs:

    • image_path - the folder to load images from.
    • mask_path - an optional folder for masks.
    • channel - which channel to extract when loading a mask: red, green, blue, purple, yellow, cyan, or white (default). This is the pack's answer to masks stored inside image channels - the formula differs per channel (red is R-G-B, white is R*G*B, and so on), clamped and normalized to 0–1. If your masks are standalone grayscale files, white is fine.

    Two optional dials:

    • load_quantity - how many to load. Default 1. 0 means "load everything" - easy to misread, and probably the most common surprise here.
    • start_index - skip files before this. Default 1, and it's 1-based, not 0-based.

    The sorting is the good part: it's natural sort, so img2 loads before img10 instead of after it, which is what a human means by "in order." It also runs exif_transpose, so phone photos with rotation tags come out upright.

    Outputs: image (a list of IMAGE), mask (a list of MASK), filename (a list of stem names, no extension), and quantity_number (a semicolon-joined string of available indices, like 1;2;3;4;5).

    Matching images to masks

    If you give it both a folder and a mask folder, it loads pairs by stem - photo_001.jpg pairs with photo_001.png. Non-matching files are ignored. Give it only images and it returns black zero masks alongside them; only masks and it returns black zero images. Either way the lists come back aligned.

    The catch: the outputs are lists, and many ComfyUI nodes take a single image or a single batch. You'll often want a list-to-batch converter (or a batch splitter) between this and whatever consumes the images. A batch-oriented loop is the natural companion.

    Getting it installed

    • ComfyUI Manager: search "NIX" / "NIX ComfyUI Plugin", or use Install Custom Nodes → Git URL → https://github.com/J-ChenX/ComfyUI-NIX. Restart after.
    • By hand:
      cd ComfyUI/custom_nodes
      git clone https://github.com/J-ChenX/ComfyUI-NIX
      
      Restart ComfyUI. No model downloads. Find it under the "NIX" category.

    Things that will bite you

    • It's a plain string, not a file browser. Absolute path or a path ComfyUI's process can resolve, or you get a FileNotFoundError. Type it carefully - there's no autocomplete.
    • load_quantity: 0 is "all", not "none". Set 0 to load everything; that trips up people expecting 0 to mean zero.
    • Lists out, batch consumers in. Wire a list-to-batch node if your downstream sampler wants a tensor.
    • 1-based indexing. start_index: 1 (the default) starts from the first file; there's no zero-based mode.
    • Quiet pack. Almost no community signal for NIX as of mid-2026, so don't expect a copied workflow; the source is one readable file if you need the exact channel math.
    CategoryNIX

    Inputs (5)

    NameTypeDefaultDescription
    image_pathSTRING
    mask_pathSTRING
    channelCOMBOwhite7 options: red, blue, green, purple, yellow, cyan, +1
    load_quantityoptINT1
    start_indexoptINT1

    Outputs (4)

    NameTypeDescription
    imageIMAGE
    maskMASK
    filenameSTRING
    quantity_numberSTRING