Nodes/CMK Flow/CMK Empty Image Mask
ComfyUI Node

CMK Empty Image Mask

A black canvas and a fully-white mask, in fifteen lines

By CMKFlow·Created 3 months ago·Updated a day ago· 6
CMK Empty Image Mask
    • image
    • mask
    ◄width512►
    ◄height512►

    This is the shortest node in the pack and possibly the least explained. Two integer widgets, two outputs, and a body you can read in one breath: a tensor of zeros for the image, a tensor of ones for the mask.

    What it is

    CMK_EmptyImageMask lives in CMK/Toolbox/Mask & SEGS. You give it width and height (defaults 512 × 512, min 64, max 8192, step 8) and it returns:

    • image - a single-frame RGB image of that size, all zeros. Black.
    • mask - a single-layer mask of the same size, all ones. Fully white, which in ComfyUI's convention means fully selected.

    That pairing is the point, and it's worth being precise about because the name is slightly misleading in both directions. The image is empty, yes. The mask is not empty - it's the maximum mask. In ComfyUI a mask value of 1.0 means "this pixel is masked," so this node hands you "all of it."

    Why you'd reach for it

    Three uses, in roughly descending order of how often you'll hit them:

    Seeding a workflow whose first node needs an image. Every so often you want to test the back half of a workflow without generating anything first, or you're building something that constructs its own image from scratch and just needs a correctly-typed tensor to start from. A 512×512 black frame costs nothing and satisfies the type checker.

    Mask-driven expansion and outpaint-style work. A fully-white mask paired with a black image is the "everything here is editable" state. If a masked node in your workflow needs a mask and you want it to process the whole frame, this is how you say that without painting anything.

    A known-dimensions canvas for layout work. Padding, compositing and paste-back operations all want a target size before you have anything to put in them.

    What it isn't

    It's not an alpha generator, there's no batch option - you get exactly one image, not a batch of N - and it has no notion of colour, so there's no way to ask for a grey canvas or a specific fill. If you need a black image with a mask drawn into it, this is only the starting tensor; the drawing happens downstream.

    It's also not doing anything you couldn't do with a core EmptyImage plus a bit of mask arithmetic. What you're buying is one node instead of three, and - more to the point in a CMK workflow - something whose output types match what the rest of the pack expects without conversion.

    Install

    It arrives with the pack. Manager: search CMK Flow, install the CMKFlow entry, restart. Manually, from the folder containing main.py:

    git clone https://github.com/CMKFlow/cmk_nodes.git custom_nodes/cmk_nodes
    python3 custom_nodes/cmk_nodes/scripts/install_cmk_requirements.py
    

    CMK dependency check: OK means it went in. One honest note on that: this node needs nothing but PyTorch, but the pack installs as one unit, so you're also getting ultralytics, onnxruntime, insightface, segment-anything, imageio-ffmpeg, opencv-python and nudenet==3.4.2 into the same Python environment. That's the trade for a pack that runs a detailer and a face pipeline out of the box. CMK Flow is a single-author GPL-3.0 project by Carsten Kirschner, open-sourced in July 2026 - small, self-contained, and verified against ComfyUI 0.38.2 with the Nodes 2.0 frontend.

    Issues worth knowing

    The obvious one: a black image is a black image. Preview it or save it and you'll get a black PNG, and "my output is black" is the single most common false alarm in image generation. If a workflow suddenly produces black frames, check whether this node ended up on the output path.

    The second is the mask polarity. torch.ones means "all masked," which is the opposite of what a lot of people intuitively read from "empty mask." If a node behaves as if the entire image is being regenerated, that's not a bug - that's exactly what you asked for.

    CategoryCMK/Toolbox/Mask & SEGS

    Inputs (2)

    NameTypeDefaultDescription
    widthINT51264–8192—
    heightINT51264–8192—

    Outputs (2)

    NameTypeDescription
    imageIMAGE—
    maskMASK—