Nodes/RES4LYF/Mask Sketch
ComfyUI Node Runs on cloud

Mask Sketch

Draw a mask by hand, right inside the node

By ClownsharkBatwing·Created 2 years ago·Updated 18 days ago· 1,222
Mask Sketch
    • IMAGE
    • MASK
    image

    RES4LYF's README talks up regional conditioning - splitting a single image into zones that each get their own prompt, "unlimited zones" and all - and it says the masks defining those zones "can be drawn freely, or more traditional rigid ones may be used." Mask Sketch is the freehand half of that pair: a drawing pad built into the node itself, where you sketch directly on an image and get both the resulting picture and the mask of what you drew as outputs.

    It's a small, generic utility rather than anything sampler-specific - notice its category is just image, not RES4LYF/masks like most of the pack's other mask tools - but it ships inside RES4LYF and is the natural companion to the pack's regional-conditioning workflow if you'd rather paint your zones by hand than build them from flat color swatches.

    How it works

    Load or select an image into the node, and it opens as a canvas you can draw on directly in the ComfyUI interface. What you paint becomes the mask; the underlying image comes back unchanged (or with your strokes composited on, depending on how you've set it up) as a second output.

    The inputs and outputs that matter

    • image - the image you're sketching on top of, selected the same way any ComfyUI image-upload widget works.
    • Output: IMAGE - the image, for previewing or further use.
    • Output: MASK - the mask of what you drew, ready to feed into whatever's consuming it downstream (a conditioning-region setup, an inpaint node, or one of RES4LYF's own mask-processing nodes).

    How to install it

    Via ComfyUI Manager: search "RES4LYF" and install. Manually, from ComfyUI/custom_nodes:

    git clone https://github.com/ClownsharkBatwing/RES4LYF/
    cd RES4LYF
    pip install -r requirements.txt
    

    Activate your venv first if you use one; on portable installs, use python_embedded\Scripts\pip.exe in place of pip. Restart ComfyUI once installed.

    Common issues & troubleshooting

    The drawing canvas doesn't show up, or the node looks like a plain image loader. Custom in-node canvases are one of the more UI-fragile things a node pack can ship - if the sketch surface isn't rendering, a hard refresh (F5, not just a soft reload) after a fresh ComfyUI restart is the first thing to try, the same fix RES4LYF's own README recommends for its other UI-dependent features.

    The mask doesn't line up with what you drew. Double-check you're drawing on the actual loaded image and not a placeholder - this node ships with a default example image, and it's easy to sketch on that by mistake before your real image has loaded in.

    You'd rather define zones from a flat-color reference image than draw freehand. That's the other half of RES4LYF's regional-masking pair - see Masks-From-Color-Swatches, which turns a multi-color region map into a list of masks instead.

    You need several separate masks from one drawing session, not just one. This node only outputs a single MASK. If your regional-conditioning setup needs multiple named zones, you'll want to either run this node once per zone or switch to the swatch-based workflow, which produces a list you can split with the Masks-Unpack-4/8/16 nodes.

    Categoryimage

    Inputs (1)

    NameTypeDefaultDescription
    imageCOMBO1 options: example.png

    Outputs (2)

    NameTypeDescription
    IMAGEIMAGE
    MASKMASK