Nodes/ComfyUI_LayerStyle_Advance/LayerUtility: LaMa(Advance)
ComfyUI Node Runs on cloud

LayerUtility: LaMa(Advance)

LaMa — erase an object with a mask, no prompt needed

By chflame163·Created 2 years ago·Updated 4 months ago· 696
LayerUtility: LaMa(Advance)
  • image
  • mask
  • image
lama_model
device
invert_maskfalse
mask_grow25
mask_blur8

This is object removal in the older sense: mask the thing you don't want, and a dedicated inpainting model fills the hole with plausible background - no prompt, no diffusion sampler, none of the modern edit-model machinery. It's a repackage of IOPaint (formerly Lama Cleaner), and it gives you a choice of several classic inpainting architectures rather than locking you into one. If you just need clean object removal and don't want to build a whole masked-diffusion pipeline for it, this is the fast, direct route.

The model choice is the main thing to understand: lama_model picks between seven options - lama (the default and the name people mean when they say "LaMa," strong general-purpose removal), ldm (a latent-diffusion variant), zits, mat, fcf, manga (tuned for manga/line-art content specifically), and spread. Each is a different published inpainting architecture bundled behind one interface; lama is the sane default unless you've got a specific reason to reach for one of the others (manga art being the obvious case for manga). Beyond the model, mask is required alongside image - this node doesn't detect what to remove, you have to hand it a mask (from SAM, from Human Parts Ultra, from wherever). invert_mask flips which side of the mask gets erased. mask_grow (default 25, range -255 to 255) expands the masked region outward before inpainting - positive grows it, negative shrinks it, and a little extra margin around the object usually gives cleaner results than a tight mask. mask_blur (default 8) softens the mask edge so the fill blends rather than leaving a visible seam. device picks CUDA or CPU - CUDA is meaningfully faster here since these are real neural inpainting models, not simple algorithmic fills. Output is a single image.

Install the pack via ComfyUI Manager (search "ComfyUI Layer Style Advance") or git clone https://github.com/chflame163/ComfyUI_LayerStyle_Advance into custom_nodes/, restart, run the requirements installer for your setup. The model files are a separate download from the author's Baidu Netdisk or Google Drive links, and go into ComfyUI/models/lama. Note this is a real download commitment - seven different architectures worth of weights if you want all the options available, though you only strictly need whichever ones you plan to use.

This node's main practical failure mode is a bad mask, not a broken install: if the erased region comes back with a visible ghost of the original object or an obviously wrong texture, the fix is usually more mask_grow (give the model more surrounding context to work with) rather than anything model-related. If you're getting seams at the mask boundary, raise mask_blur. Beyond that, this node shares the pack's general dependency footprint - if it fails to import at all, it's worth checking the same things that break the rest of the pack (an outdated opencv-contrib-python, or a stale combined install if you had the old pre-split LayerStyle pack around before installing this one) rather than assuming LaMa specifically is broken.

Category😺dzNodes/LayerUtility

Inputs (7)

NameTypeDefaultDescription
imageIMAGE
maskMASK
lama_modelCOMBO7 options: lama, ldm, zits, mat, fcf, manga, +1
deviceCOMBO2 options: cuda, cpu
invert_maskBOOLEANfalse
mask_growINT25-255–255
mask_blurINT8-255–255

Outputs (1)

NameTypeDescription
imageIMAGE