Skip to main content

Deployment

Both images target Linux x86-64 and include editing, vision and image generation. An NVIDIA build needs a compatible GPU and the NVIDIA Container Toolkit.

Image tagBuild commandWhat it runs
latestmake buildCPU CLIP, YOLO and Stable Diffusion
latest-cudamake build-cudaCUDA CLIP and Stable Diffusion, CPU YOLO
docker run --rm --init \
-p 127.0.0.1:8000:8000 \
-v imagies:/data \
psyb0t/imagies:latest

Pass --gpus all to a CUDA image. When upgrading from latest-generation or latest-generation-cuda, switch to latest or latest-cuda respectively and keep your existing storage.

Storage mounts​

Mount a named volume or a host directory at /data. Imagies saves staged images under /data/images and looks for model files under /data/models. Image staging and downloads need write access for container UID and GID 10001.

To reuse an existing directory of generation weights, add this mount alongside the /data volume. Change the source to your host directory.

--mount "type=bind,source=$PWD/weights,target=/data/models/generation,readonly"

Use the same mount without readonly when running the model downloader.

Model files​

docker run --rm -v imagies:/data psyb0t/imagies:latest \
python -m imagies.models clip

docker run --rm -v imagies:/data psyb0t/imagies:latest \
python -m imagies.models generation-cpu

Use generation-cuda with the CUDA image to install its larger catalog. Gated models require accepting their terms and setting HF_TOKEN.

Set IMAGIES_MODEL_DOWNLOAD=startup to fetch missing CLIP and generation weights before the API starts. Startup skips missing gated models when HF_TOKEN is unset. Set it to on-demand to fetch CLIP on the first match request or fetch the selected generation model when a request first needs it. Both values use the files already on disk. Keep the variable unset to use the existing installation commands.

For YOLOv8 detection, mount your ONNX export at /data/models/yolo/model.onnx and put one class per line in labels.txt. The float32 input is NCHW and the output is the raw pre-NMS detection tensor.

Configuration​

Environment variableBehavior
IMAGIES_AUTH_TOKENOptional shared bearer token. Set it before serving clients beyond loopback.
IMAGIES_MCP_ALLOWED_HOSTSComma-separated allowed MCP Host values. Include the port when the client sends one.
IMAGIES_GENERATIONDefaults to 1. Set it to 0 to skip the worker and generation endpoints.
IMAGIES_MODEL_DOWNLOADUnset by default. Use startup or on-demand to fetch missing weights automatically.
IDLE_TIMEOUTGeneration model idle timeout, default 5m.
LOAD_TIMEOUTGeneration model load timeout, default 10m.
HF_TOKENOptional downloader token for gated weights.

Keep the data volume attached when you replace the container. All authenticated callers share the staged images. The service exposes health on /healthz without a token.