Nodes/ComfyUI-curved_weight_schedule/Multi-Layer Mask Editor (10 outputs)
ComfyUI Node

Multi-Layer Mask Editor (10 outputs)

Paint masks by hand instead of begging a segmenter to find the edges

By diffussy69·Created 11 months ago·Updated 9 months ago· 2
Multi-Layer Mask Editor (10 outputs)
    • mask_1
    • mask_2
    • mask_3
    • mask_4
    • mask_5
    • mask_6
    • mask_7
    • mask_8
    • mask_9
    • mask_10
    image
    num_layers5

    Auto-segmenters are great until they eat your subject's hair or decide the floor is part of the person. For everything else there's this node: a canvas you paint on directly, with up to ten independent mask layers, each one coming out of its own output. It's the mask front-end for the rest of the curved_weight_schedule pack - paint a face layer, a background layer, a "vase on the table" layer, and feed them to Regional Prompting or the temporal mask combiners.

    How it works

    The node ships a JavaScript UI extension (web/multi_layer_mask_editor.js) that draws a painting canvas right in your graph. You paint on a layer, the frontend packs what you drew into JSON, and the backend turns each layer into a separate MASK tensor. Ten outputs, mask_1 through mask_10, each a clean [1, H, W] mask you can wire anywhere a mask goes. The node is marked as an output node, so it runs even when nothing's connected to it - you can paint, look at your layers, and keep going.

    Inputs worth understanding

    The two inputs are easy to get wrong because one of them is a trap.

    • image - this is a STRING, not an IMAGE wire. You type the filename of a reference image sitting in your ComfyUI/input folder. Newcomers try to drag an IMAGE wire onto it and stare at an unconnectable port. It's just a background to paint over.
    • num_layers - how many layers to show, 1–10, default 5.

    If you want to trace over an actual generated image, save it into ComfyUI/input first, then reference it by filename.

    Where it slots in

    This node is the first step in the pack's temporal masking workflow:

    Multi-Layer Mask Editor → Multi-Mask Combiner (Batch) → Advanced Curved ControlNet Scheduler
    

    But it earns its keep in simpler graphs too - hand-painted masks are the honest way to get a region prompt to actually match the region. Auto Person Mask gets you 80% of the way in two seconds; this gets you the remaining 20% by hand, for the parts the segmenters can't find.

    Installing it

    Same pack, same drill. ComfyUI Manager → search "curved_weight_schedule", or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/diffussy69/comfyui-curved_weight_schedule
    

    Dependencies are the usual matplotlib pillow numpy torch scipy. After restart, hard-refresh the browser (Ctrl+Shift+F5 / Cmd+Shift+R) - the canvas UI lives in JavaScript, and a stale tab is the number one reason the paint surface doesn't appear.

    Where people get burned

    Beyond the STRING-vs-IMAGE trap: layers you painted that seem to disappear usually mean num_layers got changed after you painted, which hides the extra outputs. And masks you painted on a low-res reference come out low-res - use a decent-size reference image or be ready to upscale the mask afterward. Oh, and if you hard-refresh mid-workflow, your painted layers are gone. Save the workflow (Ctrl+S) before you refresh; painted masks are stored in the workflow JSON, not the canvas.

    Categorymask/edit

    Inputs (2)

    NameTypeDefaultDescription
    imageoptSTRING
    num_layersoptINT51–10

    Outputs (10)

    NameTypeDescription
    mask_1MASK
    mask_2MASK
    mask_3MASK
    mask_4MASK
    mask_5MASK
    mask_6MASK
    mask_7MASK
    mask_8MASK
    mask_9MASK
    mask_10MASK