Inpaint Anything
Inpaint anything using Segment Anything and inpainting models.
Install / Use
npx skills add geekyutao/Inpaint-AnythingInstalls into whichever agent you are using.
README
Inpaint Anything: Segment Anything Meets Image Inpainting
Inpaint Anything can inpaint anything in images, videos and 3D scenes!
- Authors: Tao Yu, Runseng Feng, Ruoyu Feng, Jinming Liu, Xin Jin, Wenjun Zeng and Zhibo Chen.
- Institutes: University of Science and Technology of China; Eastern Institute for Advanced Study.
- [Paper] [Website] [Hugging Face Homepage]
TL; DR: Users can select any object in an image by clicking on it. With powerful vision models, e.g., SAM, LaMa and Stable Diffusion (SD), Inpaint Anything is able to remove the object smoothly (i.e., Remove Anything). Further, prompted by user input text, Inpaint Anything can fill the object with any desired content (i.e., Fill Anything) or replace the background of it arbitrarily (i.e., Replace Anything).
🚧 New: main_2026 branch — modernized stack + robotics support (beta)
The main_2026
branch brings Inpaint Anything up to date with the 2026 model landscape, and adds
a new direction: data engineering for robotics.
| | main (this branch) | main_2026 |
| --- | --- | --- |
| Segmentation | SAM 1 | SAM 3 — plus open-vocabulary text prompts |
| Video / 3D tracking | OSTrack | SAM 3 video predictor — one less model and checkpoint |
| Video inpainting | STTN | ProPainter |
| Text-guided fill / replace | SD 2 (no longer downloadable) | SDXL, optional FLUX.1-Fill |
| Robotics | — | remove_hands.py — batch hand removal for Human-to-Robot pipelines |
Two things you can do there that you cannot do here:
- Name the object instead of clicking it.
--text_select "dog"finds every match, which also means the pipelines can run unattended over a whole dataset. - Prepare egocentric data for robot learning.
remove_hands.pyerases human hands from egocentric video and exports the masks — the hand removal and inpainting stage of Human-to-Robot synthesis pipelines such as Qwen-RobotManip and EgoEngine. On EgoMimic footage it matches human annotation at IoU 0.96, and it reconstructs the background rather than blacking the arm out.
git checkout main_2026
# then follow the Quick start in that branch's README
⚠️
main_2026is in beta. It needs Python ≥ 3.12, PyTorch ≥ 2.7 and CUDA ≥ 12.6 (SAM 3's floor), and the NeRF-based 3D path has not been end-to-end verified on that stack yet. Every legacy backend (SAM 1 / MobileSAM, OSTrack, STTN) is still selectable by flag, so you can fall back per stage.🤝 Contributions very welcome — especially on the robotics side. Issues and PRs against
main_2026are appreciated: more egocentric datasets, action retargeting, robot rendering and compositing, or newer inpainting backends. Please open an issue if you hit anything.
📜 News
[2026/7/28] <span style="color:red">🔥NEW</span> main_2026 branch (beta): upgraded to SAM 3 with text prompts, ProPainter for video, SDXL/FLUX for text-guided editing, and robotics support via remove_hands.py. OSTrack is no longer needed. Contributions welcome!
[2023/9/15] Remove Anything 3D code is available!
[2023/4/30] Remove Anything Video available! You can remove any object from a video!
[2023/4/24] Local web UI supported! You can run the demo website locally!
[2023/4/22] Website available! You can experience Inpaint Anything through the interface!
[2023/4/22] Remove Anything 3D available! You can remove any 3D object from a 3D scene!
[2023/4/13] Technical report on arXiv available!
🌟 Features
- [x] Remove Anything
- [x] Fill Anything
- [x] Replace Anything
- [x] Remove Anything 3D (<span style="color:red">🔥NEW</span>)
- [ ] Fill Anything 3D
- [ ] Replace Anything 3D
- [x] Remove Anything Video (<span style="color:red">🔥NEW</span>)
- [ ] Fill Anything Video
- [ ] Replace Anything Video
💡 Highlights
- [x] Any aspect ratio supported
- [x] 2K resolution supported
- [x] Technical report on arXiv available (<span style="color:red">🔥NEW</span>)
- [x] Website available (<span style="color:red">🔥NEW</span>)
- [x] Local web UI available (<span style="color:red">🔥NEW</span>)
- [x] Multiple modalities (i.e., image, video and 3D scene) supported (<span style="color:red">🔥NEW</span>)
<span id="remove-anything">📌 Remove Anything</span>
<!-- <table> <tr> <td><img src="./example/remove-anything/dog/with_points.png" width="100%"></td> <td><img src="./example/remove-anything/dog/with_mask.png" width="100%"></td> <td><img src="./example/remove-anything/dog/inpainted_with_mask.png" width="100%"></td> </tr> </table> --> <p align="center"> <img src="./example/GIF/Remove-dog.gif" alt="image" style="width:400px;"> </p>Click on an object in the image, and Inpainting Anything will remove it instantly!
- Click on an object;
- Segment Anything Model (SAM) segments the object out;
- Inpainting models (e.g., LaMa) fill the "hole".
Installation
Requires python>=3.8
python -m pip install torch torchvision torchaudio
python -m pip install -e segment_anything
python -m pip install -r lama/requirements.txt
In Windows, we recommend you to first install miniconda and
open Anaconda Powershell Prompt (miniconda3) as administrator.
Then pip install ./lama_requirements_windows.txt instead of
./lama/requirements.txt.
Usage
Download the model checkpoints provided in Segment Anything and LaMa (e.g., sam_vit_h_4b8939.pth and big-lama), and put them into ./pretrained_models. For simplicity, you can also go here, directly download pretrained_models, put the directory into ./ and get ./pretrained_models.
For MobileSAM, the sam_model_type should use "vit_t", and the sam_ckpt should use "./weights/mobile_sam.pt". For the MobileSAM project, please refer to MobileSAM
bash script/remove_anything.sh
Specify an image and a point, and Remove Anything will remove the object at the point.
python remove_anything.py \
--input_img ./example/remove-anything/dog.jpg \
--coords_type key_in \
--point_coords 200 450 \
--point_labels 1 \
--dilate_kernel_size 15 \
--output_dir ./results \
--sam_model_type "vit_h" \
--sam_ckpt ./pretrained_models/sam_vit_h_4b8939.pth \
--lama_config ./lama/configs/prediction/default.yaml \
--lama_ckpt ./pretrained_models/big-lama
You can change --coords_type key_in to --coords_type click if your machine has a display device. If click is set, after running the above command, the image will be displayed. (1) Use left-click to record the coordinates of the click. It supports modifying points, and only last point coordinates are recorded. (2) Use right-click to finish the selection.
Demo
<table> <tr> <td><img src="./example/remove-anything/person/with_points.png" width="100%"></td> <td><img src="./example/remove-anything/person/with_mask.png" width="100%"></td> <td><img src="./example/remove-anything/person/inpainted_with_mask.png" width="100%"></td> </tr> </table> <table> <tr> <td><img src="./example/remove-anything/bridge/with_points.png" width="100%"></td> <td><img src="./example/remove-anything/bridge/with_mask.png" width="100%"></td> <td><img src="./example/remove-anything/bridge/inpainted_with_mask.png" width="100%"></td> </tr> </table> <table> <tr> <td><img src="./example/remove-anything/boat/with_points.png" width="100%"></td> <td><img src="./example/remove-anything/boat/with_mask.png" width="100%"></td> <td><img src="./example/remove-anything/boat/inpainted_with_mask.png" width="100%"></td> </tr> </table> <table> <tr> <td><img src="./example/remove-anything/baseball/with_points.png" width="100%"></td> <td><img src="./example/remove-anything/baseball/with_mask.png" width="100%"></td> <td><img src="./example/remove-anything/baseball/inpainted_with_mask.png" width="100%"></td> </tr> </table><span id="fill-anything">📌 Fill Anything</span>
<!-- <tablRelated Skills
node-connect
385.5kDiagnose OpenClaw Android, iOS, or macOS node pairing, QR/setup code, route, auth, and connection failures.
blender-python-addon
40.5kBlender Python add-on rules for operators, panels, properties, registration, testing, and API-safe scripting
flutter-development-guidelines-cursorrules-prompt-file
40.5kCursor rules for Flutter development with MVVM architecture, Riverpod state management, Material widgets, and Dart style guidelines.
commit-push-pr
140.7kCommit, push, and open a PR
