Convert Masks to Images
The batch version of a conversion you need constantly
ComfyUI keeps MASK and IMAGE as distinct data types even though a mask usually looks like a plain grayscale image - under the hood they're different tensor shapes, and a lot of nodes that operate on one won't accept the other. WAS's README documents a Mask to Image node for converting a single mask across that boundary; this node is its batch counterpart, doing the same conversion across a whole batch of masks at once rather than one mask at a time.
Why you'd need this
Mostly: to actually see your mask. Preview Image doesn't accept a MASK input, so if you want to eyeball what a mask looks like - whether a detection came out where you expected, whether an eroded or dilated mask looks right before you commit to using it - you need to convert it to an image first. This node does that for a whole batch in one step, which matters if you're working with per-frame masks, one mask per detected region, or any other situation where you've got more than one mask moving through your graph at the same time and don't want to convert them one by one.
It's also useful for compositing masks visually alongside other images - stacking a mask next to the source it came from in a grid, for instance, to sanity-check a batch before you commit to an expensive downstream operation.
How it works
Feed it a batch of masks, get back a matching batch of grayscale images - same count, same spatial dimensions, just crossed over into the image type. Feeds straight into Preview Image, Save Image, Image Batch, or anywhere else downstream that expects images rather than masks.
Installing it
Part of the full WAS Node Suite pack:
- ComfyUI Manager - search WAS Node Suite, install, restart.
- Manual -
cd ComfyUI/custom_nodes && git clone https://github.com/WASasquatch/was-node-suite-comfyui/, thenpip install -r requirements.txtfrom inside that folder, then restart ComfyUI.
Common issues
Remember this is a one-way, purely visual conversion - the resulting grayscale image isn't automatically usable as a mask again just by rewiring it backward. If you need to go from an image back to a mask (say, one you've painted or edited manually), you want a different node built for that direction, like WAS's Image to Latent Mask, not this one run in reverse.
And the pack-wide caveat: WAS Node Suite has been unmaintained since December 2023, and "Import Failed" errors after a ComfyUI update are a real, recurring complaint tied to older pinned dependencies. Reinstalling requirements.txt inside your ComfyUI venv is the usual fix if the whole suite stops loading.
Inputs (0)
No inputs
Outputs (0)
No outputs