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.
FieldTypeDefaultDescription
filerequiredfile—Source 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.pngResponse
HTTP/1.1 200 OK
content-type: image/png
x-knockout-latency: 502
x-knockout-model: DDColorErrors
FieldTypeDefaultDescription
400invalid_image—Invalid image, unsupported format, or decode failure.
401unauthorized—Missing or invalid token.
403forbidden—Invalid bearer token.
413payload_too_large—Image exceeds 25 MB.
429rate_limit_exceeded—Slow down. Retry-After header tells you when.
500colorize_failed—colorize 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.