Organizations: Kuaishou Technology · School of Artificial Intelligence, University of Chinese Academy of Sciences, Beijing 100049, China · State Key Laboratory of Multimodal Artificial Intelligence Systems (MAIS), Institute of Automation, Chinese Academy of Sciences, Beijing 100190, China
Text editing in product posters entails inserting new text or replacing existing text while preserving product appearance, background content, and global composition. Despite recent progress in instruction-based image editing, general-purpose models remain unreliable in this setting: they often omit or incorrectly render the target text, place it over salient products or pre-existing content, and produce structurally distorted or visually inconsistent glyphs. We introduce TextRefine, a task-aligned post-training framework that combines supervised fine-tuning with operation-specific reward optimization to address these complementary failure modes. For text insertion, our text-span-level reward jointly assesses semantic fidelity and target-span coverage, penalizes spatial conflicts with products and existing text, and employs a gated structural constraint to preserve non-text regions. For text replacement, our glyph-level reward leverages the connectionist temporal classification (CTC) posterior of the target character to provide graded supervision for fine-grained defects, including missing strokes, structural deformations, and confusion among visually similar characters. We further introduce OpenTextEdit, a dataset comprising 100K images for text editing in product posters, with multi-text layouts, detailed text attributes, product masks, and challenging low-frequency characters. Extensive experiments on both insertion and replacement demonstrate that TextRefine consistently outperforms the evaluated image editing baselines in textual fidelity, placement reliability, and glyph quality while better preserving source-image content.
Figures & tables
Figure 1: Representative failure modes of existing methods for text editing in product posters. In text insertion (top), generated text may overlap salient product regions, conflict with existing text, or deviate from the intended content. In text replacement (bottom), models may alter unintended character instances or produce structurally distorted glyphs.
Figure 2: Overview of the data construction pipeline for text insertion and text replacement in OpenTextEdit.
Figure 3: Valid-span filtering for product-poster text insertion. A detected span is retained when its overlap with pre-existing text is below τbbox and its overlap with the salient-product mask m is below τmask . This criterion implements the non-overlap preference used in our target setting rather than a universal poster-layout rule.
Figure 4: Comparison of binary OCR correctness and the proposed graded glyph signal. Whereas a binary reward retains only the final correctness decision, the target-glyph CTC posterior preserves continuous recognition evidence and provides a more informative signal for optimizing glyph fidelity.
Figure 5: Qualitative comparison of TextRefine with the evaluated baselines on product-poster text insertion (top) and localized replacement (bottom). TextRefine more faithfully renders the requested content while respecting the target poster layout and character structure; baseline outputs exhibit product occlusion, unintended text, or glyph distortion.
Method
Match (%) ↑
Partial (%) ↓
Miss (%) ↓
Extra ↓
Score ↑
FID ↓
SSIM ↑
PSNR ↑
Simple Template Prompt (629 samples)
Qwen-Image-Edit-2511
76.8
8.3
14.9
26
0.7829
36.7330
0.8016
14.8536
FireRed-Image-Edit-1.0
82.2
6.2
11.6
32
0.8277
30.5686
0.7825
14.9120
TextRefine (SFT)
87.1
7.2
5.7
52
0.8526
24.3464
0.8232
15.9917
TextRefine (RL)
91.9
4.3
3.8
18
0.9174
24.2191
0.8303
16.0774
Descriptive Prompt (1235 samples)
Table 1: Quantitative comparison on text insertion benchmark under simple template prompt (top, 629 samples) and descriptive prompt (bottom, 1235 samples). ↑ : higher is better; ↓ : lower is better. Best results in bold .
Method
Acc (%) ↑
Qwen-Image-Edit-2511
48.0
FireRed-Image-Edit-1.0
55.5
TextRefine (SFT)
69.5
TextRefine (RL)
74.5
Table 2: Accuracy on the localized rare-character editing benchmark (200 samples). Higher is better. Best result in bold .
Method
Acc (%) ↑
SFT (No RL)
69.5
Binary OCR Reward
73.0
Rglyph (Ours)
76.0
Table 4: Ablation on localized text replacement rewards (rare-character benchmark, 200 samples). Higher is better. Best results in bold .
Category
Share (%)
Wearable and Fashion Goods
24.6
Home and Lifestyle Products
21.8
Food and Agricultural Commodities
19.3
Beauty and Personal Care Products
17.9
Digital and General Consumer Goods
16.4
Table 1: Product-category distribution of the approximately 100K-example training set.
Category
Share (%)
Wearable and Fashion Goods
24.5
Home and Lifestyle Products
22.0
Food and Agricultural Commodities
19.5
Beauty and Personal Care Products
18.0
Digital and General Consumer Goods
16.0
Table 2: Product-category distribution of the 200-example evaluation benchmark.
Task
Samples
Share (%)
TI-S
45,829
27.90
TI-D
30,408
18.51
TR-G
10,000
6.09
TR-R
61,148
37.23
RM
16,862
10.27
Total
164,247
100.00
Table 3: Task composition of the SFT training corpus.
Figure 1: Representative training examples for the five SFT tasks.
Figure 2: Representative evaluation examples across the five product domains.
Method
Match ↑
Partial ↓
Miss ↓
Extra ↓
Score ↑
Acc. ↑
PosterMaker
83.4
16.6
0.0
0
0.9685
64.5
AnyText v2
76.4
23.6
0.0
0
0.9552
56.0
QIE
77.1
6.4
16.6
92
0.8361
57.5
FireRed
85.4
5.6
9.1
70
0.9109
67.0
TR-SFT
89.8
6.1
4.1
124
0.9536
72.0
GPT-I2
96.2
3.3
0.5
22
0.9889
87.5
Table 4: Simple-template prompt under the SI protocol.
Method
Match ↑
Partial ↓
Miss ↓
Extra ↓
Score ↑
Acc. ↑
PosterMaker
73.4
26.6
0.0
0
0.9496
48.0
AnyText v2
55.2
44.8
0.0
0
0.9148
34.0
QIE
55.8
11.3
32.9
147
0.6933
35.0
FireRed
75.4
10.5
14.1
106
0.8551
50.5
TR-SFT
87.1
8.3
4.6
135
0.9443
63.5
GPT-I2
94.1
5.1
0.8
26
0.9824
82.5
Table 5: Simple-template prompt under the SP protocol.
Method
Match ↑
Partial ↓
Miss ↓
Extra ↓
Score ↑
Acc. ↑
PosterMaker
90.0
10.0
0.0
0
0.9810
69.0
AnyText v2
84.2
15.8
0.0
0
0.9700
49.5
QIE
84.7
4.2
11.1
114
0.8774
50.5
FireRed
91.8
3.7
4.6
97
0.9431
71.5
TR-SFT
88.8
4.6
6.7
86
0.9256
62.0
GPT-I2
97.1
2.3
0.6
38
0.9900
87.0
Table 6: Descriptive prompt under the SI protocol.
Method
Match ↑
Partial ↓
Miss ↓
Extra ↓
Score ↑
Acc. ↑
PosterMaker
88.0
12.0
0.0
0
0.9772
63.5
AnyText v2
81.6
18.4
0.0
0
0.9650
44.0
QIE
82.0
6.7
11.3
118
0.8718
45.5
FireRed
89.9
5.2
4.9
105
0.9373
66.5
TR-SFT
86.1
6.7
7.2
90
0.9157
56.5
GPT-I2
95.9
3.4
0.7
42
0.9868
82.0
Table 7: Descriptive prompt under the SP protocol.
Method
Acc. (%) ↑
QIE
45.0
FireRed
52.0
TR-SFT
77.0
QIE-RL
67.0
FireRed-RL
62.5
TR-RL
85.0
Table 8: Additional comparison of reward optimization for text replacement.
Metric
QIE
FireRed
TR-RL
GPT-I2
Add
4.37
4.52
4.45
4.70
Adjust
3.59
3.93
3.61
4.12
Background
3.71
4.23
3.92
4.48
Beauty
2.82
2.66
3.03
4.00
Color
3.84
4.12
3.83
4.37
Compose
3.46
3.49
3.60
4.07
Table 9: General image-editing results on RedBench-EN.
Metric
QIE
FireRed
TR-RL
GPT-I2
Add
4.43
4.48
4.42
4.67
Adjust
3.44
3.90
3.67
4.07
Background
3.94
4.35
4.02
4.45
Beauty
2.79
2.52
3.02
3.91
Color
3.71
3.94
3.86
4.40
Compose
3.35
3.63
3.69
4.11
Table 10: General image-editing results on RedBench-CN.
Figure 3: Qualitative comparison before and after applying the add-text reward to Qwen-Image-Edit-2511.
Figure 4: Qualitative comparison before and after applying the add-text reward to FireRed-Image-Edit-1.0.
Figure 5: Qualitative comparison of TextRefine before and after reinforcement learning on the add-text task.
Figure 6: Qualitative comparisons of Qwen-Image-Edit-2511 and FireRed-Image-Edit-1.0 before and after reinforcement learning on the localized text-replacement task.
Figure 7: Qualitative comparison of TextRefine before and after reinforcement learning on the localized text-replacement task.