Update README.md
Browse files
README.md
CHANGED
|
@@ -18,6 +18,9 @@ license: cc-by-nc-sa-4.0
|
|
| 18 |
|
| 19 |
(April. 2025)
|
| 20 |
Official implementation of Colorize Diffusion.
|
|
|
|
|
|
|
|
|
|
| 21 |
Fundamental issue for this repository: [ColorizeDiffusion (e-print)](https://arxiv.org/abs/2401.01456).
|
| 22 |
***Version 1*** - Base training, 512px. Released, ckpt starts with **mult**.
|
| 23 |
***Version 1.5*** - Solving spatial entanglement, 512px. Released, ckpt starts with **switch**.
|
|
@@ -101,6 +104,52 @@ As you can see, the manipluation unavoidably changed some unrelated regions as i
|
|
| 101 |
| \>Threshold3 | Select most unrelated regions. Indicated by brown. |
|
| 102 |
|Add| Click add to save current manipulation in the sequence. |
|
| 103 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 104 |
## Code reference
|
| 105 |
1. [Stable Diffusion v2](https://github.com/Stability-AI/stablediffusion)
|
| 106 |
2. [Stable Diffusion XL](https://github.com/Stability-AI/generative-models)
|
|
|
|
| 18 |
|
| 19 |
(April. 2025)
|
| 20 |
Official implementation of Colorize Diffusion.
|
| 21 |
+
|
| 22 |
+
Colorize Diffusion is a SD-based colorization framework that can achieve high-quality colorization results with arbitrary input pairs.
|
| 23 |
+
|
| 24 |
Fundamental issue for this repository: [ColorizeDiffusion (e-print)](https://arxiv.org/abs/2401.01456).
|
| 25 |
***Version 1*** - Base training, 512px. Released, ckpt starts with **mult**.
|
| 26 |
***Version 1.5*** - Solving spatial entanglement, 512px. Released, ckpt starts with **switch**.
|
|
|
|
| 104 |
| \>Threshold3 | Select most unrelated regions. Indicated by brown. |
|
| 105 |
|Add| Click add to save current manipulation in the sequence. |
|
| 106 |
|
| 107 |
+
|
| 108 |
+
## Training
|
| 109 |
+
Our implementation is based on Accelerate and Deepspeed.
|
| 110 |
+
Before starting a training, first collect data and organize your training dataset as follows:
|
| 111 |
+
|
| 112 |
+
```
|
| 113 |
+
[dataset_path]
|
| 114 |
+
βββ image_list.json # Optionally for image indexing
|
| 115 |
+
βββ color/ # Color images
|
| 116 |
+
β βββ 0001.zip
|
| 117 |
+
| | βββ 10001.png
|
| 118 |
+
| | βββ 100001.jpg
|
| 119 |
+
β | βββ ...
|
| 120 |
+
β βββ 0002.zip
|
| 121 |
+
β βββ ...
|
| 122 |
+
βββ sketch # Sketch images
|
| 123 |
+
β βββ 0001.zip
|
| 124 |
+
| | βββ 10001.png
|
| 125 |
+
| | βββ 100001.jpg
|
| 126 |
+
β | βββ ...
|
| 127 |
+
β βββ 0002.zip
|
| 128 |
+
β βββ ...
|
| 129 |
+
βββ mask # Mask images (required for fg-bg training)
|
| 130 |
+
βββ 0001.zip
|
| 131 |
+
| βββ 10001.png
|
| 132 |
+
| βββ 100001.jpg
|
| 133 |
+
| βββ ...
|
| 134 |
+
βββ 0002.zip
|
| 135 |
+
βββ ...
|
| 136 |
+
```
|
| 137 |
+
For details of dataset organization, check `data/dataloader.py`.
|
| 138 |
+
Training command example:
|
| 139 |
+
```
|
| 140 |
+
accelerate launch --config_file [accelerate_config_file] \
|
| 141 |
+
train.py \
|
| 142 |
+
--name base \
|
| 143 |
+
--dataroot [dataset_path] \
|
| 144 |
+
--batch_size 64 \
|
| 145 |
+
--num_threads 8 \
|
| 146 |
+
-cfg configs/train/sd2.1/mult.yaml \
|
| 147 |
+
-pt [pretrained_model_path]
|
| 148 |
+
```
|
| 149 |
+
Refer to `options.py` for training/inference/validation arguments.
|
| 150 |
+
Note that the `batch size` here is micro batch size per gpu. If you run the command on 8 gpus, the total batch size is 512.
|
| 151 |
+
|
| 152 |
+
|
| 153 |
## Code reference
|
| 154 |
1. [Stable Diffusion v2](https://github.com/Stability-AI/stablediffusion)
|
| 155 |
2. [Stable Diffusion XL](https://github.com/Stability-AI/generative-models)
|