API reference/POST /colorize

Colorize B&W photos

DDColor colorization. Adds plausible color to black-and-white or grayscale photos. ConvNeXt-Large backbone predicting ab channels in LAB color space — single feed-forward inference, no diffusion sampling. Color inputs are accepted too (treated as grayscale internally).

POSThttps://useknockout--api.modal.run/colorize

Parameters

Send as multipart/form-data unless noted otherwise.

filerequiredfileSource image (B&W, grayscale, or color). JPEG, PNG, WebP. Up to 25 MB.
formatstringpngOutput format — png, webp, or jpg.

Request

curl -X POST "https://useknockout--api.modal.run/colorize" \
  -H "Authorization: Bearer $TOKEN" \
  -F "file=@old-photo.jpg" \
  -F "format=png" \
  -o colorized.png

Response

HTTP/1.1 200 OK
content-type: image/png
x-knockout-latency: 502
x-knockout-model: DDColor

Errors

400invalid_imageInvalid image, unsupported format, or decode failure.
401unauthorizedMissing or invalid token.
403forbiddenInvalid bearer token.
413payload_too_largeImage exceeds 25 MB.
429rate_limit_exceededSlow down. Retry-After header tells you when.
500colorize_failedcolorize failed or produced no output.
Every error response also includes a request_id in the JSON body. Quote it when reporting issues.

Notes

  • Apache-2.0 licensed model (DDColor with ConvNeXt-Large backbone).
  • ~500ms warm on an L4 GPU, ~25s cold start (weights ~870 MB, pre-baked into the image).
  • Use cases: family archives, historical photos, B&W scans, vintage stock imagery.
  • Color inputs are accepted — the image is converted to grayscale internally before colorization.