Instructions to use mlx-community/DDColor-modelscope-fp16 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use mlx-community/DDColor-modelscope-fp16 with MLX:
# Download the model from the Hub pip install huggingface_hub[hf_xet] huggingface-cli download --local-dir DDColor-modelscope-fp16 mlx-community/DDColor-modelscope-fp16
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
Upload README.md with huggingface_hub
Browse files
README.md
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
library_name: mlx
|
| 3 |
+
license: apache-2.0
|
| 4 |
+
license_link: https://github.com/piddnad/DDColor/blob/main/LICENSE
|
| 5 |
+
base_model: piddnad/DDColor-models
|
| 6 |
+
pipeline_tag: image-to-image
|
| 7 |
+
tags:
|
| 8 |
+
- mlx
|
| 9 |
+
- colorization
|
| 10 |
+
- image-colorization
|
| 11 |
+
- ddcolor
|
| 12 |
+
---
|
| 13 |
+
|
| 14 |
+
# mlx-community/DDColor-modelscope-fp16
|
| 15 |
+
|
| 16 |
+
[DDColor](https://github.com/piddnad/DDColor) automatic image colorization (ConvNeXt-L backbone,
|
| 17 |
+
`ddcolor_modelscope.pth`), converted to **Apple MLX** (`-fp16`) for Apple-Silicon inference via the
|
| 18 |
+
[`mlx-ddcolor-swift`](https://github.com/xocialize/mlx-ddcolor-swift) Swift package.
|
| 19 |
+
|
| 20 |
+
Best general tier. The recommended default — strongest on archival / multi-object scenes.
|
| 21 |
+
|
| 22 |
+
A from-scratch MLX-Swift architecture port (no MLX donor) of DDColor: ConvNeXt encoder → quasi-UNet
|
| 23 |
+
decoder → DETR-style multi-scale color decoder (100 color queries) → predicts the **ab** chroma
|
| 24 |
+
channels, recombined with the source **L** (luminance). Grayscale / desaturated image in → colorized
|
| 25 |
+
image at the same resolution out.
|
| 26 |
+
|
| 27 |
+
## Use with mlx-ddcolor-swift (Swift / MLX)
|
| 28 |
+
|
| 29 |
+
```swift
|
| 30 |
+
// Package.swift → .package(url: "https://github.com/xocialize/mlx-ddcolor-swift", from: "0.1.0")
|
| 31 |
+
import DDColor
|
| 32 |
+
|
| 33 |
+
let colorizer = try DDColorColorizer.fromPretrained(
|
| 34 |
+
weightsPath, // model.safetensors from this repo
|
| 35 |
+
config: DDColorConfig(tier: .large), // .tiny for paper-tiny
|
| 36 |
+
dtype: .float16)
|
| 37 |
+
let colorized: CGImage = colorizer(sourceCGImage) // grayscale → color, source resolution
|
| 38 |
+
```
|
| 39 |
+
|
| 40 |
+
Or as an MLXEngine `imageColorize` ModelPackage (`MLXDDColor.DDColorPackage`), which resolves this repo
|
| 41 |
+
automatically via the Hub.
|
| 42 |
+
|
| 43 |
+
## Parity
|
| 44 |
+
|
| 45 |
+
Architecture parity-locked against the PyTorch oracle (piddnad/DDColor) on the CPU stream, fp32:
|
| 46 |
+
**max_abs ≤ 1.5e-6** (large) / **3.3e-6** (tiny) on the model's ab output. The cv2-exact LAB pre/post
|
| 47 |
+
pipeline matches the reference `ColorizationPipeline` to **~9e-4 mean** BGR error. This `-fp16` build is
|
| 48 |
+
visually identical to fp32 (**cosine 1.000000**, mean 0.04/255 on colorized output).
|
| 49 |
+
|
| 50 |
+
Weights: Apache-2.0 (piddnad/DDColor). Port code: MIT.
|