Nodes/Comfyui lama remover/Big lama Remover(IMG)
ComfyUI Node

Big lama Remover(IMG)

The lama remover for when your mask is an image, not a MASK

By Layer-norm·Created 3 years ago·Updated 2 years ago· 159
Big lama Remover(IMG)
  • images
  • masks
  • images
mask_threshold250
gaussblur_radius8
invert_maskfalse

This is the same node as its sibling LamaRemover, with exactly one difference: where that node wants ComfyUI's native MASK type for the region to erase, this one wants an IMAGE. Everything else - the model, the parameters, the output - is identical, right down to sharing the same Python module in the pack. If you already have LamaRemover working, LamaRemoverIMG is already installed; there's nothing extra to add.

The reason this variant exists is a plumbing problem, not a modeling one. ComfyUI's MASK type is a single-channel tensor, and plenty of nodes produce it natively - an alpha channel off Load Image, a mask editor, a segmenter. But just as often your mask comes from somewhere that only speaks in ordinary images: a custom web front-end where a user paints on a canvas and posts the result back as a picture, an image-based mask generator from another pack, a black-and-white PNG you loaded straight off disk. Normally you'd bridge that gap with a separate "Image to Mask" conversion node before you could use it anywhere. LamaRemoverIMG skips that step - feed it the grayscale image directly as masks, and it applies the same bright-pixels-mean-erase convention as the regular node.

The actual removal is the same LaMa checkpoint doing the same job described in the sibling article: a single deterministic CNN pass, no prompt, no diffusion sampling, good for erasing something and letting the network fill the hole with plausible surrounding texture. It's not built to invent new content - for that you want a diffusion-based inpaint. What differs here is purely how the mask gets in the door.

Inputs and outputs that matter

  • images (IMAGE) - the source picture.
  • masks (IMAGE) - the mask, but as a regular image instead of a MASK tensor. Bright/white areas mark what gets erased, same as the sibling node.
  • mask_threshold (INT, default 250, range 0–255) - how bright a pixel in that image needs to be before it counts as "erase." Since you're feeding a plain image rather than a purpose-built mask, this is worth checking first if your mask came from a lossy source (a compressed PNG, a downsampled canvas export) that isn't cleanly black-and-white.
  • gaussblur_radius (INT, default 8, range 0–20) - blurs the mask edge before the model sees it, so the erased patch blends rather than leaving a hard seam.
  • invert_mask (BOOLEAN, default false) - flips which side is erased, in case whatever produced your mask image uses the opposite convention (white-means-keep instead of white-means-erase).
  • Output: images (IMAGE) - the filled-in result, same as the sibling node.

How to install it

It ships in the same pack as LamaRemover: search "Comfyui lama remover" in ComfyUI Manager, or clone it by hand:

cd ComfyUI/custom_nodes
git clone https://github.com/Layer-norm/comfyui-lama-remover.git

Restart ComfyUI and both nodes show up. The big-lama.pt checkpoint downloads automatically on first run; if it doesn't, grab it manually from the Sanster/models release and place it in ComfyUI/custom_nodes/comfyui-lama-remover/ckpts/.

Common issues & troubleshooting

You already have a proper MASK. Don't reach for this node just because it exists - if your mask is coming from Load Image's alpha, a mask editor, or a segmenter, that's already a MASK and the plain LamaRemover is the right node. Converting a real mask to an image just to feed this one adds a step for nothing.

ComfyUI won't let you connect the wire. MASK and IMAGE sockets aren't interchangeable - if you're switching between the two lama-remover nodes, you can't just rewire the same connection. Either put a mask/image conversion node in between, or use whichever variant actually matches the type coming out of your upstream node.

Out-of-memory on a large image. Same cause as the sibling node - LaMa processes the full frame, so a big source image can exceed VRAM. Crop down to the region around the mask first and stitch the result back in, rather than feeding the model the whole picture.

Nothing looks erased, or the wrong area got erased. Check mask_threshold and invert_mask in that order. An image-sourced mask is more likely to have soft or inverted values than a native MASK, so these two settings are the first place to look before assuming the node is broken.

CategoryLamaRemover

Inputs (5)

NameTypeDefaultDescription
imagesIMAGE
masksIMAGE
mask_thresholdINT2500–255
gaussblur_radiusINT80–20
invert_maskBOOLEANfalse

Outputs (1)

NameTypeDescription
imagesIMAGE