GlyphPrinter: Region-Grouped Direct Preference Optimization for Glyph-Accurate Visual Text Rendering
Authors: Xincheng Shuai, Ziye Li, Henghui Ding, Dacheng Tao
Organizations: Institute of Big Data, College of Computer Science and Artificial Intelligence, Fudan University, China · Generative AI Lab, College of Computing and Data Science, Nanyang Technological University, Singapore
Generating accurate glyphs for visual text rendering is essential yet challenging. Existing methods typically enhance text rendering by training on a large amount of high-quality scene text images, but the limited coverage of glyph variations and excessive stylization often compromise glyph accuracy, especially for complex or out-of-domain characters. Some methods leverage reinforcement learning to alleviate this issue, yet their reward models usually depend on text recognition systems that are insensitive to fine-grained glyph errors, so images with incorrect glyphs may still receive high rewards. Inspired by Direct Preference Optimization (DPO), we propose GlyphPrinter, a preference-based text rendering method that eliminates reliance on explicit reward models. However, the standard DPO objective only models overall preference between two samples, which is insufficient for visual text rendering where glyph errors typically occur in localized regions. To address this issue, we construct the GlyphCorrector dataset with region-level glyph preference annotations and propose Region-Grouped DPO (R-GDPO), a region-based objective that optimizes inter- and intra-sample preferences over annotated regions, substantially enhancing glyph accuracy. Furthermore, we introduce Regional Reward Guidance, an inference strategy that samples from an optimal distribution with controllable glyph accuracy. Extensive experiments demonstrate that the proposed GlyphPrinter outperforms existing methods in glyph accuracy while maintaining a favorable balance between stylization and precision.
Figures & tables
Figure 2: Text recognition models [ 11 , 50 ] used in existing RL-based methods are insensitive to incorrect glyphs (highlighted with green boxes), leading to inflated rewards for such samples.
Figure 3: (a) Construction of the attention mask used in GlyphPrinter . In addition to the prompt-image and intra-modality attentions, we only enable the communication between the image features from the text region and the corresponding glyph feature for each text block. (b) Construction of the preference masks used in R-GDPO . Our GlyphCorrector contains region-level preference annotations for samples from each generated group, where the incorrect text regions are highlighted with green boxes. To make more efficient use of data, we simultaneously use inter-sample ( Mi,j+,− ) and intra-sample preference masks ( Mi+,Mi− ) to construct winning-losing pairs.
Figure 4: Text rendering results under simple and complex glyph conditions. Our GlyphPrinter outperforms other methods in preserving fine details of glyphs, particularly for some complex cases in the 2nd and 3rd rows. Best viewed zoomed in to see the fine glyph details.
Figure 5: Text rendering results under multilingual and out-of-domain glyph conditions. Our method GlyphPrinter consistently preserves glyph fidelity, indicating strong generalization ability. Please zoom in for better visibility of fine text details.
Method
GlyphPrinter (Ours)
AnyText2 [ 46 ]
EasyText [ 33 ]
Glyph-Byt5-v2 [ 32 ]
X-Omni [ 17 ]
Qwen-Image [ 53 ]
NED
Sen.Acc
NED
Sen.Acc
NED
Sen.Acc
NED
Sen.Acc
NED
Sen.Acc
NED
Sen.Acc
English
0.9851
0.9320
0.8162
0.5291
0.9780
0.9174
0.9844
0.9223
0.7963
0.5146
0.9193
0.8689
Chinese
0.9728
0.9339
0.9004
0.7899
0.9569
0.9144
0.9295
0.8093
0.7318
0.4397
0.9149
0.9183
Japanese
0.9616
0.9167
0.8543
0.6111
0.9389
0.8888
0.9038
0.8056
0.5148
0.2222
0.7324
0.5278
Korean
0.9693
0.9362
0.7222
0.4894
0.8544
0.7660
0.9648
0.8511
0.0670
0.0213
0.5167
0.2128
French
0.9714
0.8427
0.7321
0.3270
0.9671
0.8553
0.9740
0.8742
0.6939
0.2390
0.7470
0.5220
Table 1: Evaluation of text rendering accuracy. The rows from “English” to “Thai’ indicate the results of GlyphAcc-Multilingual, while the “Complex” row shows the result of GlyphAcc-Complex. Bold indicates the best result, and underline denotes the second best.
Method
Aes
Text.Align
Glyph.Acc
GlyphPrinter ( Ours )
7.9143
8.1692
8.3084
GlyphPrinter-Stage 1
7.9507
8.0899
7.5332
Anytext2 [ 46 ]
5.5310
6.3298
5.3769
EasyText [ 33 ]
7.0964
7.6767
7.4411
Glyph-Byt5-v2 [ 32 ]
3.4454
3.7173
6.3919
X-Omni [ 17 ]
6.6660
7.1328
5.8972
Table 2: The user study assesses image aesthetic ( Aes ), text-image alignment ( Text.Align ), and glyph accuracy ( Glyph.Acc ). All scores are within the range of 1 to 10.
Method
GlyphPrinter (Ours)
AnyText2 [ 46 ]
EasyText [ 33 ]
Glyph-Byt5-v2 [ 32 ]
X-Omni [ 17 ]
Qwen-Image [ 53 ]
Text.Align
Aes
Text.Align
Aes
Text.Align
Aes
Text.Align
Aes
Text.Align
Aes
Text.Align
Aes
Multilingual
84.2992
87.3315
69.1752
82.5957
83.2642
86.5148
72.7898
82.5067
79.0825
89.6392
88.1968
87.8167
Complex
91.8969
89.5330
84.4742
86.2886
88.2371
89.2268
81.7010
84.1237
81.8652
87.4663
92.0825
89.4845
Table 3: Evaluation of text-image alignment and image aesthetic. Both scores are within the range of 1 to 100.
Method
GlyphPrinter (Ours)
Stage 1
SFT
Mask SFT
w/o RRG
λinter=1
λinter=0
NED
Sen.Acc
NED
Sen.Acc
NED
Sen.Acc
NED
Sen.Acc
NED
Sen.Acc
NED
Sen.Acc
NED
Sen.Acc
Multilingual
0.9715
0.8932
0.9360
0.8023
0.9357
0.8238
0.9483
0.8275
0.9522
0.8772
0.9605
0.8725
0.9549
0.8458
Complex
0.9013
0.8349
0.8142
0.6981
0.8418
0.7406
0.8437
0.7547
0.8810
0.8019
0.8908
0.8066
0.8781
0.7925
Table 4: Ablation study. Bold indicates the best result, and underline denotes the second best.
Figure 6: Ablation studies. The erroneous regions of each image are highlighted with green boxes.
Figure I : Samples from the (a) synthetic dataset and (b) realistic dataset used in Stage 1.
Figure II : Samples from the proposed GlyphCorrector. The erroneous regions are highlighted with green boxes.
Figure III : Samples from the constructed benchmarks (a) GlyphAcc-Multilingual and (b) GlyphAcc-Complex.
Figure IV : Comparison results on GlyphAcc-Multilingual.
Figure V : Comparison results on GlyphAcc-Complex.
Figure VI : Comparison results under out-of-domain conditions.
Figure VII : More results of ablation studies. The erroneous regions of each image are highlighted with green boxes.
Language
GlyphPrinter (Ours)
AnyText2 [ 46 ]
EasyText [ 33 ]
Glyph-Byt5-v2 [ 32 ]
X-Omni [ 17 ]
Qwen-Image [ 53 ]
NED
Sen.Acc
NED
Sen.Acc
NED
Sen.Acc
NED
Sen.Acc
NED
Sen.Acc
NED
Sen.Acc
English
0.9704
0.8853
0.6314
0.5301
0.9571
0.8741
0.8060
0.7650
0.8930
0.6353
0.9432
0.8327
Chinese
0.9771
0.8932
0.7642
0.5089
0.9589
0.8808
0.9287
0.8274
0.7705
0.4199
0.9424
0.8630
Table I : The quantitative results on the OneIG [ 3 ] benchmark.
Faithful text rendering remains a persistent weakness of large text-to-image generative models, as it requires both semantic instruction following and fine-grained glyph-level structure. Prior methods often improve this ability through architecture-specific modules or encoder modifications, which complicate deployment across foundation models. We study text rendering as a post-training preference-alignment problem and propose TextAlign, a non-invasive framework that keeps the generator architecture unchanged. The key component is a hierarchical vision-language model (VLM)-based reward that decomposes rendering errors into global, word, and glyph levels, then converts binary defect judgments into a scalar preference signal. The resulting signal supports both Group Relative Policy Optimization (GRPO) and Direct Preference Optimization (DPO). Experiments on FLUX.1-dev and Z-Image-Turbo show consistent gains in OCR-based text accuracy without degrading general generation quality. Compared with strong foundation and text-rendering baselines, including SD3.5, Qwen-Image, AnyText, and TextDiffuser, these results indicate that reward design offers a scalable alternative to model redesign for improving text rendering.
Mingxuan Cui, Jingpu Yang, Fengxian Ji +7
Mohamed bin Zayed University of Artificial Intelligence · Chinese Academy of Sciences Institute of Automation · Northeastern University +1
Despite recent advances in generative models driving significant progress in text rendering, accurately generating complex text and mathematical formulas remains a formidable challenge. This difficulty primarily stems from the limited instruction-following capabilities of current models when encountering out-of-distribution prompts. To address this, we introduce GlyphBanana, alongside a corresponding benchmark specifically designed for rendering complex characters and formulas. GlyphBanana employs an agentic workflow that integrates auxiliary tools to inject glyph templates into both the latent space and attention maps, facilitating the iterative refinement of generated images. Notably, our training-free approach can be seamlessly applied to various Text-to-Image (T2I) models, achieving superior precision compared to existing baselines. Extensive experiments demonstrate the effectiveness of our proposed workflow. Associated code is publicly available at https://github.com/yuriYanZeXuan/GlyphBanana.
Zexuan Yan, Jiarui Jin, Yue Ma +5
Shanghai Jiao Tong University · Xiaohongshu Inc. · Hong Kong University of Science and Technology +2
Recent reinforcement learning approaches have improved visual text generation, yet generated images still suffer from incorrect wording and malformed glyphs. We identify two coupled limitations: recognition-based rewards often overlook visible glyph defects, while whole-image scalar feedback obscures the uneven quality of individual text regions. These limitations motivate our central principle: Blame errant words, not the canvas, to effectively preserve local quality distinctions. First, we introduce TextDART, a defect-aware region-targeted reward model that localizes individual text regions and independently evaluates their semantic correctness and glyph quality, providing fine-grained, region-precise feedback. Building on TextDART, we propose SCANNER, which turns these regional judgments into spatially differentiated policy feedback. It normalizes rewards for each text target across sampled images and casts the resulting regional advantages onto the corresponding latent tokens. Extensive experiments on existing benchmarks and our newly established PolyText-Bench demonstrate that our approach achieves state-of-the-art performance in text accuracy and glyph fidelity. Project page: https://sujiehu.github.io/textdart-scanner
Sujie Hu, Huaisong Zhang, Pujing Yang +7
The Hong Kong University of Science and Technology · Weixin, Tencent · Tsinghua University +3