Anymatix Mask Image
Multiply by a mask
- image
- mask
- IMAGE
Sometimes you don't want to inpaint a region out - you want it gone, black, so a downstream model doesn't have anything to work with there. That's this node's one job: AnymatixMaskImage multiplies an image by a mask, so wherever the mask is 0 the image goes black and wherever it's 1 the pixels pass through untouched. One input image, one mask, one masked image out. It's the ComfyUI equivalent of clamping your thumb over part of the frame before you press the button.
The multiply trick is an old and underrated one in video workflows. Feed a video-to-video or image-to-video model a frame with a region painted black and it will largely leave that region alone - no seam-blend needed, because the model treats black as "no information here." People do it to freeze a background while the subject moves, or to stop a model from regenerating a section it keeps ruining. In the LTX and Wan i2v ecosystem specifically, blacking out parts you don't want drifting is a recognised trick. If you've ever wanted a node that just does that in one step instead of a mask-to-composite detour, this is it.
The one thing that's not obvious about it
Reading the code, you'd expect image * mask and nothing more. It's slightly weirder than that, in a way that matters if your masks are soft. The mask isn't used as a straight linear alpha - it's pushed through a reproduction of matplotlib's Greys_r colormap first, control points and all, with the 256-level quantisation matched byte-for-byte.
Why? Because an earlier version of this node imported matplotlib's colormap, matplotlib isn't a ComfyUI dependency, and when it wasn't installed the whole pack failed to import - forty-odd nodes vanishing over one grey ramp. The obvious fix, using the mask values directly, would have silently changed the output: Greys_r isn't linear (a 0.5 mask comes out around 0.59), so every soft, feathered, or probability mask would have looked different. Instead they spelled out the ramp by hand. Net effect for you: black stays black, white stays white, and if you're feeding a crisp binary mask you'll never notice. If you're feeding a soft CLIPSeg-style probability map and you see a subtle gamma-ish difference from a plain multiply node, that's this ramp, and it's deliberate - it matches what the matplotlib-era workflows produced.
Inputs and output
- image (IMAGE) - the frame you're masking.
- mask (MASK) - 1 keeps, 0 turns black. Inverted masks invert the result.
Output is a single IMAGE, ready to feed an encoder, an img2img pass, or a VAE. Nothing else - no outputs for debugging, no second copy.
Install
Part of the anymatix-comfy-nodes pack. Manager: search "anymatix-comfy-nodes" and install, restart. Or:
cd ComfyUI/custom_nodes
git clone https://github.com/Anymatix/anymatix-comfy-nodes
Restart and it appears under the "Anymatix" category. In the app's own menu it's labelled "Apply Mask to Image."
Troubleshooting
If the result looks like it kept the part you wanted gone, your mask polarity is flipped - invert the MASK before it reaches this node. And if your masked areas come out with faint ghosting rather than true black, check that your mask isn't sitting just above 0 in the "black" region; a slightly noisy mask multiplies to slightly-not-black. The usual fix is a mask that's cleanly 0 or 1 where it needs to be, which is also what gets you clean edges downstream.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| mask | MASK | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |