This short guide covers the local operational details that are easy to miss when reading only the user docs.
- Python 3.10+ (enforced in
pyproject.tomland checked bysetup.sh) - Node.js / npm — optional, only needed to rebuild frontend CSS
- OS: Linux, macOS, or Windows
# Full install (CLIP + Florence)
bash setup.sh
# Dev install (adds ruff, pytest, etc.)
bash setup.sh --dev
# CLIP-only install
pip install -r requirements-clip.txtsetup.sh checks the Python version before proceeding and builds frontend CSS automatically when npm is available.
Model assets are downloaded locally and are not intended to be checked into Git.
- default cache:
~/.cache/imgtagplus - repo-local fallback:
.cache/imgtagpluswhen the home cache is not writable
The repository ignores .cache/ so local cache files stay out of source control.
To warm the local cache after setup, run:
python -m imgtagplus -i ./test_image.jpg --model-id clip --silent --output-dir /tmp/imgtagplus-model-warmupFor Florence local development, repeat that command with --model-id florence-2-base.
The web UI server is managed by imgtagplus/cli.py.
Useful commands:
imgtagplus --start-server
imgtagplus --stop-server
imgtagplus --restart-serverBehavior:
- the CLI launches
imgtagplus/server.pyas a detached subprocess - a PID file is stored in the system temp directory and is namespaced by user ID where available
- startup is not reported as successful until
http://127.0.0.1:5000/healthanswers with HTTP 200 - stop logic validates that the stored PID still looks like an ImgTagPlus server before signaling it
Web UI path access is controlled by environment variables:
IMGTAGPLUS_FFSA=1enables full file system accessIMGTAGPLUS_SANDBOX_DIR=/path/to/rootsets the sandbox root when sandboxing is active
Default behavior is sandboxed access rooted at ./sandbox.
Headless CLI runs are local and do not apply this server sandbox layer.
By default, each run writes a log file into the current working directory:
imgtagplus_YYYYMMDD_HHMMSS.log
Notes:
- file logging is always DEBUG level
- console logging is INFO, or WARNING in silent mode
- the browser's live log panel mirrors runtime log records from the same process
/api/logs/downloadreturns the newest matching log file from the current working directory
The local web server runs only one tagging job at a time.
That means:
- no internal job queue
- no multi-user scheduling
- no persistent run history beyond logs and written XMP files
If you need parallelism, launch separate local processes carefully and avoid overlapping writes to the same output locations.
The server enforces per-client-IP rate limits using a 10-second sliding window:
| Endpoint | Limit |
|---|---|
GET /api/browse |
100 requests / 10 s |
POST /api/tag |
10 requests / 10 s |
GET /api/stream |
5 concurrent SSE connections |
Exceeding a limit returns HTTP 429. The limits are in-memory and reset when the server restarts.
Environment variables (e.g. IMGTAGPLUS_FFSA, IMGTAGPLUS_SANDBOX_DIR) can be set in .env files. The .gitignore excludes .env* patterns to prevent accidentally committing secrets or local overrides.
Current contributor guidance in CONTRIBUTING.md points to:
ruff check .
pytestIf tests fail during collection, check that the repository root is on PYTHONPATH or run the suite in the same environment used for normal package development.