sczhou/ProPainter
Optical flow and a Transformer for mask-guided video inpainting
Automated SPDX check for reference only — not legal advice. Disclaimer
GitHub Star History
Full-history star trajectory from GitHub official history. Switch ranges or hover any point for exact counts.
Evidence-Backed Technical Brief
AI Deep ReviewArchitecture & Core Mechanics
ProPainter is a mask-driven video inpainting pipeline, not a per-frame image filter. RAFT estimates optical flow, a recurrent network completes the missing motion field in masked regions, and ProPainter uses propagation and a Transformer to reconstruct the missing content. The distinction matters: propagation reuses evidence visible in other frames, while reconstruction fills what that evidence cannot recover.
inference_propainter.py is the main Python entry point. The repository separates RAFT code in RAFT/, model code in model/, training configuration in configs/, and browser demos in web-demos/. The pretrained path uses separate RAFT, flow-completion, and ProPainter checkpoints. PyTorch and Torchvision underpin the model stack; PyAV, OpenCV, and imageio-ffmpeg are dependencies on the media side. Integration is centered on the CLI and its file inputs, with a separate interactive demo for object selection.
Key Capabilities & Differentiators
The CLI takes an MP4 or extracted frames plus a mask and writes results to results/. The shipped examples cover removing a moving object using a directory of frame-wise masks and completing a masked video using a single PNG. For research use, the repository includes separate training configs and evaluation scripts for flow completion and the full model, dataset preparation for YouTube-VOS and DAVIS, and an optional optical-flow precomputation script.
GPU memory can be tuned through processing resolution, precision, temporal context, and sub-video length. Estimated VRAM at 720×480 for an 80-frame segment is 13 GB in FP32 or 8 GB in FP16. At 1280×720, the 50-frame estimates are 28 GB and 19 GB respectively; at 80 frames, FP32 runs out of memory in the reported setup and FP16 is estimated at 25 GB. These are sizing estimates for the listed configurations, not hardware guarantees.
Trade-offs & Limitations
Compared with frame-by-frame image inpainting, ProPainter explicitly uses motion across frames, a better fit when a moving subject leaves a region that must look coherent throughout the clip. The extra flow and temporal processing raises GPU memory cost, and the CLI expects you to supply masks. The interactive demo helps with selection; community projects such as ProPainter WebUI and the ComfyUI nodes offer different workflow entry points, not a verified quality or speed advantage.
To fit a tighter VRAM budget, shorten the default 80-frame --subvideo_length, enable --fp16, or process at a lower resolution. Reducing the default --neighbor_length of 10 or increasing the default --ref_stride of 10 saves memory by giving the model fewer neighboring frames or more sparsely sampled references. Lower resolution can sacrifice detail, and less temporal context can leave fewer useful views for reconstructing occluded regions, so check results on representative footage. The code and models use NTU S-Lab License 1.0 for non-commercial use; running locally does not remove that restriction.
Hardware & Deployment Guide
The reference setup uses a Python 3.8 Conda environment and pip install -r requirements.txt, with CUDA 9.2+, PyTorch 1.7.1+, and Torchvision 0.8.2+. Treat those as minimums, not a compatibility matrix: choose a PyTorch and Torchvision pair that works with your CUDA runtime and GPU driver, then validate it with one of the bundled examples. Release v0.1.0 (September 3, 2023) primarily distributes pretrained weights rather than a packaged runtime.
For local inference, stage ProPainter.pth, recurrent_flow_completion.pth, and raft-things.pth in weights/, or let inference fetch them on the first run. Pre-staging avoids that first-run network dependency; i3d_rgb_imagenet.pt is for VFID evaluation, not ordinary inference. Run the CLI against your video and masks, or use the local interactive demo under web-demos/hugging_face if you need an object-selection interface. A hosted Hugging Face demo is also available for trial use.
Non-commercial video restoration or object removal with masks, a local CUDA GPU, and a need for fills that stay coherent across frames.
You need commercial rights without separate permission, an automatic mask-free CLI, or native-resolution HD processing on a low-VRAM GPU.
Quick Start & Installation
git clone https://github.com/sczhou/ProPainter.git
Comparison vs. Top Voice, Vision & Video Alternatives
Full comparison →| Repository | Stars | 7d Trend | Stack | License | Core Positioning |
|---|---|---|---|---|---|
| ProPainter ★ | 7.1k | +15 | Python | — | Optical flow and a Transformer for mask-guided video inpainting |
| ComfyUI | 149.9k | +945 | Python | GPL-3.0 | A node-graph engine for building and running multimodal AI workflows locally |
| MoneyPrinterTurbo | 147.5k | +1.7k | Python | MIT | A self-hosted Python pipeline that turns topics into short videos |
| OpenMontage | 85.5k | +1.6k | Python | AGPL-3.0 | Agent-led video production from brief to finished edit |
AI Context Briefing (for Claude / Cursor / Windsurf)
Standardized architecture summary & quickstart commands ready to paste into coding agents.
curl -sL https://repoforai.com/repo/sczhou/ProPainter.md
Active README embeds unlock Hot-Tier 6h Telemetry Refresh automatically (zero pay-to-rank).
Frequently Asked Questions about ProPainter
How do I integrate ProPainter into an existing editing pipeline?
How much GPU memory do I need, and what should I tune first?
Can I self-host it, and does that permit commercial use?
When should I choose ProPainter over frame-by-frame inpainting or a community integration?
Upstream README & Documentation
This profile focuses on independent engineering analysis and live telemetry. Read the full upstream README, changelog, and examples directly on GitHub.
Top 10 Breakout Open-Source AI Repos, Every Thursday
Signal-only digest of fast-growing AI repos, SPDX license alerts, and architecture picks. Zero spam.
Zero spam · 1-click unsubscribe · Privacy Policy