ComfyUI Node Runs on cloud

MixingMaskGenerator

The perlin mask factory waiting for its big moment

By ttulttul·Created 3 years ago·Updated about a year ago· 120
MixingMaskGenerator
    • MASK
    mask_typeperlin
    perlin_scale10.00
    seed0
    width512
    height512
    batch_size1

    This node generates batches of noise masks - perlin or random - at latent resolution. And the honest framing from the README is that its full purpose is still on the roadmap: eventually you'll feed these masks into the IterativeMixingSampler to control where mixing happens at each denoising step, spatially. For now, the sampler's mask input is unused, which makes this node a preview utility - a way to see what the perlin masks look like at various scales, and a building block you can already put to work.

    The inputs that matter

    • mask_type - perlin (default) or random. Perlin is the interesting one: smooth, blobby organic noise rather than static. The perlin implementation is borrowed with credit from WASasquatch's PowerNoiseSuite.
    • perlin_scale (default 10) - controls blob size. Values near 1.0 are close to pure noise; values near 100 produce huge blobs that cover almost the whole area. This is the knob you'll spend your time on.
    • seed - reproducibility. Same seed, same masks.
    • width / height (default 512, steps of 8) - the image-space dimensions you're targeting.
    • batch_size (default 1) - how many masks to generate at once.

    One detail to internalize: the masks are generated at 1/8 resolution. A 512×512 request produces 64×64 masks, because that's latent-space scale for SD-class models (the code divides by 8 directly). That's deliberate - these are meant to line up with latents, not pixels.

    Output: a MASK tensor, one channel per mask in the batch.

    What it's for, today and later

    Today it's a visualization and experimentation tool: run it, preview the output, and build intuition for what perlin_scale does. It's genuinely handy for people dabbling in masked or region-based workflows, since a perlin mask batch is a smooth, tileable-ish way to get organic spatial variation into anything that takes a mask.

    Later - the actual stated plan - these masks become the steering wheel for iterative mixing. The IterativeMixingSampler already has a mixing_masks input slot in its design, and this node is the factory that would feed it. Masked latents are handled correctly in the current code; what's missing is the wiring that applies a mask to the mixing process at each step.

    Install

    cd ComfyUI/custom_nodes
    git clone https://github.com/ttulttul/ComfyUI-Iterative-Mixer
    # restart ComfyUI
    

    Or ComfyUI Manager → "ComfyUI Iterative Mixing Nodes." No model downloads. The perlin code is pure PyTorch, so the pack's requirements.txt (torch, numpy, Pillow, matplotlib, scipy, tqdm) covers everything; nothing extra to fetch.

    The honest verdict: as shipped, this is a utility in search of its main feature. If you're not already playing with perlin-mask-based conditioning (think region control or organic blending), you can safely skip it - the rest of the pack works fine without it. But it's a nice window into where the author intended iterative mixing to go, and the perlin generation itself is clean, fast, and easy to fold into mask-driven experiments.

    Categorymask/generation

    Inputs (6)

    NameTypeDefaultDescription
    mask_typeCOMBOperlin2 options: perlin, random
    perlin_scaleFLOAT10.000.1–400
    seedINT00–18446744073709550000
    widthINT51216–8192
    heightINT51216–8192
    batch_sizeINT11–4096

    Outputs (1)

    NameTypeDescription
    MASKMASK