TL;DR
GlyphPrinter is a novel preference-based text rendering framework that drastically improves the accuracy of text generated within images. By introducing a region-level human preference dataset (GlyphCorrector) and a Region-Grouped Direct Preference Optimization (R-GDPO) objective, it eliminates the reliance on flawed automated text-recognition reward models and corrects localized stroke errors without sacrificing overall image quality.
What Problem Does This Paper Address?
While text-to-image (T2I) diffusion models have made massive leaps in visual quality, rendering accurate text—especially complex Chinese characters, rare scripts, or emojis—remains a notorious challenge.
To fix typos and missing strokes, previous approaches turned to Reinforcement Learning (RL) paired with automated reward models like OCR systems or Multimodal LLMs. However, the authors point out a fundamental flaw: text recognition models are too robust. They are designed to read distorted or imperfect text, meaning they often give identical, high rewards to images containing subtle glyph errors (see Figure 2).
An alternative is Direct Preference Optimization (DPO), which bypasses explicit reward models by learning directly from human preferences. But standard DPO operates at the whole-image level. If an image gets two out of three words right, standard DPO simply marks the whole image as "preferred," failing to teach the model how to fix the single broken word.
Methods
GlyphPrinter solves this by shifting preference optimization from the image level to the region level via a two-stage pipeline:
- Stage 1: Fine-Tuning with Text Localization: The authors first fine-tune a state-of-the-art T2I model (Flux.1-Dev) on text images. They implement a specialized attention mask that forces explicit communication between specific bounding boxes in the image feature space and their corresponding textual glyph features (see Figure 3a).
- Stage 2: Region-Grouped DPO (R-GDPO): Instead of comparing entire images, R-GDPO focuses strictly on localized text regions using human-annotated masks. It optimizes two types of preference pairs simultaneously (see Figure 3b):
- Inter-sample preferences: Comparing the exact same text region across different generated images to see which one rendered the characters better.
- Intra-sample preferences: Comparing correct text regions against incorrect text regions within the same image, allowing the model to learn localized correctness highly efficiently.
Additionally, the authors introduce Regional Reward Guidance (RRG) during inference. RRG applies the preference model's guidance exclusively to the text regions, ensuring background details remain pristine while text accuracy is maximized.
Datasets
The authors introduced several new resources to train and evaluate their method:
- GlyphCorrector: A newly collected region-level preference dataset containing 7,117 images across 897 unique glyph conditions. Human annotators explicitly boxed correct and incorrect text regions to define the fine-grained preference pairs.
- GlyphAcc-Multilingual & GlyphAcc-Complex: Two new evaluation benchmarks designed to rigorously test text rendering across multiple languages (English, Chinese, Japanese, Korean, French, Vietnamese, Thai) and highly complex character structures.
Key Insights and Ideas
- OCR Models Make Bad Critics: Because text recognizers are built to tolerate noise, they suffer from "reward hacking" when used as RL reward functions for image generation. Human preference data is essential for fine-grained visual accuracy.
- An Image Can Be Its Own Counterfactual: By utilizing intra-sample preferences (comparing a good word and a bad word in the same generated image), the model learns a tighter representation of glyph correctness without being distracted by changes in background style.
- Localized Guidance Preserves Aesthetics: Applying classifier-free style guidance globally often degrades background aesthetics. Restricting preference guidance to text bounding boxes via RRG decouples text accuracy from background quality.
Key Results
GlyphPrinter was evaluated against leading prompt-guided models (Qwen-Image, Glyph-ByT5-v2) and glyph-guided models (AnyText2, EasyText).
Quantitative Performance
Using Normalized Edit Distance (NED) and Sentence Accuracy (Sen.Acc), GlyphPrinter consistently outperformed all baselines:
- On the GlyphAcc-Complex benchmark (testing intricate Chinese characters), GlyphPrinter achieved a Sentence Accuracy of 0.8349, vastly outperforming EasyText (0.6604) and Qwen-Image (0.3679).
- In a user study evaluating glyph accuracy on a scale of 1–10, GlyphPrinter scored 8.31, beating the closest competitor (Qwen-Image at 7.97) while maintaining highly competitive image aesthetics.
Qualitative Performance
As shown in Figures 4 and 5, GlyphPrinter successfully renders complex strokes that cause other models to collapse into illegible blurs, and it generalizes exceptionally well to unseen stylized fonts and emojis.
Limitations and Future Work
- Very Small Text: The model's accuracy degrades when rendering very small characters, a limitation inherited from the spatial compression limits of the underlying VAE.
- Fixed Resolution: GlyphPrinter was trained on fixed-resolution images, restricting its ability to flexibly output diverse aspect ratios. The authors target multi-resolution training as a key direction for future work.
Summary updated