inswapper - AI Image Tools Tool
Overview
inswapper is an open-source, one‑click face swapping and restoration toolkit that builds on the insightface swapping model and ONNX runtime to deliver fast, realistic face replacements. The project provides both a simple programmatic API (process() in swapper.py) and a command-line script that support multi-source to multi-target swapping workflows, plus optional post‑processing hooks (face restoration, background enhancement, upscaling) powered by CodeFormer and other restoration tools. According to the repository, the recommended swap model is distributed as inswapper_128.onnx and the codebase will automatically download required restoration assets (for example, the CodeFormer space) when first run. ([github.com](https://github.com/haofanwang/inswapper)) The implementation is optimized for ONNX inference: it runs with CPU via onnxruntime by default, and users can install onnxruntime-gpu to enable CUDA acceleration. The README documents practical example usage (Python API and a one‑line CLI invocation) and several CLI flags — e.g., --face_restore, --background_enhance, --face_upsample, --upscale and --codeformer_fidelity — that let you trade quality for speed. The project also highlights a related release called InstantID as an ID‑preserving generation method in the repo news section. ([github.com](https://github.com/haofanwang/inswapper))
GitHub Statistics
- Stars: 695
- Forks: 110
- Contributors: 3
- Primary Language: Python
- Last Updated: 2024-01-18T03:56:07Z
The GitHub repository is actively used by the community: it has hundreds of stars and over one hundred forks, open issues and several pull requests, with the last recorded commit on January 18, 2024. The codebase shows a small core maintainer set (two main contributors listed) and a history of merges from community forks, indicating contributor-driven maintenance rather than a large institutional team. For quick facts, see the project page (stars, forks, issues) and the commits history. ([github.com](https://github.com/haofanwang/inswapper))
Installation
Install via pip:
git clone https://github.com/haofanwang/inswapper.gitcd inswapperpython3 -m venv venvsource venv/bin/activatepip install -r requirements.txt# (optional GPU) pip install onnxruntime-gpu OR (CPU) pip install onnxruntimemkdir checkpointswget -O ./checkpoints/inswapper_128.onnx https://github.com/facefusion/facefusion-assets/releases/download/models/inswapper_128.onnxgit lfs installgit clone https://huggingface.co/spaces/sczhou/CodeFormer Key Features
- One‑click face swapping using insightface / inswapper_128.onnx model for quick realistic replacements.
- ONNX Runtime inference with optional onnxruntime-gpu for CUDA acceleration or onnxruntime for CPU.
- Integrated face restoration via CodeFormer to improve details and recover degraded facial features.
- CLI and Python API (process() and swapper.py) supporting multi‑source to multi‑target swaps.
- Postprocessing controls: background enhancement, face upsample, configurable upscale and CodeFormer fidelity.
Community
The project has meaningful community adoption (about 695 stars and ~110 forks on GitHub) and several open issues and pull requests reflecting active user testing and contributions; the commit history shows maintenance activity through January 18, 2024. Third‑party forks and integrations (e.g., RunPod workers, ReSwapper reproductions, and ComfyUI/ReActor or web‑UI adapters) demonstrate practical community-driven uses and deployment options; there are also user discussions (community posts and forks) reporting successful integrations and usage. Contributors are few (two primary contributors listed on the repo), so bug fixes and feature requests are largely handled via community PRs and forks. ([github.com](https://github.com/haofanwang/inswapper))
Key Information
- Category: Image Tools
- Type: AI Image Tools Tool