[ICCV 25] OmniPaint: Mastering Object-Oriented Editing via Disentangled Insertion-Removal Inpainting
334
stars
36
commits
Python
primary language
Mar 27, 2026
updated
Install dependencies and download OmniPaint weights:
bash scripts/setup.sh
Run this from the repository root.
python scripts/omnipaint_remove.py \
--input ./demo_assets/removal_samples/images/5.jpg \
--mask ./demo_assets/removal_samples/masks/5.png \
--output_dir ./outputs \
--seed 42 \
--steps 28 \
--device cuda:0
python scripts/omnipaint_remove.py \
--input ./demo_assets/removal_samples/images \
--mask ./demo_assets/removal_samples/masks \
--output_dir ./outputs \
--seed 42 \
--steps 28 \
--device cuda:0
python scripts/omnipaint_insert.py \
--background ./demo_assets/insertion_samples/backgrounds/background-2.png \
--mask ./demo_assets/insertion_samples/masks/mask-2.png \
--subject ./demo_assets/insertion_samples/subjects/subject-2.png \
--output_dir ./outputs \
--seed 42 \
--steps 28 \
--device cuda:0 \
--carvekit_device cuda:0
python scripts/omnipaint_insert.py \
--background ./demo_assets/insertion_samples/backgrounds \
--mask ./demo_assets/insertion_samples/masks \
--subject ./demo_assets/insertion_samples/subjects \
--output_dir ./outputs \
--seed 42 \
--steps 28 \
--device cuda:0 \
--carvekit_device cuda:0
The demo app supports both manual mask drawing and automatic mask generation using segmentation model.
Gradio environment setup:
bash scripts/app_setup.sh
Run this if you plan to launch app.py. The installation may take around 15 minutes due to SAM2 setup and weight downloads.
Run the app:
python app.py
demo_assets/removal_samples/images/*.{jpg,png,...} with matching masks in demo_assets/removal_samples/masks/*.{jpg,png,...} (same basenames).demo_assets/insertion_samples/backgrounds/background-XX.png, masks in demo_assets/insertion_samples/masks/mask-XX.png, subjects in demo_assets/insertion_samples/subjects/subject-XX.png. Direct basename alignment also works.See cfd_score for setup and usage.
If you find OmniPaint useful, please cite our paper:
@inproceedings{yu2025omnipaint,
title={Omnipaint: Mastering object-oriented editing via disentangled insertion-removal inpainting},
author={Yu, Yongsheng and Zeng, Ziyun and Zheng, Haitian and Luo, Jiebo},
booktitle={ICCV},
pages={17324--17334},
year={2025}
}
24 commits
12 commits
Python
96.6%
Shell
3.4%
[ICCV 25] OmniPaint: Mastering Object-Oriented Editing via Disentangled Insertion-Removal Inpainting
334
stars
36
commits
Python
primary language
Mar 27, 2026
updated
Install dependencies and download OmniPaint weights:
bash scripts/setup.sh
Run this from the repository root.
python scripts/omnipaint_remove.py \
--input ./demo_assets/removal_samples/images/5.jpg \
--mask ./demo_assets/removal_samples/masks/5.png \
--output_dir ./outputs \
--seed 42 \
--steps 28 \
--device cuda:0
python scripts/omnipaint_remove.py \
--input ./demo_assets/removal_samples/images \
--mask ./demo_assets/removal_samples/masks \
--output_dir ./outputs \
--seed 42 \
--steps 28 \
--device cuda:0
python scripts/omnipaint_insert.py \
--background ./demo_assets/insertion_samples/backgrounds/background-2.png \
--mask ./demo_assets/insertion_samples/masks/mask-2.png \
--subject ./demo_assets/insertion_samples/subjects/subject-2.png \
--output_dir ./outputs \
--seed 42 \
--steps 28 \
--device cuda:0 \
--carvekit_device cuda:0
python scripts/omnipaint_insert.py \
--background ./demo_assets/insertion_samples/backgrounds \
--mask ./demo_assets/insertion_samples/masks \
--subject ./demo_assets/insertion_samples/subjects \
--output_dir ./outputs \
--seed 42 \
--steps 28 \
--device cuda:0 \
--carvekit_device cuda:0
The demo app supports both manual mask drawing and automatic mask generation using segmentation model.
Gradio environment setup:
bash scripts/app_setup.sh
Run this if you plan to launch app.py. The installation may take around 15 minutes due to SAM2 setup and weight downloads.
Run the app:
python app.py
demo_assets/removal_samples/images/*.{jpg,png,...} with matching masks in demo_assets/removal_samples/masks/*.{jpg,png,...} (same basenames).demo_assets/insertion_samples/backgrounds/background-XX.png, masks in demo_assets/insertion_samples/masks/mask-XX.png, subjects in demo_assets/insertion_samples/subjects/subject-XX.png. Direct basename alignment also works.See cfd_score for setup and usage.
If you find OmniPaint useful, please cite our paper:
@inproceedings{yu2025omnipaint,
title={Omnipaint: Mastering object-oriented editing via disentangled insertion-removal inpainting},
author={Yu, Yongsheng and Zeng, Ziyun and Zheng, Haitian and Luo, Jiebo},
booktitle={ICCV},
pages={17324--17334},
year={2025}
}
24 commits
12 commits
Python
96.6%
Shell
3.4%