diff --git a/README.md b/README.md index 517646ba..93afd3e7 100644 --- a/README.md +++ b/README.md @@ -45,6 +45,12 @@ Don't need AI tools? The lite image is 1.5 GB instead of 11 GB: docker run -d -p 1349:1349 -v stirling-data:/data stirlingimage/stirling-image:lite ``` +Have an NVIDIA GPU? The CUDA image accelerates background removal, upscaling, and OCR: + +```bash +docker run -d -p 1349:1349 --gpus all -v stirling-data:/data stirlingimage/stirling-image:cuda +``` + Open http://localhost:1349 in your browser. **Default credentials:** @@ -56,7 +62,7 @@ Open http://localhost:1349 in your browser. You will be asked to change your password on first login. This is enforced for all new accounts and cannot be skipped in production. -For Docker Compose, persistent storage, and other setup options, see the [Getting Started Guide](https://stirling-image.github.io/stirling-image/guide/getting-started). For details on the full vs lite image, see [Docker Tags](https://stirling-image.github.io/stirling-image/guide/docker-tags). +For Docker Compose, persistent storage, and other setup options, see the [Getting Started Guide](https://stirling-image.github.io/stirling-image/guide/getting-started). For details on all image variants (full, lite, cuda), see [Docker Tags](https://stirling-image.github.io/stirling-image/guide/docker-tags). ## Documentation diff --git a/apps/docs/guide/deployment.md b/apps/docs/guide/deployment.md index 7654cb6c..c428f139 100644 --- a/apps/docs/guide/deployment.md +++ b/apps/docs/guide/deployment.md @@ -2,12 +2,13 @@ Stirling Image ships as a single Docker container. The image supports **linux/amd64** and **linux/arm64**, so it runs natively on Intel/AMD servers, Apple Silicon Macs, and ARM devices like the Raspberry Pi 4/5. -Two variants are available: +Three variants are available: | Variant | Tag | Size | What's included | |---------|-----|------|-----------------| | Full | `:latest` | ~11 GB | All tools + AI/ML (background removal, upscaling, OCR, face blur, object eraser) | | Lite | `:lite` | ~1.5 GB | All image processing tools, no AI/ML | +| CUDA | `:cuda` | ~14 GB | Full + GPU-accelerated AI (NVIDIA only, amd64) | See [Docker Tags](./docker-tags) for the full comparison, Docker Compose examples, and version pinning. diff --git a/apps/docs/guide/docker-tags.md b/apps/docs/guide/docker-tags.md index c30f9263..6d9489ec 100644 --- a/apps/docs/guide/docker-tags.md +++ b/apps/docs/guide/docker-tags.md @@ -45,18 +45,32 @@ Same tools as the full image, but built with GPU-accelerated Python packages (on Requires [NVIDIA Container Toolkit](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html) on the host. Linux amd64 only. -### What gets faster with GPU +### Benchmarks -| Tool | CPU | GPU (RTX 4070) | Speedup | -|------|-----|----------------|---------| -| Background removal | 2.4s | 0.9s | 2.7x | -| Upscale 2x | 350ms | 310ms | ~1.1x | -| Upscale 4x | 910ms | 310ms | ~3x | -| OCR (PaddleOCR) | 137ms | 94ms | ~1.5x | +Tested on an NVIDIA RTX 4070 (12 GB VRAM) with a 572x1024 JPEG portrait. Both images ran on the same machine. "Warm" means the model is already loaded in memory (second request onward). -Benchmarked with a 572x1024 JPEG portrait. Larger images show bigger speedups, especially for upscaling. +#### Warm performance -Non-AI tools (resize, crop, convert, etc.) are unaffected since they use Sharp (CPU-based). +| Tool | CPU | GPU | Speedup | +|------|-----|-----|---------| +| Background removal (u2net) | 2,415ms | 879ms | 2.7x | +| Background removal (isnet) | 2,457ms | 1,137ms | 2.2x | +| Upscale 2x | 350ms | 309ms | 1.1x | +| Upscale 4x | 910ms | 310ms | 2.9x | +| OCR (PaddleOCR) | 137ms | 94ms | 1.5x | +| Face blur | 139ms | 122ms | 1.1x | + +#### Cold start (first request after container start) + +| Tool | CPU | GPU | Speedup | +|------|-----|-----|---------| +| Background removal | 22,286ms | 4,792ms | 4.7x | +| Upscale 2x | 3,957ms | 2,318ms | 1.7x | +| OCR (PaddleOCR) | 1,469ms | 1,090ms | 1.3x | + +Cold start includes loading the model into memory. GPU cold starts are faster because CUDA parallelizes the model loading. + +Larger images show bigger speedups, especially for upscaling. Non-AI tools (resize, crop, convert, etc.) are unaffected since they use Sharp (CPU-based). ### GPU health check diff --git a/apps/docs/guide/getting-started.md b/apps/docs/guide/getting-started.md index e370a4d1..c484d385 100644 --- a/apps/docs/guide/getting-started.md +++ b/apps/docs/guide/getting-started.md @@ -24,6 +24,16 @@ stirlingimage/stirling-image:lite All 27+ image processing tools work the same. See [Docker Tags](./docker-tags) for the full comparison. ::: +::: tip GPU acceleration +Have an NVIDIA GPU? The CUDA image auto-detects your GPU and accelerates background removal (2.7x), upscaling (3x), and OCR (1.5x): + +```bash +docker run -d --gpus all -p 1349:1349 -v stirling-data:/data stirlingimage/stirling-image:cuda +``` + +Requires [NVIDIA Container Toolkit](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html). Falls back to CPU if no GPU is found. See [Docker Tags](./docker-tags) for details and benchmarks. +::: + ## Run with Docker Compose Create a `docker-compose.yml`: