Nodes/SimpleSyrup/Load Mask Batch
ComfyUI Node

Load Mask Batch

Author masks in your image editor, bring them in as one ordered batch

By Artificial-Sweetener·Created 3 months ago·Updated 12 days ago· 2
Load Mask Batch
    • mask
    image
    channelalpha

    If you've ever hand-painted masks for regional prompting - a mask for the character, a mask for the background, a mask for the foreground object - you know the pain of reloading them one at a time and praying the ordering lines up. SimpleSyrup.LoadMaskBatch exists for exactly that: you select a bunch of mask files in order, and it hands you one MASK batch (a BHW tensor: batch, height, width) with a single mask per file.

    The workflow it's built for is regional. Author the masks in any image editor, drop them in ComfyUI's input folder, select them in the order your regional prompts expect, and out the other side comes an ordered batch ready for the pack's regional conditioning and regional-sampler nodes. Combined with Mask to SEGS, the same authored masks can hop into the Impact-compatible SEGS ecosystem and drive detailers - the whole pack is designed around regions moving between detectors, masks, and detailers without being re-created.

    Two inputs, and only two:

    • image - the multi-select combo (with upload) where you pick the mask files in order. Each selected file becomes one regional mask in the batch.
    • channel - which image channel to read from every file. alpha is the default, and it's the one you want if your masks are PNGs with transparency. If a file has no alpha channel, the tooltip is upfront about the result: zero coverage at the source image dimensions. In other words, a missing alpha doesn't crash - it silently gives you an empty mask, which is exactly the kind of quiet failure that wastes an afternoon. If you're exporting masks with transparency baked in, set channel to red, green, or blue instead and save yourself the confusion.

    The output is a single mask batch. Two things to know before wiring it up:

    • Same-size requirement. This is a batch, and batches can't hold mixed resolutions. Load Mask Batch expects same-sized files; unlike Load Image List (which keeps every item independent), this node compresses everything into one tensor, so mixed sizes are a mismatch. Resize your masks to match before loading.
    • Order is the contract. One mask per file, in selection order. The regional prompt pattern binds the first prompt to the first mask, second to second, and so on - mirroring ADetailer's [SEP] batch behavior that this pack is explicitly modeled on. Select deliberately.

    Install: this node ships in SimpleSyrup, so it's the standard pack install:

    cd ComfyUI/custom_nodes
    git clone https://github.com/Artificial-Sweetener/SimpleSyrup
    cd SimpleSyrup && pip install -r requirements.txt
    

    or ComfyUI Manager → search SimpleSyrup → Install → restart. No model downloads come with this node. SimpleSyrup targets ComfyUI's v3 extension API, so update ComfyUI if the nodes don't show up. Troubleshooting is short: mask comes out empty → check the channel matches what's actually stored in your files; masks all wrong sizes → that's a batch mismatch, standardize dimensions first.

    CategorySimpleSyrup/Loaders

    Inputs (2)

    NameTypeDefaultDescription
    imageCOMBOSelect one or more ordered mask files; each selected file becomes one regional mask.
    channelCOMBOalphaImage channel read from every file. Missing alpha produces zero coverage at the source image dimensions.

    Outputs (1)

    NameTypeDescription
    maskMASKOrdered BHW mask batch containing one mask per file.