Towards High-resolution and Disentangled Reference-based Sketch Colorization

Dingkun Yan, Xinrui Wang, Ru Wang, Zhuoru Li, Jinze Yu, Yusuke Iwasawa, Yutaka Matsuo, Jiaxian GuoarXiv 2026

TL;DR

Automated sketch colorization often suffers from "spatial entanglement," where the geometric structure of a reference image erroneously bleeds into the target sketch. This paper introduces a dual-branch framework utilizing a novel Gram Regularization Loss to explicitly decouple style from structure, achieving state-of-the-art, high-resolution anime colorization with precise attribute control.

What Problem Does This Paper Address?

In reference-based sketch colorization, an artist provides a line-art sketch and a colored reference image to guide the AI's color choices. The core challenge is a systemic distribution shift between training and inference. During training, models use semantically aligned triplets: the sketch and the reference image are both derived from the exact same ground-truth image. At inference, however, users provide arbitrary, mismatched sketches and references.

Because of this training shortcut, the model learns a spurious correlation: it assumes the reference image predicts the output's spatial structure. This leads to Spatial Entanglement—severe visual artifacts during inference such as bleeding colors, distorted body parts, and random objects from the reference image spawning in the background of the sketch.

The difference between entangled current colorization behavior and the desired independent behavior.

Methods

The authors propose a framework built on Stable Diffusion XL (SDXL), initialized with weights from AnimagineXL, incorporating three core components:

  1. Dual-Branch Feature Alignment (DBFA): To simulate the distribution shift during training, the architecture splits into two weight-sharing branches:
  2. Semantic-Aligned Branch: Processes the standard training pair (sketch + true reference).
  3. Semantic-Misaligned Branch: Processes the same sketch but paired with a randomly sampled reference image, mimicking real-world inference.
  4. Gram Regularization Loss: To force the misaligned branch to ignore the reference image's geometry, the authors apply a Gram matrix loss on the internal feature maps of both branches. This "self-anchoring" mechanism penalizes structural deviations, ensuring that spatial layouts are derived exclusively from the sketch.
  5. Precise Attribute Control via WD-Tagger: Instead of relying solely on generic CLIP text/image encoders—which often suffer from redundant semantic overlap—the authors integrate an anime-specific multi-label classification network (WD-Tagger). This provides fine-grained, tag-aligned embeddings for distinct attributes like hair color, clothing type, and eye color.
  6. Feature-level Plugin Module: A separate encoder trained in a refinement stage to capture low-level textures and maintain global style consistency, particularly in complex background regions.
The overall architecture of the proposed framework and the computation of the Gram loss.

Datasets

  • Training: A large-scale dataset consisting of 6 million high-resolution illustrations of anime characters and sceneries. Input sketches were synthetically generated by applying a mix of four edge and line extraction algorithms.
  • Evaluation: A validation split of 50,000 triplets (sketch, reference, ground truth) was used for quantitative benchmarking.

Key Insights and Ideas

  • The Self-Anchoring Mechanism: Unlike prior methods that require frozen historical checkpoints or external networks (like VGG) to calculate regularization losses, this approach uses two parallel branches within the same training step. By detaching the gradients (stop_grad) of the aligned branch, it acts as a stable structural anchor.
  • Gram Matrices for Structure Preservation: Gram matrices are traditionally used in style transfer to capture style. Here, the authors flip the intuition: by forcing the Gram matrices of the aligned and misaligned branches to match, they ensure the spatial segmentation and internal feature correlations remain invariant to changes in the reference image.
  • Domain-Specific Encoders Matter: Generic vision-language models like CLIP struggle with the nuances of illustration styles. Replacing CLIP-L with an anime-specific tagger grounds the latent space in concrete descriptive attributes, significantly boosting color fidelity (e.g., matching exact eye colors).

Key Results

The proposed method was evaluated against several state-of-the-art baselines, including ColorizeDiffusion, IP-Adapter-XL, and MangaNinja, at $1024 \times 1024$ resolution.

Quantitative Performance

  • Fréchet Inception Distance (FID): The model achieved an FID of 8.28, significantly outperforming the closest high-resolution baseline (Yan et al. at 12.09).
  • Structural Similarity (MS-SSIM): Achieved the highest score of 0.70, proving superior geometry preservation.
  • PSNR Exception: MangaNinja scored higher in PSNR (29.64 vs 28.83). The authors note this is because MangaNinja is limited to $512 \times 512$ resolution and outputs flat, average backgrounds, which mathematically favors pixel-level metrics like PSNR despite lower visual texture quality.

Qualitative & User Studies

In a user study with 30 participants across 25 image sets, the proposed method was consistently preferred over all baselines, achieving preference rates ranging from 62.5% to 79.6% against competing models. It successfully handled "cross-content" validation, such as colorizing a character sketch using the color palette of a starry night scenery reference without blending the stars into the character's face.

Limitations and Future Work

Not discussed in the main text of the paper (relegated to the supplementary material).

Summary updated

BibTeX
@misc{yan2026towards,
  author = {Dingkun Yan and Xinrui Wang and Ru Wang and Zhuoru Li and Jinze Yu and Yusuke Iwasawa and Yutaka Matsuo and Jiaxian Guo},
  title = {{Towards High-resolution and Disentangled Reference-based Sketch Colorization}},
  year = {2026},
  eprint = {2603.05971},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2603.05971},
}
Figure