# Quickstart

You need a Linux x86_64 server with Docker, 4+ CPU cores (8+ recommended),
8 GB RAM (16 GB recommended) and 5 GB free disk. See [Configuration and sizing](/pro-model-self-host/docs/configuration).

We sent you, separately:

- the registry address (`<registry>`, an Amazon ECR host in `eu-central-1`) and your
  repository `wbg-pro-selfhost/<your id>`
- the current version tag, e.g. `10.12.4-1a2b3c4`
- pull credentials (an access key pair), unless we granted your own AWS account access

## 1. Log in to the registry

With the AWS CLI (v2):

```bash
export AWS_ACCESS_KEY_ID=...        # from us
export AWS_SECRET_ACCESS_KEY=...    # from us
export AWS_DEFAULT_REGION=eu-central-1
REGISTRY=...                        # from us, e.g. 123456789012.dkr.ecr.eu-central-1.amazonaws.com
aws ecr get-login-password | docker login --username AWS --password-stdin "$REGISTRY"
```

The login lasts 12 hours, which is plenty for a pull. If we granted your AWS
account instead, run the same `docker login` line with your own AWS credentials.

## 2. Pull and copy into your own registry (recommended)

```bash
IMAGE="$REGISTRY/wbg-pro-selfhost/<your id>:<version>"
docker pull "$IMAGE"
# Optional, so your servers never depend on our registry:
docker tag "$IMAGE" registry.example.internal/withoutbg-pro-selfhost:<version>
docker push registry.example.internal/withoutbg-pro-selfhost:<version>
```

The image is yours to keep and run (the license is perpetual). Pull access to new
versions lasts for the 12 months of updates in your Order Form.

## 3. Run it

```bash
docker run -d --name withoutbg --restart unless-stopped -p 8000:8000 "$IMAGE"
```

or, with the kit's `docker-compose.yml` (health check and settings included):

```bash
WITHOUTBG_IMAGE="$IMAGE" docker compose up -d
```

The model loads at start (up to a minute). Wait until it is ready:

```bash
curl -s localhost:8000/ready     # {"status":"ready"}  (503 while loading)
```

The image is x86_64 (`linux/amd64`). On an Apple Silicon Mac it runs under emulation
for development (add `--platform linux/amd64`), much slower than on a server.

## 4. Check it

From the kit folder:

```bash
examples/smoke_test.sh                  # or: examples/smoke_test.sh http://<host>:8000
```

It sends the sample photo through every endpoint, including a Smart Brush edit,
and prints `All N checks passed`. If a check fails, see [Troubleshooting](/pro-model-self-host/docs/troubleshooting).

## 5. Remove a background

```bash
curl -s -H 'Content-Type: image/jpeg' --data-binary @photo.jpg \
  localhost:8000/v1/remove-background -o cutout.png
```

`cutout.png` is the photo with a transparent background. For the alpha matte only,
add `?output=matte`. Fixing a cutout with Keep / Remove strokes, JSON requests and
all other options: [API reference](/pro-model-self-host/docs/api). Interactive docs: http://localhost:8000/docs.
Python, Node.js and curl clients: [Examples](/pro-model-self-host/docs/examples). With an AI coding
assistant, give it [AGENTS.md](/pro-model-self-host/docs/ai-assistants) (the server also serves it at `/llms.txt`).

The service listens on plain HTTP and has no authentication: keep it on a private
network or put your own reverse proxy (TLS, auth, body size limit) in front of it.
