Organizations: Institute of Information Engineering, Chinese Academy of Sciences · State Key Laboratory of Cyberspace Security Defense · School of Cyber Security, University of Chinese Academy of Sciences · School of Cyber Science and Engineering, Nanjing University of Science and Technology
Scene text editing seeks to modify textual content in natural images while maintaining visual realism and semantic consistency. Existing methods often require task-specific training or paired data, limiting their scalability and adaptability. In this paper, we propose TextFlow, a training-free scene text editing framework that integrates the strengths of Attention Boost (AttnBoost) and Flow Manifold Steering (FMS) to enable flexible, high-fidelity text manipulation without additional training. Specifically, FMS preserves the structural and style consistency by modeling the visual flow of characters and background regions, while AttnBoost enhances the rendering of textual content through attention-based guidance. By jointly leveraging these complementary modules, our approach performs end-to-end text editing through semantic alignment and spatial refinement in a plug-and-play manner. Extensive experiments demonstrate that our framework achieves visual quality and text accuracy comparable to or superior to those of training-based counterparts, generalizing well across diverse scenes and languages. This study advances scene text editing toward a more efficient, generalizable, and training-free paradigm. Code is available at https://github.com/lyb18758/TextFlow
Figures & tables
Figure 1: Comparison of the pipelines between training-based and training-free methods for scene text editing. Training-based methods require large-scale, high-quality paired data that require high computing resources. The training-free method mostly focuses on the attention map for general objects, but ignores the text accuracy and style consistency.
Figure 2: The overall framework of TextFlow. In the first phase, the source image is encoded into latent representations zt and zsrc via the VAE encoder, which are subsequently processed by the FMS module to generate concatenated representations ztsrc,cat and zttar,cat . These representations, along with their corresponding text embeddings epsrc and eptar , are fed into parallel DiT blocks to compute the velocity field differential ΔV , ultimately producing the edited latent representation zedit ; In the second phase, zedit and the target embedding eptar are processed by the AttnBoost DiT (AB-DiT), where concatenation and self-attention operations generate refined text-to-image attention maps that enhance textual rendering accuracy through spatial-aware amplification.
Figure 3: Illustration of the proposed FMS Model. The latent representations zt and zsrc are processed with random noise ϵ through linear interpolation and vector arithmetic operations to maintain style consistency.
Methods
ScenePair
SSIM ( ×10−2 ) ↑
PSNR ↑
MSE ( ×10−2 ) ↓
FID ↓
ACC (%) ↑
NED ↑
DiffSTE [ 17 ]
22.76
12.26
7.34
180.15
71.11
0.907
TextDiffuser [ 5 ]
26.99
13.93
5.70
56.67
51.48
0.719
AnyText [ 41 ]
30.73
13.66
6.05
51.44
51.12
0.734
TextFlux [ 50 ]
86.57
17.96
1.83
54.64
80.40
0.911
Flux-fill [ 22 ]
82.73
17.10
2.99
107.83
13.74
0.306
Table 1: Performance comparison of different methods on the ScenePair dataset.
Figure 4: Qualitative Analysis. The compared methods include both training-based STE approaches like DiffSTE [ 17 ] , AnyText [ 41 ] , TextFlux [ 50 ] and recent training-free editing techniques FlowEdit [ 20 ] . We also include the powerful foundational model Flux-Kontext [ 21 ] (F-Kontext), for a more extensive comparison.
Figure 5: Qualitative comparison among different DiT-based methods on a full-size image.
FMS Module
SSIM ↑
PSNR ↑
MSE ↓
FID ↓
FlowEdit [ 20 ]
87.60
20.89
1.16
25.41
Ours w/o FMS
87.09
20.47
1.35
16.69
Ours w FMS
89.04
22.42
0.97
13.52
Table 2: Ablation of FMS modules for image quality.
AttnBoost Module
ScenePair
ScenePair (Random)
ACC(%) ↑
NED ↑
ACC(%) ↑
NED ↑
FLUX-Kontext [ 21 ]
78.72
0.920
76.63
0.916
Ours w/o AttnBoost
20.35
0.420
18.84
0.391
Ours w AttnBoost
79.80
0.931
74.52
0.874
Table 3: Ablation of AttnBoost considering text accuracy.
Steps
SSIM ↑
PSNR ↑
MSE ↓
FID ↓
ACC(%) ↑
NED ↑
24
86.80
20.21
1.43
16.94
77.97
0.925
30
87.12
19.86
1.46
23.1
79.90
0.928
42
88.04
22.21
0.97
52.8
79.40
0.926
50
89.30
22.47
0.91
13.53
79.98
0.914
70
87.01
21.02
0.90
12.83
79.88
0.914
Table 4: Ablation of inference steps on ScenePair.
Figure 6: Qualitative ablation studies validate the effectiveness of FMS in style preservation and demonstrate the significant improvement in text rendering accuracy achieved by AttnBoost.
Scheduler
ACC(%) ↑
NED ↑
Ours w Euler
78.73
0.920
Ours w Overshoot [ 16 ]
79.90
0.931
Table 5: Ablation of scheduler on the ScenePair dataset.
Figure 7: Computation graph of the full attention map between zedit and eptar . The green-highlighted region in the lower-left corner illustrates the text-to-image attention components ( At2i ) extracted from each DoubleStream Transformer block, which are subsequently utilized for scheduler enhancement in the text rendering.
Figure 8: Schematic diagram of the Overshoot scheduler. Given the latent representation Z~t at time t , the scheduler first advances the learned ODE trajectory beyond the target step to obtain Z^o , then applies calibrated noise to return to the corrected state Z~s . The injected noise is precisely controlled to ensure Z~s conforms to the marginal distribution of Xs .
Method
ScenePair
SSIM ( ×10−2 ) ↑
PSNR ↑
MSE ( ×10−2 ) ↓
FID ↓
ACC (%) ↑
NED ↑
TextCtrl [ 54 ]
37.56
14.99
4.47
43.78
84.67
0.936
Flux-Text [ 23 ]
86.45
17.95
1.93
54.84
70.94
0.877
TextFlow (Ours)
89.03
22.47
0.91
13.53
79.98
0.914
Table 6: Performance of more methods on the ScenePair dataset.
Type
Method
ScenePair
TamperScene-2k
AnyText-Bench-en
HE
ACC(%) ↑
NED ↑
HE
Sen.acc(%)
NED
HE
Training-Based
TextFlux [ 50 ]
6.9
19.70
0.42
5.4
8.13
0.21
6.2
Flux-Text [ 23 ]
7.1
18.60
0.42
5.9
38.89
0.65
8.1
Qwen-image [ 47 ]
8.0
10.75
0.37
7.7
3,74
0.15
7.5
Flux-Kontext [ 21 ]
7.3
17.79
0.45
7.2
19.53
0.39
7.9
Longcat-Edit [ 38 ]
8.2
0.65
0.29
4.9
5.66
0.26
8.1
Table 7: Performance of different methods on TamperScene and AnyText-Bench. HE represents Human Evaluation.
Stren.
SSIM ↑
PSNR ↑
MSE ↓
FID ↓
ACC(%) ↑
NED ↑
0.2
84.81
18.19
2.67
23.16
75.20
0.895
0.5
85.14
19.83
2.06
19.21
76.92
0.908
0.7
85.92
20.86
1.46
17.25
79.90
0.928
1.0
89.03
22.47
0.91
13.53
79.98
0.914
2.0
89.30
23.47
0.90
14.20
77.62
0.894
5.0
88.47
21.02
0.90
12.83
76.88
0.872
Table 8: Ablation of VΔ strength on ScenePair.
Figure 9: Ablation study on parameter c . The results indicate that configurations with c=2 or c=3 at 50 steps achieve optimal performance in terms of both generation accuracy and human evaluation scores.
Figure 10: Visualized heatmaps of models with and without AttnBoost.
Method
Setting
ACC(%) ↑
NED ↑
TextFlow-Kontext
+ Overs. + AttnBoost
81.16
0.93
TextFlow-Kontext
+ Overs.
79.99
0.91
TextFlow-Kontext
-
78.72
0.92
TextFLux
+ Overs.
81.24
0.92
TextFLux
-
80.40
0.91
Table 9: Ablation of Overshoot scheduler on ScenePair.
Model
Setting
Time(s) ↓
Mme(GB) ↓
ACC(%)
F-Kontext
Base
260.21
40.12
17.79
F-Kontext
Base+TextFlow
483.43
41.57
18.75
Longcat-Edit
Base
136.54
37.24
0.65
Longcat-Edit
Base+TextFlow
252.62
38.67
20.95
FlowEdit
Base(FLUX.1dev)
100.62
32.20
5.56
Table 10: Inference time and memory cost on A6000, accuracy on TamperScene.
Figure 11: Comparative analysis of editing performance with additional models on full-size images.
Figure 12: Additional visual results demonstrating robust performance across challenging scenarios, including artistic typography, small-font text, complex layouts, and special symbols.
Figure 13: Extensive study on varying length, style change, and different prompts.
Figure 14: Limitations in editing accuracy and practical utility within complex scenarios.
Recent advances in Multimodal Large Language Models (MLLMs) and diffusion-based generative models have substantially improved prompt-driven image editing. However, scene text editing remains challenging, as it requires models to precisely modify textual content while preserving visual realism and non-target regions. Current open-source models still lag behind proprietary systems, largely due to the scarcity of high-quality training data and the lack of standardized benchmarks tailored to text editing. To address these challenges, we present TextSculptor, a comprehensive framework for data construction and evaluation of scene text editing. We first develop an automated data construction pipeline that combines text-aware image synthesis with programmatic text rendering and compositing. Based on this pipeline, we build TextSculpt-Data, a large-scale dataset containing 3.2M training samples, including 1.2M OCR-verified text-to-image samples and 2M paired text editing samples with naturally aligned source-target images and strong background consistency. We further introduce TextSculpt-Bench, a benchmark covering four fundamental text editing tasks: text addition, text replacement, text removal, and hybrid editing. To support reliable evaluation, we design a tailored protocol that measures text accuracy, visual quality, and background preservation through OCR-based text alignment, multimodal judgment, and background-region similarity. Extensive experiments show that TextSculptor improves open-source text editing performance and narrows the gap to proprietary models. The data and benchmark are available at https://github.com/linyiheng123/TextSculptor.
Scene text editing aims to modify text in a target region of an image while preserving surrounding background style and texture. Existing methods rely solely on image background information while neglecting the visual details of target regions, which discards stylistic features in the original text and essentially degrades the task to text rendering. Moreover, the conditions imposed by pre-trained glyph encoder limit the scope of editable text. To address these issues, this paper proposes a self-prompting scene text editing method that constructs style and glyph prompts directly from the original image, without introducing additional style or glyph encoders. We employ a two-stage training strategy: the diffusion transformer is first trained on large-scale self-supervised data and then refined using a small set of paired images. By leveraging the in-context learning capability of the Multi-Modal Diffusion Transformer (MM-DiT), it achieves open-vocabulary and style-consistent text editing. Experimental results on various languages demonstrate that our method achieves the state-of-the-art performance in both text accuracy and style consistency. Our project page: hongxiii.github.io/mstedit.
Hongxi Li, Tong Wang, Chengjing Wu +6
1MT Lab, Meitu Inc., Beijing, China · School of Computer Science & Technology, Beijing Institute of Technology, Beijing, China
We propose TextWand, a general-purpose framework that unifies scene text removal, generation, and replacement into a single model. By decomposing complex editing tasks into the atomic primitives of rendering and erasure, TextWand achieves precise control over both text appearance and background integrity. Specifically, we introduce a novel design, Overlay-Reference Positional Encoding (ORPE), to enforce pixel-level layout fidelity and exemplar-driven style control, alongside a new strategy, Region-Adaptive Suppression (RAS), to ensure clean text erasure. To address the absence of a comprehensive benchmark for general-purpose scene text editing among existing single-task datasets, we construct TextWand-Bench. Extensive experiments demonstrate that TextWand outperforms existing leading open-source and closed-source models by delivering superior text content accuracy, layout and style consistency, and overall image quality across scene text removal, generation and replacement tasks.
Shuyu Wang, Zhile Guan, Hongxiu Chen +5
School of Electronic and Computer Engineering, Peking University, Shenzhen, China.