Superside Mask To Image
MASK to grayscale IMAGE — the type conversion that unblocks half your graph
- mask
- IMAGE
In ComfyUI, a MASK and an IMAGE are different types with different shapes - mask values live in one channel, image pixels in three - and the sockets don't mix. Half of "why won't this wire connect" moments in masking-heavy workflows are a type mismatch exactly like this one. Superside Mask To Image is the conversion node that bridges it: it turns a MASK into a grayscale IMAGE, and it's the in-house equivalent of core ComfyUI's MaskToImage.
The practical case for it is everywhere once you're looking. You have a mask and you want to feed it to an image-processing node that only accepts IMAGE. You want to save the mask as a PNG for a client or a record. You want to composite the mask over a photo so you can see what's protected in context. All of those need the mask to become an image first.
The input and output
One input: mask - any MASK tensor. One output: IMAGE, grayscale, where each pixel's gray value is the mask value (white = 1.0, black = 0.0, gray = partial).
That's the whole contract, and the lack of knobs is the point - there's nothing to configure, so there's nothing to get wrong.
How it works
Mechanically it's as simple as a node gets: the mask batch is reshaped to (batch, 1, height, width), the single channel is moved to the last position, and the value is broadcast to three channels (R=G=B=mask value) to make a proper RGB image. All local, no API, no key, and instant.
Installing it
cd ComfyUI/custom_nodes
git clone https://github.com/Superside/comfyui-superside-nodes
pip install -r requirements.txt
Restart ComfyUI, find it under Superside. Nothing else.
The sibling to know about
If your goal isn't a usable IMAGE output but a visible preview, this pack's Superside Mask Preview is the same conversion plus a graph preview - use that one for eyeballing. This node is for when you need the IMAGE itself: to save it, composite it, or feed it onward. Two nodes, one conversion, and between them they cover every reason you'd want to turn a mask into pixels.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| mask | MASK | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |