geekyutao/Inpaint-Anything

Inpaint anything using Segment Anything and inpainting models.

What it solves

Inpaint Anything provides a unified framework for removing, filling, or replacing objects within images, videos, and 3D scenes. It simplifies the process of editing visual content by allowing users to select objects via clicks or text prompts and then modify them using generative AI models.

How it works

The project integrates several powerful vision models to achieve its goals:

  • Segmentation: Uses the Segment Anything Model (SAM) to isolate the target object.
  • Removal: Employs inpainting models like LaMa to fill the gap left by a removed object.
  • Filling/Replacing: Uses text-guided models such as Stable Diffusion (SDXL, FLUX.1-Fill) to generate new content based on user text prompts.
  • Video/3D Extension: For videos and 3D scenes, it uses tracking models (like OSTrack or SAM 3 video predictor) to maintain object consistency across frames or views, followed by inpainting and novel view synthesis (via NeRF).

Who it’s for

This tool is designed for content creators, researchers, and developers who need high-quality object removal or replacement in visual media. It also includes specialized tools for robotics researchers to prepare egocentric data by removing human hands from training footage.

Highlights

  • Multi-modal support: Works across 2D images, videos, and 3D scenes.
  • Flexible selection: Supports both point-click selection and open-vocabulary text prompts (in the main_2026 branch).
  • Robotics application: Includes a dedicated remove_hands.py script for Human-to-Robot synthesis pipelines.
  • High resolution: Supports 2K resolution and various aspect ratios.

Related

  • Project
  • Project
  • Project
  • Project
  • Project