GlyphAnchor: Enhancing Visual Text Rendering via Position-Anchored Glyph Priors

Qiang Xiang, Shuang Sun, Binglei Li, Yibo Chen, Xu Tang, Yao Hu, Junping Zhang

TL;DR

GlyphAnchor is a lightweight, highly effective method that fixes a major flaw in modern image generation models: rendering inaccurate, messy, or missing text. By converting target text into compact glyph patches and anchoring them directly to the image layout using the model's native positional encodings (like RoPE), GlyphAnchor achieves state-of-the-art text rendering accuracy for long paragraphs, dense posters, and rare characters without sacrificing image quality or style.

What Problem Does This Paper Address?

While diffusion transformer models (like FLUX or text-to-image foundation models) generate stunning imagery, they frequently stumble when asked to write text. Common failure modes include spelling errors, missing words, or completely garbled characters. This issue becomes severe in text-rich applications like infographics, posters, or book covers, where text must be long, densely arranged, or written using rare characters.

Existing solutions fall into two camps, both with major drawbacks:

  1. Data-centric scaling: Training larger models on more data helps native text rendering but remains unreliable for complex layouts or rare characters.
  2. Full-canvas glyph conditioning: Passing a separate, blank image containing the rendered text helps accuracy but introduces massive token overhead and severely degrades the background style, often causing the model to ignore the prompt's decorative instructions.

GlyphAnchor bridges this gap by providing precise, lightweight, and style-preserving text rendering control.

Methods

GlyphAnchor introduces a clean, position-anchored architecture alongside a specialized training recipe:

  • Position-Anchored Glyph Priors: Instead of a wasteful full-canvas reference, the method renders each text item into a compact glyph patch image. These patches are encoded into latent tokens via a VAE. Crucially, instead of using custom attention masks, GlyphAnchor maps these tokens directly to their intended target bounding boxes using the model's native 3D Rotary Position Embedding (RoPE). This keeps the attention pattern unchanged and fully compatible with hardware acceleration kernels like FlashAttention.
Figure 3: Overview of GlyphAnchor. Prompt, optional source images, and rendered glyph patch images are encoded into tokens and concatenated before a text-to-image or image-editing diffusion- transformer backbone. The resulting glyph patch tokens are placed in an additional condition frame, forming a virtual glyph plane whose coordinates are anchored to the target layout.
  • Staged Supervised Finetuning (SFT): Training directly on clean rendered text provides weak supervision, while training on ground-truth image crops biases the model toward ugly "copy-paste" artifacts at inference time. The authors design a staged training schedule that gradually shifts the conditioning format from ground-truth image crops to rendered glyph patches, smoothly bridging the train-test gap.
  • NFT Post-training with Text-Aware Rewards: To maximize robustness, the model undergoes reinforcement learning via the DiffusionNFT framework. It uses a novel Text-Layout Consistency Reward that jointly scores OCR string correctness and spatial alignment (penalizing center displacement and scale mismatch), alongside MLLM-guided style and fusion rewards.

Datasets

The authors compiled a diverse training mixture of ~500K samples consisting of web-curated text-rich images and template-constructed images.

For evaluation, they tested across several established benchmarks:

  • LongTextBench & OneIGBench-text (for long text generation)
  • CVTG-2K
  • ChineseWord (specifically targeting rare Chinese characters across three difficulty tiers)

Additionally, the authors introduced InfoTextBench, a challenging new benchmark specifically designed for text-rich poster generation and editing. It contains 133 samples with highly detailed prompts, averaging 19.3 text items and over 200 words per image.

Key Insights and Ideas

  • The Token Efficiency Win: Full-canvas glyph references are computationally expensive because they scale with the entire image resolution. Compact glyph patches dramatically reduce token overhead; even a massive layout with 1,000 characters only consumes 15% (English) to 31% (Chinese) of a full image frame's tokens.
  • Spatial Grounding is Mandatory: Simply feeding glyph patches into the model as standard reference tokens isn't enough. Without explicit spatial anchoring via RoPE, the model still suffers from missing text or corrupted layouts.
  • The Power of Joint Rewards: Traditional text rewards only look at string edit distance (OCR). This paper highlights that models can "cheat" OCR rewards by making text unnaturally large. Combining textual accuracy with spatial layout penalties in the reward function is essential for clean graphic design synthesis.

Key Results

GlyphAnchor was evaluated across three distinct diffusion transformer backbones (FireRed-Image-Edit-1.1, Qwen-Image-Edit-2511, and Z-Image) and demonstrated sweeping improvements:

  • Accuracy Boosts: On LongTextBench, GlyphAnchor raised the average text rendering score of FireRed-Image-Edit from 0.897 to 0.985.
  • Conquering Rare Characters: On the ChineseWord benchmark, it showed massive gains for rare "Level-3" characters, boosting Qwen-Image-Edit's accuracy from a dismal 0.051 to 0.438.
  • InfoTextBench Superiority: In dense poster generation, GlyphAnchor dramatically improved phrase hit rates and overall visual quality, outperforming strong open-source baselines and closing the gap with closed-source commercial models.

Limitations and Future Work

  • Dependency on Layout Planners: GlyphAnchor requires bounding boxes as an input. At inference time, it relies on an external layout planner (like an MLLM). If the layout planner generates overlapping boxes or bad placements, GlyphAnchor will faithfully render text in those suboptimal positions. Integrating layout planning and rendering more tightly remains an open challenge.
  • Misuse Risks: As text rendering becomes highly accurate and indistinguishable from real graphic design, the risk of generating forged documents, misleading advertisements, or malicious posters increases, necessitating further study into deepfake text safeguards.

Summary updated

BibTeX
@inproceedings{xiang2026glyphanchor,
  author = {Qiang Xiang and Shuang Sun and Binglei Li and Yibo Chen and Xu Tang and Yao Hu and Junping Zhang},
  title = {{GlyphAnchor: Enhancing Visual Text Rendering via Position-Anchored Glyph Priors}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=c3aMyawBN4},
}
Figure