Nodes/ComfyUI-RMBG/Lama Remover (RMBG)
ComfyUI Node Runs on cloud

Lama Remover (RMBG)

Lama Remover (RMBG)

By 1038lab·Created 2 years ago·Updated 8 days ago· 2,051
Lama Remover (RMBG)
  • images
  • masks
  • images
removal_strength230
edge_smoothness8

Lama Remover erases things. Give it an image and a mask of something you want gone - a watermark, a stray person, a logo, a power line - and it paints over that region with plausible background. It's an object eraser, not a background remover, so don't confuse it with the RMBG node: RMBG cuts the subject out and keeps it, this fills a hole in and makes something disappear.

It runs on LaMa (Large Mask inpainting), a fast, purpose-built inpainting model that was designed for exactly this - filling masked regions, and specifically holding up on big masks where naive inpainters smear. The key thing about LaMa versus a diffusion inpaint is that it's a single feed-forward pass, no sampler, no steps, no prompt. That makes it quick and deterministic, and it's genuinely good at reconstructing repetitive or texture-y backgrounds (walls, grass, sky, pavement). It's less magic on complex structured scenes where it has to invent detail, but for "remove this and blend the background," it's the workhorse.

The inputs are refreshingly simple. images is your source. masks is the region to erase - anything, black background with white where you want the removal. That mask is the whole game: LaMa fills whatever the mask covers, so where the mask comes from matters more than any setting. Pair this node with a Segment node (mask the object by text prompt) or one of the parsing nodes, and you've got a "describe it, delete it" pipeline. The two knobs are removal_strength (0–255, default 230), which controls how completely it commits to erasing under the mask, and edge_smoothness (0–20, default 8), which feathers the boundary so the patch blends instead of showing a seam. The single output is images - the cleaned picture, no separate mask out.

Install is the pack standard: "Comfyui-RMBG" in ComfyUI Manager, or cd ComfyUI/custom_nodes && git clone https://github.com/1038lab/ComfyUI-RMBG, then pip install -r requirements.txt and restart. The LaMa weights auto-download on first run and cache; it's a compact model, so this is one of the cheaper nodes here to run.

Practical notes. The mask is everything - a tight mask leaves traces of the object (halos, edge fragments), so it usually pays to grow the mask a little past the object before feeding it in (use mask_offset on your segment node, or dilate it). LaMa fills from surrounding context, so removing something against a busy or unique background is where it struggles; against a uniform or repeating background it's near-invisible. For genuinely hard removals - a big object in a detailed scene where you need the fill to invent convincing new content - a diffusion inpaint (Flux Fill and its object-removal fine-tunes) will beat LaMa on realism, at the cost of being much slower and prompt-dependent. LaMa's pitch is speed and reliability on the common case.

Where it fits in a workflow: it's the delete step. Mask an object with SAM2/SAM3 or a Segment node, hand the mask to Lama Remover, and the object's gone with the background rebuilt. It's also the fast first pass even when you plan to diffusion-inpaint afterward - clear the object with LaMa, then let a diffusion model refine the patch. For watermarks and simple distractions, though, LaMa alone is usually all you need, and it's a lot less fuss than spinning up a full inpaint sampler.

Category🧪AILab/🧽RMBG

Inputs (4)

NameTypeDefaultDescription
imagesIMAGEInput images to be processed
masksMASKMasks defining areas to be removed (white=remove)
removal_strengthINT2300–255Strength of the removal effect (higher values increase the effect area)
edge_smoothnessINT80–20Controls edge smoothness (higher values create smoother transitions)

Outputs (1)

NameTypeDescription
imagesIMAGE