Nodes//Whisker: Strip Mask Generator
ComfyUI Node

Whisker: Strip Mask Generator

Strip masks that tile the canvas exactly — for banded regional prompting

By nerdywhiskers·Created 5 months ago·Updated a day ago· 1
Whisker: Strip Mask Generator
    • mask_1
    • mask_2
    • mask_3
    • mask_4
    • mask_5
    • mask_6
    • mask_7
    • mask_8
    width1024
    height1024
    num_masks4
    orientationhorizontal
    primary_mask_index1
    primary_mask_size256
    noise_amount0
    noise_scale50
    blur0.0
    seed0

    Split a canvas into horizontal or vertical bands and you usually get a seam somewhere - hand-computed strip sizes never quite sum to the container, or the rounding leaves a one-pixel gap that shows up as a hairline in the final composite. strip_masks is the node that makes that problem structurally impossible: it generates 2–8 strip masks that tile the container exactly, no gaps, no overlap, guaranteed.

    That guarantee is the product. It's the natural tool for banded regional conditioning - sky band gets one prompt, midground another, ground a third - where each region needs a mask that precisely covers its strip and nothing else. It also works for slicing an image into strips for separate processing, or building masks for a vertical wipe transition. Whatever the use, you want the masks to cover the canvas perfectly, and this is the node that does the arithmetic for you.

    How it works

    You pick num_masks (2–8) and an orientation - horizontal bands run full-width with varying heights, vertical bands full-height with varying widths. One strip is sized explicitly via primary_mask_size at primary_mask_index; the rest split the remaining space evenly, with the rounding remainder distributed one pixel at a time so the sizes sum to the container exactly. No leftover pixels, ever.

    Then the fun knob: noise_amount (with noise_scale for wavelength) displaces the interior boundaries with smooth 1D noise. The key detail is that all boundaries share the same noise vector, so the whole stack warps coherently like one bent bundle - edges don't cross or scramble, they just wobble together. noise_amount = 0 gives you perfectly straight cuts; a small value makes the bands look hand-drawn. blur applies a Gaussian to each output mask, and seed locks the noise.

    The inputs that matter

    • num_masks - 2 to 8. Fewer is cleaner; more is where regional prompting gets interesting.
    • primary_mask_index / primary_mask_size - one strip you size yourself (say, a fixed 256px sky band); everything else auto-fills. The index is 1-based, and it clamps to num_masks if you overshoot.
    • noise_amount / noise_scale - boundary wobble. Small noise_amount (5–20) reads as organic; anything big starts to look like badly warped signage.
    • blur - feather each mask's edges. Blur before you composite the strips, not after, or you'll get overlap artifacts the node's exact-tiling promise was supposed to save you from.

    The output trap

    There are eight MASK outputs - mask_1 through mask_8 - and they're all always present. Slots beyond num_masks are zero masks. That's convenient for wiring (fixed outputs, no dynamic ports) but it's a trap if you forget: connect one of the zero masks into your pipeline and you've silently told a step to do nothing over part of the canvas. Wire exactly the masks you set, or you'll debug an invisible blank for an hour.

    Installing it

    Part of the Whisker pack:

    cd ComfyUI/custom_nodes
    git clone https://github.com/nerdywhiskers/ComfyUI-Whisker-Nodes.git
    pip install -r ComfyUI-Whisker-Nodes/requirements.txt
    

    or search "ComfyUI-Whisker-Nodes" in ComfyUI Manager and restart. Under Add Node → whisker-nodes. No models, no downloads - this one is numpy and Pillow, so it's instant on any setup.

    Categorywhisker-nodes

    Inputs (10)

    NameTypeDefaultDescription
    widthINT102416–8192
    heightINT102416–8192
    num_masksINT42–8
    orientationCOMBOhorizontal2 options: horizontal, vertical
    primary_mask_indexINT11–8
    primary_mask_sizeINT2561–8192
    noise_amountFLOAT00–512
    noise_scaleFLOAT501–1024
    blurFLOAT0.00–200
    seedINT00–4294967295

    Outputs (8)

    NameTypeDescription
    mask_1MASK
    mask_2MASK
    mask_3MASK
    mask_4MASK
    mask_5MASK
    mask_6MASK
    mask_7MASK
    mask_8MASK