Skip to main content
QUICK REVIEW

[Paper Review] AnyText: Multilingual Visual Text Generation And Editing

Yuxiang Tuo, Wangmeng Xiang|arXiv (Cornell University)|Nov 6, 2023
Computer Graphics and Visualization TechniquesComputer Science8 citations
TL;DR

AnyText is a diffusion-based framework for multilingual visual text generation and editing that uses an auxiliary latent module and an OCR-informed text embedding module to render legible text in images, and introduces the AnyWord-3M dataset and AnyText-benchmark.

ABSTRACT

Diffusion model based Text-to-Image has achieved impressive achievements recently. Although current technology for synthesizing images is highly advanced and capable of generating images with high fidelity, it is still possible to give the show away when focusing on the text area in the generated image. To address this issue, we introduce AnyText, a diffusion-based multilingual visual text generation and editing model, that focuses on rendering accurate and coherent text in the image. AnyText comprises a diffusion pipeline with two primary elements: an auxiliary latent module and a text embedding module. The former uses inputs like text glyph, position, and masked image to generate latent features for text generation or editing. The latter employs an OCR model for encoding stroke data as embeddings, which blend with image caption embeddings from the tokenizer to generate texts that seamlessly integrate with the background. We employed text-control diffusion loss and text perceptual loss for training to further enhance writing accuracy. AnyText can write characters in multiple languages, to the best of our knowledge, this is the first work to address multilingual visual text generation. It is worth mentioning that AnyText can be plugged into existing diffusion models from the community for rendering or editing text accurately. After conducting extensive evaluation experiments, our method has outperformed all other approaches by a significant margin. Additionally, we contribute the first large-scale multilingual text images dataset, AnyWord-3M, containing 3 million image-text pairs with OCR annotations in multiple languages. Based on AnyWord-3M dataset, we propose AnyText-benchmark for the evaluation of visual text generation accuracy and quality. Our project will be open-sourced on https://github.com/tyxsspa/AnyText to improve and promote the development of text generation technology.

Motivation & Objective

  • Address the challenge of rendering legible, accurate text in diffusion-based image generation across multiple languages.
  • Propose a diffusion-based pipeline with auxiliary latent and OCR-informed text embedding modules to render and edit text in images while matching background style.
  • Introduce a large-scale multilingual text-image dataset AnyWord-3M and an evaluation benchmark AnyText-benchmark.
  • Demonstrate superior performance over existing methods in text accuracy and image realism for multilingual text generation.

Proposed method

  • Propose a text-control diffusion pipeline with two conditioned components: an auxiliary latent module and a text embedding module.
  • Auxiliary latent module encodes text glyphs, positions, and masked image regions into a latent feature map via glyph, position, and masked inputs.
  • Text embedding module renders glyphs, uses an OCR-based embedding (PP-OCRv3) to encode stroke information, and fuses it with caption embeddings through a transformer and cross-attention.
  • Train with text-control diffusion loss and text perceptual loss to improve writing accuracy in the target text regions.
  • Enable plug-and-play compatibility with existing diffusion models by binding a TextControlNet to focus on text generation while preserving the base model’s capabilities.
  • Present AnYWord-3M, a 3.0M image-text multilingual dataset with OCR annotations, and AnyText-benchmark for evaluation of visual text generation.

Experimental results

Research questions

  • RQ1Can diffusion-based models render multilingual, legible text in images at specified positions and regions (including curved/irregular regions)?
  • RQ2Can text editing within images be performed with consistent font style and alignment across languages?
  • RQ3Does incorporating OCR-based glyph embeddings and an auxiliary latent module improve multilingual text accuracy and visual realism?
  • RQ4How do text-control diffusion loss and text perceptual loss influence writing accuracy and overall image quality?

Key findings

  • AnyText outperforms competing methods in both English and Chinese text generation on the AnyText-benchmark across OCR accuracy (Sen. ACC, NED) and realism (FID).
  • The v1.1 model achieves English Sen. ACC 0.7239, Chinese Sen. ACC 0.6923, with improved NED and FID over prior approaches.
  • The v1.0 model already surpasses several baselines, demonstrating strong integration of generated text with backgrounds (e.g., stone carvings, board signs).
  • The proposed OCR-guided text embedding and the auxiliary latent module enable multi-line, deformed-region, and multilingual text generation and editing, including non-Latin scripts.
  • A large-scale dataset AnyWord-3M (3.0M image-text pairs with OCR annotations) supports training, and AnyText-benchmark provides standardized evaluation for multilingual visual text generation.
  • Ablation studies show that the OCR-based text embedding, explicit position conditioning, and text perceptual loss each contribute to higher Chinese and English text generation accuracy.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.