Calligrapher: Freestyle Text Image Customization

Yue Ma, Qingyan Bai, Hao Ouyang, Ka Leong Cheng, Qiuyu Wang, Hongyu Liu, Zichen Liu, Haofan Wang, Jingye Chen, Yujun Shen, Qifeng ChenarXiv 2025 · DOI

Abstract

Calligrapher is a novel diffusion-based framework designed for high-fidelity, stylized text customization. By integrating a self-distilled typography dataset with a localized style injection mechanism, it enables users to edit text within images or transfer complex artistic styles from arbitrary references—including non-text sources like fire or rainbows. Calligrapher maintains precise glyph positioning and background consistency, significantly outperforming existing state-of-the-art models in both quantitative metrics and user preference.

Introduction

Typography is essential for branding and advertising, yet generating high-quality, stylized text remains a significant challenge. Designers often face a trade-off between standard font libraries, which lack depth and integration, and generative AI models, which frequently struggle with precise artistic nuances and accurate spelling. Calligrapher addresses these challenges of data scarcity and fine-grained style control.

Calligrapher enables realistic integration of stylized text into complex backgrounds, overcoming the limitations of previous generative models.

Technical Methodology

Built upon the FLUX diffusion model architecture, Calligrapher introduces three primary innovations:

  1. Self-Distillation Pipeline: To overcome the lack of paired stylized text datasets, the authors utilized a Large Language Model (LLM) to generate typographic prompts. A pre-trained text-to-image model then synthesized stylized text images, which were automatically cropped and paired to create a massive, self-supervised training set.
  2. Localized Style Injection: A trainable Style Encoder extracts robust features from reference images and injects them directly into the denoising transformer's attention blocks. This allows for granular control over both glyph shapes and textures.
  3. In-Context Generation: By spatially concatenating the reference style image with the target image at the pixel level before latent encoding, the model maintains holistic style coherence and structural fidelity.

Datasets and Evaluation

The authors introduced a Style-Centric Typography Benchmark created via their self-distillation pipeline, featuring stylized text images paired with prompts, masks, and bounding boxes. For evaluation, a test set of 100 diverse text images was used to compare Calligrapher against baselines such as TextDiffuser-2 and AnyText.

Key Insights

  • Self-Training Efficacy: The research demonstrates that general-purpose models can effectively "teach" specialized versions of themselves through synthesized data, bypassing expensive human annotation.
  • Style as Local Context: Treating the reference image as spatial context allows the model to learn style as a local property of the text rather than a global filter.
  • Cross-Domain Versatility: Calligrapher can transfer styles from non-text images, such as lightning or flowers, rendering text as if it were composed of those elements.

Experimental Results

Calligrapher demonstrates significant superiority across multiple metrics:

  • Quantitative Performance: On the typography benchmark, Calligrapher achieved an FID of 38.09, nearly doubling the performance of baselines like FLUX-Fill (67.79) and AnyText (69.72). It also led in OCR Accuracy (0.84) and style similarity scores.
  • Qualitative Excellence: The model handles both "self-reference" (in-place editing) and "cross-reference" (style transfer) with high precision, preserving background details that other models often distort.
Qualitative results demonstrating Calligrapher's ability to handle self-reference and cross-reference settings with high fidelity.

Conclusion and Future Work

Calligrapher represents a major advancement in text image customization. While the model is computationally intensive and currently focused on word-level customization, future work will explore more complex multi-line layouts and cross-architecture generalization.

Summary updated

BibTeX
@misc{ma2025calligrapher,
  author = {Yue Ma and Qingyan Bai and Hao Ouyang and Ka Leong Cheng and Qiuyu Wang and Hongyu Liu and Zichen Liu and Haofan Wang and Jingye Chen and Yujun Shen and Qifeng Chen},
  title = {{Calligrapher: Freestyle Text Image Customization}},
  year = {2025},
  eprint = {2506.24123},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2506.24123},
}
Figure