Colorizes a grayscale or faded Image with the DDColor dual-decoder model loaded offline from a bound weights bundle, emitting a colorized Image while preserving the original luminance.
Typical backends
Colorize images from a file source and stream the result to the browser for review.
Crop a region of interest before colorizing it, then publish the colorized crop over HTTP.
Caveats
- Hard constraintThe DDColor weights are not bundled in the worker; a model bundle (a directory holding a config.json plus a single safetensors or checkpoint weights file, e.g. the piddnad/ddcolor_modelscope snapshot) must be bound to the model file slot. The model is loaded once at startup directly from that bound directory with no network access.
- AccuracyColor is generated rather than recovered, so the model invents plausible hues; the predicted colors are not guaranteed to match the true original colors of the scene.
- I/O contractThe network runs on a fixed square input internally but the predicted color is mapped back onto the source resolution, so the output keeps the input's dimensions and only the chrominance is changed. A colour input is returned in its original color space; a single-channel grayscale input is returned as a 3-channel color image, since the predicted color cannot be carried by a grayscale frame.
- FallbackAn empty image is passed through unchanged, and requesting a GPU with none present falls back to CPU where per-image latency rises sharply.
- State lifetimeThe bound weights and the input size are resolved once at startup, so switching models or resolution requires a redeploy.