Nodes/ComfyUI Impact Pack/Remove Noise Mask
ComfyUI Node Runs on cloud

Remove Noise Mask

Strip an inpaint mask back off a latent

By ltdrdata·Created 3 years ago·Updated 4 months ago· 3,242
Remove Noise Mask
  • samples
  • LATENT

Some latents carry an invisible passenger: a noise mask, attached by a node like VAEEncodeForInpaint or by something like PreviewBridge (latent) after you've painted a mask on it. That mask tells a sampler "only denoise inside this region, leave the rest alone." Remove Noise Mask strips it back off. One input, one output, no settings - the latent goes in with a mask attached and comes out without one.

Why you'd want to do that

The mask is what turns ordinary sampling into masked inpainting. Once it's attached, any sampler downstream treats the latent as a partial-denoise job - only the masked region gets touched, everything outside is preserved. That's exactly what you want when you want inpainting. But sometimes a latent picks up a mask earlier in a workflow (say, from a PreviewBridge step where you painted a region for a different purpose) and you want to hand that same latent to a sampler for a normal, full-image pass afterward. If you don't strip the mask first, the sampler will still only touch the masked area - which is confusing if you weren't expecting inpaint behavior at that point in the graph. Remove Noise Mask is the reset button: get back to a plain latent that samples normally everywhere.

The input and output

  • samples (LATENT, required) - the masked latent to clean up. That's the only input; nothing to configure.

Output is a single LATENT - the same latent data, with the noise mask attribute removed. Everything else about the latent (the actual sampled/encoded values) is untouched; only the mask metadata is gone.

How to install it

Via ComfyUI Manager: search ComfyUI Impact Pack, install, restart. Manually:

cd ComfyUI/custom_nodes
git clone https://github.com/ltdrdata/ComfyUI-Impact-Pack comfyui-impact-pack
cd comfyui-impact-pack
python -m pip install -r requirements.txt   # ComfyUI's python; python_embeded on portable

then restart. No models, no dependencies beyond the base pack - this is a pure metadata operation.

Common issues & troubleshooting

A downstream sampler is only touching part of the image and I don't know why. Trace back and check whether the latent picked up a noise mask somewhere upstream - VAEEncodeForInpaint, a PreviewBridge (latent) with a mask drawn on it, or any other masking step. If you don't want that masked behavior at this point, drop a Remove Noise Mask node in before the sampler.

Nothing visibly changes when I connect this node. That's expected if the incoming latent never had a mask to begin with - the node has nothing to strip, so the output looks identical to the input. It's not broken; there was just no mask present.

I want the opposite - to apply a mask, not remove one. Wrong direction for this node. You'd want VAEEncodeForInpaint, or set a mask via PreviewBridge (latent)'s MaskEditor, or the pack's own mask-generation tools (ToBinaryMask, MASK to SEGS, and similar). Remove Noise Mask only ever takes a mask off; it never puts one on.

CategoryImpactPack/Util

Inputs (1)

NameTypeDefaultDescription
samplesLATENT

Outputs (1)

NameTypeDescription
LATENTLATENT