TS Lama Cleanup
Paint over the tourist, watch the watermark vanish, no Photoshop trip required
- image
TS Lama Cleanup is the "remove the thing" node for small jobs: tourists, watermarks, sensor dust, cables, the artifact that ruins an otherwise good shot. It's a paint-and-go inpainter powered by LaMa, and the whole experience lives inside the node - load an image with the in-node button, brush over the defect, and the region is cleaned up automatically the moment you release the mouse. No exporting to an editor, no hand-feeding masks through a separate inpaint chain.
LaMa (the "Large Mask Inpainting" model from Samsung) has been the workhorse of quick object removal for years - it's what A1111's inpaint and a pile of web tools quietly use. Its whole trick is that it fills large masks convincingly fast without a diffusion pass. That's exactly the trade you want for a power line; you do not want it for "regenerate this person's face", which is a diffusion job.
How it works
Since v9.3 the node is pure PyTorch - no upstream lama-cleaner dependency - and weights load from .safetensors in models/lama/ instead of pickled .ckpt. On first use it downloads the weights into that folder.
When you paint, the node crops around your mask's bounding box with a context padding (mask_padding, default 64 px), runs LaMa on that crop at the longest side you set via max_resolution (default 512), then feathers the composite seam back into the original. Edits are saved to the ComfyUI temp folder per session, so your working state survives between runs, and the IMAGE output emits the current cleaned state when the workflow executes.
The inputs that matter
Most of the inputs are internal - source_path, session_id, working_path are managed by the node's own UI and you don't type them. The ones you actually touch:
- brush_size - default 40 px. Bigger for watermarks and wires, smaller for dust spots.
- max_resolution - default 512, the longest side of the LaMa crop. Higher = more detail retained in the repair, slower. For a large erased area, bump this.
- mask_padding - default 64 px of context around the mask, so LaMa has real image to fill from. Raise it if repairs look like they're hallucinating.
- feather - default 4 px, the composite seam radius.
Output: image - the current cleaned-up state from the in-node editor.
Installation
This node ships in the comfyui-timesaver pack. ComfyUI Manager: search "Timesaver", install, restart. Or manually:
cd ComfyUI/custom_nodes
git clone https://github.com/AlexYez/comfyui-timesaver
cd comfyui-timesaver
python -m pip install -r requirements.txt
Restart ComfyUI. LaMa weights download on first use into models/lama/; you can also drop a .safetensors there yourself and it'll be picked up.
When to reach for it - and when not to
This is the fast, cheap cleanup pass. Tourists, watermarks, scratches, artifacts - yes, this is the node. The brush-on-the-node UI makes quick cleanups genuinely quicker than tabbing out to an editor.
Where it's the wrong tool: anything that needs the region regenerated with new content - a missing limb, a face, a large area where context is gone. LaMa is a fill-in model, not a content generator. For that you want the pack's TS Smart Inpaint (mask-driven regenerate with a sampler behind it) or a proper diffusion inpaint. The rule of thumb: if the eye can guess what should be there from the surroundings, LaMa handles it; if the model would have to invent it, LaMa will invent something unconvincing.
One tip from the README's own framing: it's ideal as a prototype cleanup before a heavier inpainter - kill the obvious stuff with LaMa, then let the expensive model spend its effort on what's actually hard.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| source_path | STRING | Internal: annotated path of the loaded source image. | |
| brush_size | INT | 401–400 | Brush diameter in image pixels. |
| max_resolution | INT | 512128–2048 | Maximum longest-side of the LaMa crop in pixels. |
| mask_padding | INT | 640–512 | Context padding around the mask bounding box. |
| feather | INT | 40–64 | Composite seam feather radius (pixels). |
| session_id | STRING | Internal: per-node working session id. | |
| working_path | STRING | Internal: path to the current temp working file. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | Current cleaned-up image from the in-node editor. |