HUB
Sign inSign up

psyb0t/imagies

By psyb0t

•Updated about 2 hours ago

Wrangle your damn images. Crop, resize, convert, tile, match with CLIP, detect with YOLO, and gen...

Image
0

1.2K

psyb0t/imagies repository overview

Source⁠

⁠Imagies

CI version license Docker Pulls

Throw your images at it. Crop the awkward bits, resize them, convert formats, or tile a pile into one grid. Need to find what's in the damn picture? Use CLIP for text matching or YOLO for object detection. Stable Diffusion generates new images. It all runs in your Docker container, through REST or MCP on the same port.

⁠Contents

⁠Quick start

docker run --rm --init --cap-drop=ALL \
  --security-opt=no-new-privileges:true --read-only \
  --tmpfs /tmp:rw,noexec,nosuid,size=64m \
  --memory=4g --cpus=2 --pids-limit=256 \
  -p 127.0.0.1:8000:8000 -v imagies:/data psyb0t/imagies:latest

REST docs are at http://localhost:8000/docs, OpenAPI is at /openapi.json, and streamable HTTP MCP is at /v1/mcp. The loopback example uses no token. Set IMAGIES_AUTH_TOKEN before serving other clients. Use the same bearer token for REST and MCP. For MCP through a reverse proxy or another container, add the exact request host, including the port if present, to IMAGIES_MCP_ALLOWED_HOSTS. Separate multiple hosts with commas.

Stage a still image with POST /v1/images and a raw PNG, JPEG or WebP body. The response gives its ID. Pass it to an operation and download results from GET /v1/images/{image_id}. Delete files you no longer need with DELETE /v1/images/{image_id}. All authenticated callers share the staging directory.

REST endpointMCP toolWhat it does
POST /v1/images/transformtransformCrop, fit an image to a canvas, and convert formats.
POST /v1/images/montagemontageTile a list of images into a PNG grid.
POST /v1/images/matchmatchRank text queries for each image by cosine similarity.
POST /v1/images/detectdetectFind objects and return labels, confidence and normalized [x1, y1, x2, y2] boxes.

For video, extract timestamped frames with Flickies⁠ and send the stills to Imagies.

⁠Model files

Imagies loads models on demand. Processing works offline once the models are installed. Models use regular files under /data/models that you can copy to another installation. List available models with GET /v1/engines.

To install the pinned CLIP files into your data volume, run:

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

The installer checks the safetensors checksum before putting the files in place. To install a compatible Hugging Face Transformers CLIP model manually, supply its configuration, tokenizer, image processor and safetensors files in /data/models/clip.

For YOLO, put a YOLOv8 detection ONNX export at /data/models/yolo/model.onnx. Use a float32 input of [1, 3, height, width] and raw output of [1, 4 + class_count, candidates] before non-maximum suppression. Input dimensions must be multiples of 32 from 32 to 1280. Dynamic dimensions default to 640. Add labels.txt with one class label per line in model order. Check the license on your weights.

The standard and NVIDIA vision images get PyTorch from Torchbase. For CLIP on NVIDIA, use psyb0t/imagies:latest-cuda and pass --gpus all. YOLO uses the ONNX Runtime CPU provider.

⁠Image generation

Imagies has CPU and NVIDIA builds with stable-diffusion.cpp. The CPU image supports SD Turbo and SDXL Turbo. The CUDA image also supports SDXL Lightning, FLUX.1 Schnell and Juggernaut XI. Imagies loads one generation model at a time. IDLE_TIMEOUT defaults to 5m and LOAD_TIMEOUT to 10m.

docker run --rm -v imagies:/data psyb0t/imagies:latest \
  python -m imagies.models generation-cpu
docker run --rm --init --cap-drop=ALL --security-opt=no-new-privileges:true \
  --read-only --tmpfs /tmp:rw,noexec,nosuid,size=256m --memory=12g --cpus=4 \
  --pids-limit=512 -p 127.0.0.1:8000:8000 -v imagies:/data \
  psyb0t/imagies:latest

For NVIDIA, use the :latest-cuda image and generation-cuda to install its models. Pass --gpus all to run CLIP matching and image generation on CUDA. Provide HF_TOKEN to the downloader for missing gated FLUX and Juggernaut files after accepting their terms. Installed weights work offline.

The downloader writes regular GGUF and safetensors files to /data/models/generation and checks the hashes of new downloads. To reuse weights from your host, bind mount their directory at /data/models/generation. CPU and CUDA can share the same mount. Only the downloader needs write access to it.

GET /v1/models lists the model IDs. Pass one to POST /v1/images/generations with an OpenAI-compatible request. Discover generation engines at GET /v1/generation/engines and use the engine controls⁠ to load, unload, or cancel work on one engine. The MCP tool generate stages one result as an Imagies image ID.

⁠Agent integrations

Connect a streamable HTTP MCP client to http://localhost:8000/v1/mcp. Editing and vision tools take the matching REST body inside a spec argument. Upload and download files over REST. See the MCP guide⁠ for setup and tool arguments.

Install the OpenClaw bridge and skill from ClawHub. Set IMAGIES_URL to your server's base URL and provide IMAGIES_AUTH_TOKEN if authentication is enabled.

openclaw plugins install clawhub:@psyb0t/imagies
openclaw skills install @psyb0t/imagies

The repository also includes the Imagies skill⁠ for Codex and Claude Code.

⁠Documentation

The Imagies docs⁠ cover Docker images, model installation, REST and MCP. The REST API reference⁠ includes the downloadable OpenAPI document.

⁠Development

Run make check for lint and tests and make docs-build to build the docs. Run make build for CPU or make build-cuda for NVIDIA.

Set CUDA_ARCHITECTURES to target a specific compute capability when building locally. For an RTX A5000, run make build-cuda CUDA_ARCHITECTURES=86.

⁠Sponsor

Sponsor on GitHub⁠

Buy Me a Coffee

⁠License

WTFPL⁠. Bundled components and model weights follow their own licenses.

Tag summary

Content type

Image

Digest

sha256:7c56e1b4b…

Size

359.5 MB

Last updated

about 2 hours ago

docker pull psyb0t/imagies