Command line

Using the painite command

Enhance one photo or a whole batch from the terminal on macOS or Linux. Same server, same models and same results as the Mac app.

First, install it and connect it to your server. See Install the command line tool.

Enhance photos

painite enhance --op denoise -o clean.jpg noisy.jpg

--op picks the enhancement: denoise, sharpen, unblur_motion, unblur_focus, face or upscale2x. -o is the output file or folder. See Enhancements for what each one does.

Strength

painite enhance --op denoise --strength 0.7 -o clean.jpg noisy.jpg

Strength goes from 0 (no change) to 1 (full effect). Defaults: 0.5 for denoise, sharpen and face, 1.0 for unblur. Upscale has no strength.

Several steps in one pass

painite enhance --op denoise:0.6,sharpen:0.3,upscale2x -o out/ IMG_0412.tif

A comma-separated list runs the steps in order in one server job, with one upload and one download. op:strength sets a step's strength. Use up to four steps, with at most one upscale2x.

Batches

painite enhance --op face -o restored/ scans/*.jpg
painite enhance --op denoise --jobs 8 -o out/ ~/Pictures/Night/*.tif

With several photos, or when -o is a folder (or ends in /), each result keeps its file name inside that folder. Four photos are processed at once by default; change it with --jobs.

Output format

painite enhance --op upscale2x --format tiff -o big/ small.jpg

Results keep the input's format unless you pass --format jpeg or --format tiff. Existing files are not replaced unless you add --overwrite.

Safe by design

Scripting

--json prints one result per input on stdout, in argument order, with input, output, status (succeeded, failed, invalid, not_run), any error.code, and timings. Progress goes to stderr.

Exit codes: 0 all succeeded, 1 at least one photo failed (successful results are kept), 2 the command was invalid and nothing was submitted.

Other commands

painite statusChecks the server and lists its operations and models. Add --json for scripts.
painite trust --fingerprint SHA256:…Trusts your server's private certificate after checking its fingerprint.
painite config set|get|showServer address (endpoint), token and CA file.
painite mcpRuns an MCP server so AI agents such as Claude Code can use PAINITE. See AI agents.
painite versionPrints the version and a link to this guide.
painite <command> -hAll flags for a command.

Settings

Settings are stored in ~/.config/painite/config.json on Linux and ~/Library/Application Support/painite/config.json on macOS, shared with the Mac app. PAINITE_ENDPOINT, PAINITE_TOKEN and PAINITE_CA_FILE override the file, and --endpoint, --token and --ca-file override both. PAINITE_CONFIG points to a different settings file.