Papers › AnyText2: Visual Text Generation and Editing With Customizable Attributes

AnyText2: Visual Text Generation and Editing With Customizable Attributes

22 Nov 2024arXiv:2411.15245archive 2025-07-28

Yuxiang Tuo, Yifeng Geng, Liefeng Bo

As the text-to-image (T2I) domain progresses, generating text that seamlessly integrates with visual content has garnered significant attention. However, even with accurate text generation, the inability to control font and color can greatly limit certain applications, and this issue remains insufficiently addressed. This paper introduces AnyText2, a novel method that enables precise control over multilingual text attributes in natural scene image generation and editing. Our approach consists of two main components. First, we propose a WriteNet+AttnX architecture that injects text rendering capabilities into a pre-trained T2I model. Compared to its predecessor, AnyText, our new approach not only enhances image realism but also achieves a 19.8% increase in inference speed. Second, we explore techniques for extracting fonts and colors from scene images and develop a Text Embedding Module that encodes these text attributes separately as conditions. As an extension of AnyText, this method allows for customization of attributes for each line of text, leading to improvements of 3.3% and 9.3% in text accuracy for Chinese and English, respectively. Through comprehensive experiments, we demonstrate the state-of-the-art performance of our method. The code and model will be made open-source in https://github.com/tyxsspa/AnyText2.

PaperPDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2411.15245")

Code

Syntology Ran 2 of 21 code samples harvested from 1 repository linked to this paper; 19 have no recorded run. Of those that ran: 2 ran · our draft was wrong.

By repository: official repository: 21 samples from 1 repository, 2 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

tyxsspa/anytext2 officialmentioned in papermentioned on GitHubpytorchApache-2.0 report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

21 samples harvested; 2 ran; 0 honoured the contract we drafted; 19 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

2ran · our draft was wrong
19unverified

Licence: 0 of the 21 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from tyxsspa/anytext2. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

convert_to_unicode tyxsspa/anytext2/bert_tokenizer.py official repository ran · our draft was wrong fingerprinted Apache-2.0 (permissive) · 1923fc05163d207d · report
get_node_name tyxsspa/anytext2/tool_add_anytext.py official repository ran · our draft was wrong Apache-2.0 (permissive) · 0dbf855dab1ab575 · report
arr2tensor tyxsspa/anytext2/eval/anytext2_singleGPU.py official repository unverified Apache-2.0 (permissive) · 13d5598dd3d88751 · report
check_channels tyxsspa/anytext2/util.py official repository unverified Apache-2.0 (permissive) · e84251d6127e8b2b · report
copy_and_rename_dict_keys tyxsspa/anytext2/t3_dataset.py official repository unverified Apache-2.0 (permissive) · 8f01a9b25bacd3fa · report
draw_pos tyxsspa/anytext2/eval/anytext2_singleGPU.py official repository unverified Apache-2.0 (permissive) · 62e380ad4669ac47 · report
extract_all_images tyxsspa/anytext2/eval/clipscore.py official repository unverified Apache-2.0 (permissive) · 695f6baa162444b5 · report
get_state_dict tyxsspa/anytext2/cldm/model.py official repository unverified Apache-2.0 (permissive) · cfc17707f35e7ec4 · report
load tyxsspa/anytext2/eval/anytext2_multiGPUs.py official repository unverified Apache-2.0 (permissive) · 75c1cd45779a2497 · report
load_json tyxsspa/anytext2/eval/anytext2_multiGPUs.py official repository unverified Apache-2.0 (permissive) · 5958926c73426c86 · report
load_state_dict tyxsspa/anytext2/cldm/model.py official repository unverified Apache-2.0 (permissive) · df733a879693145d · report
load_txt tyxsspa/anytext2/dataset_util.py official repository unverified Apache-2.0 (permissive) · c986b2b9b07493a4 · report
load_vocab tyxsspa/anytext2/bert_tokenizer.py official repository unverified Apache-2.0 (permissive) · aaf1cb2c01043065 · report
printable_text tyxsspa/anytext2/bert_tokenizer.py official repository unverified Apache-2.0 (permissive) · 0e5615f8994003cf · report
random_rotate tyxsspa/anytext2/t3_dataset.py official repository unverified Apache-2.0 (permissive) · 68f27900e9bca55d · report
renew_attention_paths tyxsspa/anytext2/lora_util.py official repository unverified Apache-2.0 (permissive) · 399a269e327cf154 · report
renew_resnet_paths tyxsspa/anytext2/lora_util.py official repository unverified Apache-2.0 (permissive) · dfb052a0af48540f · report
resize_image tyxsspa/anytext2/util.py official repository unverified Apache-2.0 (permissive) · a91c692ff279a01a · report
save tyxsspa/anytext2/eval/anytext2_multiGPUs.py official repository unverified Apache-2.0 (permissive) · 8f474e60fb5e395f · report
save_images tyxsspa/anytext2/util.py official repository unverified Apache-2.0 (permissive) · d1b4375d285cdec5 · report
shave_segments tyxsspa/anytext2/lora_util.py official repository unverified Apache-2.0 (permissive) · cea0bc82e0c96896 · report

Tasks

Image GenerationText Generation

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections