Self-host Rembg
v2.0.87Remove image backgrounds via CLI, library, server, Docker
docker run -v .:/data danielgatis/rembg i /data/input.png /data/output.png- Stars
- 25 387
- Storage
- ~1.6GB (CPU image), ~11GB (NVIDIA CUDA GPU image, models not included)
- Requires
- ONNX Runtime
danielgatis/rembgWhat is Rembg?
Rembg strips the background out of images and offers the same engine four ways: a Python library, a command-line tool, a local HTTP server with a REST API and a Gradio page, and a Docker container. It supports a set of ONNX segmentation models - the u2net family, ISNet, several BiRefNet checkpoints, SAM and BRIA's RMBG-2.0, which is the default - fetching weights automatically into a local model directory on first use, and it can be pointed at your own converted model files. Edge-quality options cover alpha matting, ViTMatte, colour decontamination, mask-only output and background colour replacement, along with batch processing of whole folders including a watch mode. Inference runs on CPU or with NVIDIA CUDA and AMD ROCm GPUs. Install it with pip (Python 3.11 to 3.13) or pull danielgatis/rembg and pass the same rembg subcommands to docker run; the server listens on port 7000. Two optional backends send images to the commercial withoutBG and Atlas Cloud APIs instead of a local model. The code is MIT-licensed, while each model carries its own terms: the default RMBG-2.0 weights need a BRIA commercial deal before business use.
Rembg alternatives
unbagrndUnbagrnd - Free, Fast & Open-source AI-powered background remover for Windows, macOS, Linux and Android.Compareunbagrnd with Rembg
sdnextSelf-hosted, open-source Stable Diffusion web UI to generate, caption, upscale and edit images and video, with many GPU backends and model quantization for low VRAM.Comparesdnext with Rembg
app.enfugue.aiSelf-hosted open-source web app for studio-quality AI image/video generation with Stable Diffusion, unified pipeline, CivitAI browser, optional auth, and JSON API.Compareapp.enfugue.ai with Rembg
ComfyUISelf-hosted, open-source AI engine for visual creators with a node-based workflow system covering images, video, 3D, audio, and text.CompareComfyUI with Rembg
InvokeAISelf-hosted, open-source AI image generation studio with a layered Unified Canvas, node-based workflows, ControlNet, and broad local model support from SD 1.5 to Flux.CompareInvokeAI with Rembg
Stable Diffusion WebUI ForgeSelf-hosted, open-source Stable Diffusion web UI that improves GPU memory management and speeds up inference, with ControlNet, IP-Adapter and Flux quant support.CompareStable Diffusion WebUI Forge with Rembg
ImgCompressSelf-hosted Docker app for compressing, converting, and cropping 70+ image formats with local AI background removal — zero cloud uploads.CompareImgCompress with Rembg
StackResumeSelf-hosted AI resume builder with multi-agent pipeline, JD tailoring, and export to PDF, Word, and OpenDocument.CompareStackResume with Rembg
Should you self-host Rembg?
Rembg scores 79/100 on selfhost.directory (how scoring works) and ranks #1 of 13 in Image Processing. It has 25 387 GitHub stars, +248 in the last 30 days.
It shipped 12 stable releases in the past year. The latest, v2.0.87, came out on 6 November 2026. New versions land roughly every 2 weeks.
Setup is easy: most people get it running in one sitting. An official Docker image is available. It is MIT-licensed and written mostly in Python.
Its closest alternative on selfhost.directory is Thumbor (73/100, 10 532 stars). Rembg scores higher overall. See Rembg vs Thumbor side by side.
Features
- Alpha matting
- Background colour replacement
- Batch folder processing
- Built-in web UI
- Colour decontamination
- Command Line Interface
- Custom Model Support
- GPU Acceleration
- HTTP server mode
- Image background removal
- Mask-only output
- Multiple AI segmentation models
- Python library API
- REST API
- ViTMatte edge refinement
Rembg README
FAQ
When will this library support Python version 3.xx?
Python support follows whatever versions the ONNX Runtime dependency itself supports, so it is decided by onnxruntime compatibility rather than by Rembg.
More in Image Processing
ReubahSelf-hosted web tool for converting documents and processing images with support for multiple formats including JPG, PNG, WebP, PDF, DOCX, and more.
SnapOtterOpen-source, self-hosted file-processing suite with 200+ image, video, audio, PDF and document tools, local AI, a REST API and pipelines.
social-image-serverSelf-hosted server that auto-generates unique Open Graph images for every page using headless Chrome. Supports URL capture and custom templates.
ThumborSelf-hosted, open-source imaging server that crops, resizes and filters photos on demand with AI face-aware detection and WebP/AVIF output; runs via pip or Docker.
unbagrndUnbagrnd - Free, Fast & Open-source AI-powered background remover for Windows, macOS, Linux and Android.
url-to-pngSelf-hosted, open-source PNG screenshot service from URLs using Playwright with caching (S3/CouchDB/filesystem) and Prometheus metrics.
withoutbgPython SDK for local and cloud background removal (pip install withoutbg)
CompreFaceOpen-source face recognition system you can self-host. Provides REST API for detection, verification, recognition, age/gender/mask/pose analysis.
Digicardself-hosted, open-source web app for composing simple graphics and virtual cards: text, images, shapes, Pixabay backgrounds and image export, with no account needed.
DigifaceSelf-hosted, open-source avatar maker built on the Avataaars art: twelve customization options, random generation, PNG export at 900x960, and four interface languages.
FlyimgSelf-hosted, open-source image optimization service: resize, crop and compress any image URL on the fly and serve AVIF, WebP or MozJPEG from one Docker container.
FlyReq Image StudioFlyReq Image Studio is a self-hosted, open-source AI image and video generation workspace with multi-model support, infinite canvas, agent mode, and PWA.

0 comments