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
- Everything is checked before anything is uploaded: missing files, unsupported formats, two inputs that would write the same output, and existing outputs. Any problem stops the run before it starts.
- Results are written to a temporary file, checked against the server's SHA-256 and then renamed into place. A failure never leaves a partial file or damages an existing one, and your originals are never changed.
- Photos the server already has are not uploaded again. Failed requests are retried, and downloads resume after a dropped connection.
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 status | Checks 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|show | Server address (endpoint), token and CA file. |
painite mcp | Runs an MCP server so AI agents such as Claude Code can use PAINITE. See AI agents. |
painite version | Prints the version and a link to this guide. |
painite <command> -h | All 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.