Code release for "Recolour What Matters: Region-Aware Colour Editing via Token-Level Diffusion"
- [2026/07/03] 🚀 We release the inference and training code.
- [2026/06/18] 🎉 Ours paper is accepted to ECCV 2026.
Editing results of ColourCrafter under varying reference colours. Each row shows the input image and its edited outputs conditioned on different RGB references. As the reference colours vary smoothly from left to right, ColourCrafter produces continuous and precise recolouring with consistent structure and texture.
Overview of the ColourCrafter pipeline. (1) Dataset construction: Using Flux.1-Kontext, we generate diverse image-colour pairs and employ a Vision-Language Model (VLM) to filter samples for consistency, fidelity, and realism. The corresponding RGB references are extracted to build the high-quality dataset ColourfulSet. (2) Training: The original image, target colour reference, and text prompt are jointly fed into the diffusion model, which is optimised with both Diffusion and Lab-space losses to enhance chromatic accuracy and perceptual consistency. (3) Inference: Given an input image, a RGB reference, and a prompt, ColourCrafter performs fine-grained, structure-preserving, and perceptually natural colour editing.
git clone https://github.com/YangYuqi317/ColourCrafter.git
cd ColourCrafterWe recommend creating a new conda environment.
conda create -n ColourCrafter python=3.10
conda activate ColourCrafterInstall the required dependencies:
pip install torch==2.5.1 torchvision==0.20.1
pip install diffusers==0.36.0Download the pretrained checkpoints from Hugging Face:
python test_kontext.py bash train.sh @article{yang2026recolourmatters,
title={Recolour What Matters: Region-Aware Colour Editing via Token-Level Diffusion},
author={Yuqi Yang and Dongliang Chang and Yijia Ling and Ruoyi Du and Zhanyu Ma},
journal={arXiv preprint arXiv:2603.18466}
year={2026},
url={https://arxiv.org/abs/2603.18466},
}
