A production-ready, batteries-included Docker image for IOPaint. Built for stability, ease of use, and full feature support out-of-the-box. Optimized for NAS and Home Lab environments.
Unlike the minimal official image, this build is designed to be "Plug & Play" with zero configuration headaches. It solves common issues found in other builds:
ModuleNotFoundError for RemoveBG, RealESRGAN, GFPGAN, and RestoreFormer. All dependencies are baked in.LOW_MEM=true flag specifically tuned for Intel Celeron/N-series NAS devices (unloads models to save RAM).curl) ensure the container is restarted automatically if it freezes.Copy this into a compose.yaml file and run docker compose up -d.
name: iopaint
services:
iopaint:
image: jonach1998/iopaint:latest
container_name: iopaint
hostname: iopaint
restart: unless-stopped
ports:
- "8080:8080"
volumes:
# CRITICAL: Persistent cache for AI Models.
# Prevents re-downloading gigabytes of models on every restart.
- ./iopaint_cache:/app/cache
environment:
# --- Hardware Configuration ---
- DEVICE=cpu # Options: cpu, cuda, mps
- MODEL=lama # Options: lama, mat, zits, mgan, etc.
# --- Performance & NAS Tuning ---
- LOW_MEM=true # Set 'true' for NAS/Low-RAM devices. 'false' for max speed.
# --- Feature Toggles (All Enabled by Default) ---
# Set to 'false' if you want to disable a specific feature.
# - ENABLE_REMOVE_BG=true
# - ENABLE_REALESRGAN=true
# - ENABLE_GFPGAN=true
# - ENABLE_INTERACTIVE_SEG=true
# --- Intel/CPU Optimizations ---
- OMP_NUM_THREADS=4
- MKL_NUM_THREADS=4
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/"]
interval: 30s
timeout: 10s
retries: 3
You can customize the container using these standard Environment Variables.
| Variable | Default | Description |
|---|---|---|
PORT | 8080 | Internal container listening port. |
DEVICE | cpu | Hardware accelerator (cpu, cuda for NVIDIA, mps for Mac). |
MODEL | lama | Inpainting model to use. lama is recommended for general use. |
QUALITY | 95 | JPEG/PNG Save quality (1-100). |
LOW_MEM | false | Critical for NAS. If true, unloads models from RAM when not in use. |
All features are Enabled (true) by default. You can disable them to save startup time or resources.
| Variable | Description |
|---|---|
ENABLE_REMOVE_BG | Enables Background Removal tool (uses rembg). |
ENABLE_REALESRGAN | Enables Super Resolution / Upscaling tool. |
ENABLE_GFPGAN | Enables Face Restoration tool. |
ENABLE_RESTOREFORMER | Enables alternative Face Restoration tool. |
ENABLE_INTERACTIVE_SEG | Enables Segment Anything (SAM) - Heavy on RAM. |
| Container Path | Purpose |
|---|---|
/app/cache | Required. Stores downloaded AI models (PyTorch/HuggingFace). Mount this to a folder on your host to persist downloaded models. |
/data | (Optional) Input directory if you prefer file-system mapping over Drag & Drop. |
/output | (Optional) Output directory for saved images. |
I don't see the "Remove Background" button.
Wait a few seconds after startup. The first time you use a feature, the container downloads the model. Check logs with docker logs -f iopaint to ensure no download errors occurred.
My NAS is slow when Upscaling.
Upscaling (RealESRGAN) is computationally expensive on CPUs. This is normal behavior. Ensure LOW_MEM=true is set to prevent OOM (Out Of Memory) crashes.
Where are the images saved?
By default, this image is configured for web usage. When you save an image, it downloads to your computer's browser downloads folder. If you want to save to the NAS, mount a volume to /output and set OUTPUT_DIR=/output.
Content type
Image
Digest
sha256:58b65c9f0…
Size
8.1 GB
Last updated
9 months ago
docker pull jonach1998/iopaint