Nodes/ComfyUI Essentials/πŸ”§ Remove Latent Mask
ComfyUI Node Runs on cloud

πŸ”§ Remove Latent Mask

Strip a noise mask off a latent

By cubiqΒ·Created 3 years agoΒ·Updated about a year agoΒ· 1,152
πŸ”§ Remove Latent Mask
  • samples
  • LATENT

Latents in ComfyUI can secretly carry a noise mask. When you set up inpainting - via "Set Latent Noise Mask" or a VAE Encode (for Inpainting) - that mask rides along attached to the latent, telling the sampler to only denoise the masked region. Usually that's exactly what you want. But sometimes that mask sticks around when it shouldn't, and a downstream node either only touches part of the latent or throws an error you can't explain. RemoveLatentMask strips the mask off and hands back a clean latent that samples as a whole.

It's a small utility from ComfyUI Essentials by cubiq (Matteo Spinelli, also the author of ComfyUI_IPAdapter_plus). It does one narrow thing, and when you need it, nothing else quite substitutes.

How it works

A latent is a dict-like object; the noise mask is just an extra entry attached to it. This node passes the latent through but removes that mask entry, so anything reading the latent afterward sees a plain, unmasked latent and denoises every pixel of it. It doesn't change the latent's actual content - just detaches the "only work here" instruction.

The inputs and outputs that matter

  • samples (LATENT) - the latent that's carrying a mask you want gone.
  • LATENT (output) - the same latent, mask removed. Wire it into your sampler or whatever was misbehaving.

No parameters. It's a clean/strip operation, nothing to tune.

How to install it

ComfyUI Manager: search ComfyUI Essentials, install, restart. Or:

cd ComfyUI/custom_nodes
git clone https://github.com/cubiq/ComfyUI_essentials
pip install -r ComfyUI_essentials/requirements.txt

then restart. Nothing to download.

Common issues & troubleshooting

Only part of my image is being denoised and I don't know why. This is the exact symptom of a stray noise mask. If you did any inpainting-style setup earlier in the graph - a Set Latent Noise Mask, an inpaint VAE encode - the mask may still be attached. Drop this node in before the sampler to clear it and denoise the full latent.

I still want the inpaint behavior somewhere. Then don't remove the mask on that branch. Use this only where you specifically need the whole latent sampled - for example, a second pass that should refine the entire image, not just the previously-masked area.

It didn't change anything visible. If the latent didn't have a mask to begin with, this node is a no-op - which is fine and harmless. It's insurance, not a transform.

Node missing after a Comfy update. Essentials is maintenance-only as of April 2025, and pack nodes have broken on newer ComfyUI. Update through Manager; if it's genuinely broken by a Comfy change, rolling back is the community's usual fallback.

Categoryessentials/utilities

Inputs (1)

NameTypeDefaultDescription
samplesLATENTβ€”

Outputs (1)

NameTypeDescription
LATENTLATENTβ€”