FreeText: Training-Free Text Rendering via Attention Localization and Spectral Glyph Injection
Abstract
Large-scale text-to-image (T2I) diffusion models excel at open-domain synthesis but still struggle with precise text rendering, especially for multi-line layouts, dense typography, and long-tailed scripts such as Chinese. Prior solutions typically necessitate costly retraining or impose rigid external layout constraints, often compromising aesthetic quality and flexibility. We propose FreeText, a training-free, plug-and-play framework that improves text rendering by leveraging intrinsic mechanisms of Diffusion Transformer (DiT) models. FreeText decomposes the problem into where to write and what to write. For the former, we localize writing regions by extracting token-wise spatial attribution from image-to-text attention, using sink-like tokens as stable spatial anchors and topology-aware refinement to produce high-confidence masks. For the latter, we introduce Spectral-Modulated Glyph Injection (SGMI), which injects a noise-aligned glyph prior with frequency-domain band-pass modulation to strengthen glyph structure and mitigate semantic leakage (rendering the concept instead of the word). Extensive experiments on Qwen-Image, FLUX.1-dev, and SD3 variants across longText-Benchmark, CVTG, and our CLT-Bench show consistent gains in text readability while maintaining semantic alignment and aesthetic quality, with modest inference overhead.
Lay Summary
Large image generation models can create highly realistic pictures, but they still struggle to render readable text, especially for long sentences, posters, signs, and complex languages such as Chinese. Generated text is often misspelled, distorted, or replaced by related visual concepts instead of the intended words, making the images difficult to use in real-world applications. We present FreeText, a training-free method that improves text rendering without retraining or modifying existing image generation models. Our method first identifies where text should appear by analyzing the model’s internal attention patterns, then injects lightweight visual guidance to help preserve character shapes and stroke structures during generation. This allows the model to generate clearer and more accurate text while maintaining the original visual quality and artistic style. Experiments on several popular image generation models show that FreeText consistently improves text readability in both English and Chinese, including challenging cases with dense layouts and rare Chinese characters. We hope this work helps make AI-generated images more practical and reliable for applications such as posters, educational content, user interfaces, and multilingual visual design.