ComfyUI Node

Mask Like Image Size

Make a solid mask that matches an image

By jamesWalker55·Created 3 years ago·Updated 4 days ago· 218
Mask Like Image Size
  • image
  • MASK
value1.00

JWMaskLikeImageSize makes a blank, uniform mask that's exactly the same width and height as an image you hand it, filled with a single value you choose. Need a full-frame mask, or a "select nothing" mask, or a constant-strength mask that matches your image dimensions? This is the one-node way to get it.

The reason this exists is that a lot of nodes require a mask input, and sometimes you don't have a meaningful one - you just need a placeholder of the right size. Value 1 gives you an all-white mask (everything selected); value 0 gives you all-black (nothing selected); anything in between is a uniform partial-strength mask. It saves you from loading a solid image, converting it, and hoping the dimensions line up. You feed it the image whose size you want to match and it figures the rest out.

It also pairs nicely with the pack's mask-sequence tools and any workflow where you want a constant weight applied across a whole frame - a flat mask at, say, 0.5 is a clean way to say "apply this everywhere at half strength."

What it actually does

It reads the width and height of your input IMAGE and produces a MASK of identical dimensions, every pixel set to value. Nothing about the image's content matters - only its size. Because masks in ComfyUI are single-channel and run 0 (black) to 1 (white), the value you pick is exactly the grey level of the whole mask.

The inputs and outputs that matter

  • image (IMAGE) - the mask inherits this image's width and height. Its pixels are ignored; only the dimensions are read.
  • value (FLOAT, 0–1, default 1) - the fill level. 1 = fully white (select all), 0 = fully black (select none), 0.5 = uniform half strength.

Output is a single MASK the same size as the image. Wire it into any node that wants a mask - inpainting, a latent-mask apply, a compositing step.

How to install it

Pack: jamesWalker55/comfyui-various. ComfyUI Manager - search Various ComfyUI Nodes by Type, install, restart. Or:

cd ComfyUI/custom_nodes
git clone https://github.com/jamesWalker55/comfyui-various

then restart. No dependencies. JWMaskLikeImageSize sits in comfyui_image_ops.py, and the author's own recommendation is to drop just that file into custom_nodes/ if you only want the image/mask utilities rather than the whole pack.

Common issues & troubleshooting

The mask's content comes from value, not the image. This trips people up: the image only sets the size. If you were hoping to derive a mask from the image's brightness or alpha, that's a different node - this one always produces a flat, uniform fill.

Default is 1 (fully white). Straight out of the box it selects everything. If a downstream inpaint is affecting the whole frame when you expected a targeted edit, remember this node makes a solid mask by design - you'd want an actual segmentation or drawn mask for a localized region.

Value stays in 0–1. The fill is clamped to the 0–1 mask range, so you can't over-drive it past white. For a full mask, 1 is as strong as it goes.

CategoryjamesWalker55

Inputs (2)

NameTypeDefaultDescription
imageIMAGE
valueFLOAT1.000–1

Outputs (1)

NameTypeDescription
MASKMASK