June 04, 2026
Scene text editing aims to modify textual content within real-world images or rendered graphics (e.g., photos, posters, and screenshots) while seamlessly preserving the original visual context [1]–[4]. This task is central to high-frequency design workflows such as e-commerce creatives, advertising materials, posters and banners [5], where the same visual asset must be updated repeatedly across languages, seasons, prices, and promotions. Specifically, it encompasses three fundamental operations: scene text removal, generation, and replacement.
Traditionally, these tasks have relied on layer-based design software (e.g., Adobe Photoshop) and tedious manual labor. Such workflows are effective when the original editable source file is available, where text remains a separate vector layer and the corresponding font files, layer styles, and background content can be directly accessed. However, many visual assets encountered in real-world scenarios are flattened raster images, such as product photos, scanned posters, screenshots, online banners, and photographs of physical signs. In these cases, the text is no longer separable from the image: the original font may be unknown or unavailable, the text layer cannot be extracted, and the glyphs are often entangled with shadows, highlights, perspective distortions, material textures, or complex background patterns. Consequently, a conventional pipeline is often insufficient. While recent generative models [6]–[9] have significantly advanced general image editing, they struggle with the unique complexity of scene text. Unlike typical visual objects, text requires strict glyph accuracy and style fidelity. Specifically, a successful edit must simultaneously satisfy multiple stringent constraints: (1) cleanly erasing legacy text without artifacts; (2) rendering new text legibly; (3) adhering to complex layouts (e.g., slanted or curved); (4) matching original typography (e.g., color, shadow, texture); and (5) preserving the background seamlessly. Existing generative editing models still fall short in jointly fulfilling these requirements.
Although recent methods [10]–[13] attempt to tackle scene text editing, they struggle to fully satisfy these stringent constraints. Most prior works are highly specialized. They typically focus exclusively on scene text generation [11], [12], [14]–[16] or scene text removal [17]–[20], or they concentrate solely on style transfer for existing text [10]. Specifically, the limitations of current generative approaches in handling these constraints manifest in three primary aspects. Firstly, existing approaches [15], [21] cannot seamlessly integrate scene text removal, generation and replacement within a single coherent framework. Secondly, most of them [10]–[12], [22] struggle to achieve joint control over text layout and typographic style during scene text generation and replacement. Most existing methods primarily focus on matching typographic styles but fall short in managing the spatial typesetting of the text within the image. Furthermore, even the approaches that attempt layout control [23]–[25] often fail to achieve precise, character-level spatial alignment. Consequently, it remains highly challenging for current models to impose an arbitrary reference style while strictly adhering to a user-specified layout. Thirdly, the erasure of original text and the rendering of new text are frequently entangled. Scene text replacement requires the model to simultaneously suppress the visual evidence of the old text and accurately generate new glyphs. Without an explicit mechanism to separate the erasure process from the rendering process, these two actions severely interfere with each other. As a result, models often leave visible ghosting artifacts from the original text or inadvertently damage the surrounding background textures when forced to overwrite the region, making it imperative to decouple these conflicting operations into distinct primitives.
In this paper, we propose TextWand, a versatile framework that unifies text removal, generation, and replacement within a single model, while enabling reliable joint layout and style control in complex real-world images. We achieve this by decomposing the complex editing process into two atomic primitives: rendering and erasure. To concretely support these primitives, we present Overlay-Reference Positional Encoding (ORPE) to enforce tracing-level layout fidelity and exemplar-driven styling for the rendering process, and Region-Adaptive Suppression (RAS) to instantiate the erasure primitive (\(\mathcal{P}_{erase}\)), effectively suppressing residual text evidence to ensure clean background reconstruction across diverse editing tasks. Additionally, we introduce a progressive curriculum training strategy to ensure stable training. We further design an intuitive user interface to operationalize these primitives, allowing users to explicitly specify their erasure intent via a brush mask and their rendering intent via a textbox with a style exemplar. Finally, to address the absence of standardized evaluation for this unified task, we construct TextWand-Bench, a comprehensive benchmark comprising 1500 high-quality test cases meticulously categorized into three core tasks: scene text removal, generation, and replacement. Extensive experiments demonstrate that TextWand achieves state-of-the-art performance across all three tasks, significantly outperforming existing baselines in both text content accuracy, layout and style consistency, and overall image quality.
In summary, our contributions are as follows:
We propose TextWand, a general-purpose framework that unifies text removal, generation, and replacement. By formulating editing as rendering and erasure primitives, it enables precise control across diverse scenarios.
We design two complementary mechanisms: Overlay-Reference Positional Encoding (ORPE) for joint layout-style rendering, and Region-Adaptive Suppression (RAS) for erasure, supported by a progressive training strategy.
We construct the first comprehensive benchmark dedicated to unified scene text editing, systematically evaluating text removal, generation, and replacement under strict layout and typography constraints.
We develop a user-friendly interaction interface based on brush and textbox controls that makes editing intent explicit and reproducible.
Extensive experiments demonstrate the effectiveness of TextWand and validate the role of each proposed component.
Organization of This Paper. The remainder of this paper is organized as follows. Sec. 2 reviews recent progress in controllable image editing and scene text editing, with a particular focus on the limitations of existing methods in unified text removal, generation, and replacement. Sec. 3 introduces the proposed TextWand framework, including the unified formulation based on rendering and erasure primitives, the Overlay-Reference Positional Encoding (ORPE), the Region-Adaptive Suppression (RAS), and the progressive curriculum training strategy. Sec. 4 presents the construction of TextWand-72K and TextWand-Bench, describes the experimental settings, and reports quantitative, qualitative, user study, and ablation results across scene text removal, generation, and replacement tasks. Finally, Sec. 5 concludes the paper and discusses future directions.
Diffusion-based generative models [6], [8], [26]–[30] have substantially advanced image editing by enabling high-fidelity modifications while preserving realism and global consistency. To achieve this, recent works havde explored various control mechanisms, ranging from natural language instructions [31]–[34] to explicit visual conditions (e.g., masks, edges) [35]–[37] and interactive operations [38]–[40]. From the perspective of editing targets, these general-purpose methods excel at manipulating high-level semantic elements. They can be broadly categorized into three main streams: global image stylization, object-level manipulation, and local attribute modification. Global stylization methods [41], [42] focus on altering the overall artistic style or illumination of an image while preserving the underlying structural layout. Object-level manipulation, which includes the insertion, removal, and replacement of entities, typically leverages masked inpainting techniques [26] to seamlessly integrate new foreground objects into existing background contexts. Lastly, local attribute modification approaches aim to alter specific properties of an existing entity. More recently, the field has witnessed a paradigm shift towards general-purpose editing models [30], [31], [43]–[46], which can simultaneously and effectively execute these diverse manipulation tasks within a single unified framework.
Scene text editing is harder than generic image editing because it must satisfy stricter constraints on both geometry and appearance: the text has to remain readable, follow precise typesetting layouts including perspective or curvature, and match coherent typography style, all while leaving the background intact. Prior work [47]–[54] has made notable progress, yet the current landscape remains fragmented. Recently, FonTS [10] focuses on reference-driven typography styling, but it provides limited control over geometric typesetting and tends to be less reliable on complex real-world backgrounds. Content-centric methods such as FluxText [11], AnyText [14], AnyText2 [12] and ControlText [55] can generate or modify textual content, but they typically offer limited support for expressive typesetting, and their layouts are often unstable when long strings or challenging scenes are involved. EasyText [21] improves geometric flexibility by supporting curved and arched layouts, yet it does not provide fine-grained control over typographic style to match a given reference. More unified attempts such as OmniText [22] move toward jointly handling multiple editing factors, but their controllability is still limited, for example to coarse attributes such as color, and they do not reliably support curved typesetting. Overall, existing methods either emphasize style at the expense of layout control, emphasize content and layout without reliable style transfer, or attempt unification with insufficient control granularity. This leaves an open need for a general-purpose scene text editing framework that can operate on complex backgrounds, support both deletion and insertion, and enable coordinated control of expressive layout and typographic style under simple user interactions.
The goal of scene text editing is to manipulate text instances within an image while preserving background coherence. We characterize a text instance as \(\mathcal{T}=\{C,L,S\}\), where \(C\), \(L\), and \(S\) denote content, geometric layout, and visual style. We unify diverse editing tasks by reducing them to two atomic primitives: erasure \(\mathcal{P}_{erase}\), which removes the textual evidence, and rendering \(\mathcal{P}_{render}\), which synthesizes glyphs conditioned on layout and style controls.
TextWand adopts this decoupled formulation to handle scene text removal, generation and replacement within a single framework. We formulate the user intentions as explicit control signals. Let \(\mathbf{I}_{src}\) denote the original source image to be edited, \(\mathbf{M}\) denote the binary mask defining the region for erasure, \(\mathbf{I}_{str}\) represents the structural skeleton, a geometrically neutral guide (e.g., standard font rasterization) that defines precise spatial positioning and glyph boundaries. Conversely, \(\mathbf{I}_{sty}\) provides the exemplar style, containing the intricate typographic details, textures, and artistic effects. Using \(\mathbf{I}_{str}\) and \(\mathbf{I}_{sty}\) decouples where to place from how to render, enabling faithful style transfer onto a fixed geometric scaffold. Building upon these atomic primitives, the target image \(\mathbf{I}_{target}\) produced by distinct editing tasks is formulated as specific combinations of these atomic primitives: for text removal, \(\mathbf{I}_{target} = \mathcal{P}_{erase}(\mathbf{I}_{src}, \mathbf{M})\); for text generation, \(\mathbf{I}_{target} = \mathcal{P}_{render}(\mathbf{I}_{src}, \mathbf{I}_{str}, \mathbf{I}_{sty})\); and for text replacement, \(\mathbf{I}_{target} = \mathcal{P}_{erase}\circ \mathcal{P}_{render}(\mathbf{I}_{src}, \mathbf{I}_{str}, \mathbf{I}_{sty}, \mathbf{M})\), where \(\circ\) represents the coordinated execution of erasure and rendering within the same inference pass, effectively steering the denoising process to satisfy both the structural constraints of \(\mathcal{P}_{render}\) and the contextual consistency of \(\mathcal{P}_{erase}\).
To realize these editing objectives while fundamentally avoiding the feature entanglement inherent in coupled approaches, we introduce TextWand. As illustrated in part (a) of 2, we implement TextWand using a transformer-based diffusion architecture that integrates these primitives into a unified generative stream. Specifically, the visual inputs (source image \(\mathbf{I}_{src}\), mask \(\mathbf{M}\), structure \(\mathbf{I}_{str}\), and style reference \(\mathbf{I}_{sty}\)) are first compressed into latents by a frozen VAE [56], while the text instruction \(\mathbf{T}_{instruction}\) is encoded into semantic embeddings via a frozen VLM. These condition latents and embeddings, alongside the noisy latents, are then fed into stacked Multi-Modal Diffusion Transformer (MMDiT) blocks. Within these blocks, rather than treating conditions as independent sequences, our method coordinates the editing process through two specialized mechanisms: Overlay-Reference Positional Encoding (ORPE) for precise spatial alignment with independent style referencing, and Region-Adaptive Suppression (RAS) to attenuate masked features during attention for clean erasure. Furthermore, to ensure stable convergence across these diverse tasks, TextWand is optimized via a progressive curriculum training strategy. By decoupling the learning process, the model progressively advances from fundamental style transfer on clean backgrounds to complex text generation in real-world scenes, before finally integrating the erasure primitive for unified scene text editing.
We implement the proposed editing primitives by first encoding the input conditions into a sequence of latent feature tokens. Let \(\mathbf{f}_{src}, \mathbf{f}_{str}, \mathbf{f}_{sty} \in \mathbb{R}^{L \times D}\) denote the token sequences extracted from the source image, structure image, and style reference, respectively, where \(L\) is the sequence length and \(D\) is the embedding dimension. In standard multi-modal diffusion transformers leveraging 3D Rotary Positional Embeddings (e.g., MS-RoPE [6]), multiple visual conditions are natively treated as independent, sequential instances along a temporal axis. As shown in part (b) of 2 (left), the model assigns a unique temporal index \(t\) to each image input, formulating the position as \((t, h, w)\). Consequently, even if the structure image \(\mathbf{f}_{str}\) and the source canvas \(\mathbf{f}_{src}\) share the same spatial resolution \((H, W)\), they are projected into disjoint regions of the positional embedding space. This temporal separation burdens the attention mechanism to infer correspondences, leading to spatial drift in pixel-level layout adherence.
To overcome this limitation and enforce strict spatial correspondence for the rendering primitive, we introduce Overlay-Reference Positional Encoding (ORPE). Our core insight is to reconfigure the 3D coordinate system to introduce a task-specific inductive bias that reflects the logical alignment of inputs. We logically partition the inputs: the spatially-aligned canvas group (\(f_{src}\), \(f_{msk}\), \(f_{str}\)) and the geometrically independent reference group (\(f_{sty}\)). By forcibly overriding the sequential assignment and anchoring the canvas group to a shared 3D coordinate \(p_{shared} = (t_0, h, w)\), ORPE injects a powerful geometric prior: the structural guide is perceived natively as a synchronized logical overlay, not a separate sequence. This explicit spatial synchronization guarantees coordinate-aligned self-attention, ensuring strict adherence to user-specified layouts. Conversely, isolating the style reference at \(p_{style} = (t_{sty}, h, w)\) (\(t_{sty} \neq t_0\)) allows it to function as a floating semantic exemplar. This explicit spatial arrangement relieves the model from inferring complex long-range correspondences, ensuring that the generated text strictly adheres to the user-specified geometry while faithfully rendering the target style.
The implementation of the erasure primitive \(\mathcal{P}_{erase}\) faces a fundamental conflict, as the self-attention mechanism must gather background context from source image tokens while simultaneously ignoring the obsolete text features residing within the editing region. Without explicit intervention, standard attention layers naturally attend to these residual features, inevitably causing severe semantic artifacts in the final output.
We therefore propose Region-Adaptive Suppression (RAS) to explicitly shape the self-attention evidence field. Rather than using \(\mathbf{M}\) as a passive binary hint, RAS selectively suppresses the \(K_{src}\) and \(V_{src}\) projected from \(\mathbf{f}_{src}\) inside \(\mathbf{M}\), while leaving non-masked context and other conditions fully accessible. This yields cleaner removal with minimal architectural change and is compatible with standard MMDiT blocks. Crucially, RAS is applied consistently across all denoising timesteps, maintaining a stable semantic vacuum that allows the rendering primitive to seamlessly composite new text features without temporal disruption. The detailed architectural flow of this operation is visualized in part (c) of 2.
Implementation. Formally, let \(K_{src}, V_{src} \in \mathbb{R}^{L \times D}\) denote the key and value matrices projected from the source image tokens. Before the softmax attention operation, we introduce a spatially-selective suppression mechanism: \[\hat{\boldsymbol{K}}_{src}[p] = \begin{cases} \lambda_{ras} \cdot \boldsymbol{K}_{src}[p] & \text{if } p \in \mathbf{M} \\ \boldsymbol{K}_{src}[p] & \text{otherwise} \end{cases}\] \[\hat{\boldsymbol{V}}_{src}[p] = \begin{cases} \lambda_{ras} \cdot \boldsymbol{V}_{src}[p] & \text{if } p \in \mathbf{M} \\ \boldsymbol{V}_{src}[p] & \text{otherwise} \end{cases}\] where \(p\) represents the spatial position index, and \(\lambda_{ras} \in [0, 1)\) is a scalar suppression factor.
This spatially-selective modulation reconfigures the attention manifold to eliminate persistent semantic interference. Consequently, the modified attention output is computed as: \[\text{Attention}(\boldsymbol{Q}, \hat{\boldsymbol{K}}, \hat{\boldsymbol{V}}) = \text{softmax}\left(\frac{\boldsymbol{Q}\hat{\boldsymbol{K}}^\top}{\sqrt{d}}\right) \hat{\boldsymbol{V}}\] By attenuating \(K_{src}\), we effectively marginalize masked regions within the global affinity map, rendering obsolete features invisible to queries during the dot-product calculation. Simultaneously, the suppression of \(V_{src}\) serves as a latent-level barrier to prevent residual feature leakage. This mechanism creates a semantic vacuum that forces the model to prioritize uncontaminated contextual priors and the precise structural guidance \(\mathbf{f}_{str}\) for artifact-free reconstruction.
Simultaneous optimization of erasure and rendering often leads to severe feature entanglement between structural generation and background reconstruction. To address this, we propose a progressive curriculum that decomposes the learning process along a complexity gradient, allowing the model to acquire robust text rendering priors before tackling the complexities of unified contextual editing.
Stage 1: Isolated Style Transfer. We first optimize the model to execute the rendering primitive (\(\mathcal{P}_{render}\)) using plain white backgrounds. This noise-free environment isolates style transfer via ORPE, ensuring precise typography and spatial typesetting without background interference.
Stage 2: Context-Aware Typography Rendering. We then introduce real-world scenes but restrict the objective to the scene text generation task. Leveraging the typographic priors acquired in the first stage, the optimization shifts to environmental integration. The model learns to synthesize appropriate lighting, shadows, and textures to blend the generated text naturally into complex background contexts.
Stage 3: Unified Task Integration. Finally, we introduce the erasure primitive to jointly optimize the full spectrum of scene text editing tasks. Capitalizing on the robust rendering priors acquired in previous stages, the model effortlessly couples with RAS to seamlessly composite new text into cleanly erased backgrounds, achieving highly controllable editing.
Datasets and Benchmark. A key obstacle to unified scene text editing lies in the lack of datasets that provide explicit and fine-grained supervision for controllable editing. Existing resources are often designed for isolated sub-tasks, such as text removal or text rendering, and typically provide only coarse text prompts or final edited images, without exposing the intermediate control signals required by professional editing workflows. As a result, they are insufficient for learning how to jointly control text content, spatial layout, typographic style, and background restoration. To bridge this fundamental infrastructure gap, we introduce TextWand-72K, a large-scale, unified dataset specifically architected for multi-attribute control. Built upon the Poster-100k dataset [57], it provides 72,000 high-quality training pairs featuring explicit, pixel-level structural guides and exemplar-driven style references. The dataset encompasses a diverse distribution of languages, layouts (including curved, slanted), and highly complex real-world background textures. To enable fair comparisons, we establish TextWand-Bench, consisting of 1,500 meticulously selected test samples evenly distributed across text removal, generation, and replacement (500 samples per task). To strictly prevent train-test leakage, all benchmark images are sourced from independent domains isolated from the Poster-100k training corpus, ensuring zero overlap. By providing standardized, high-precision control signals, TextWand-Bench offers a robust evaluation landscape for layout fidelity and style consistency. To facilitate future research and ensure full reproducibility, the TextWand-72K dataset, TextWand-Bench, and pre-trained model weights will be publicly released. For detailed construction process, please refer to the supplementary materials.
| Method | Evaluation Metrics | ||||||
|---|---|---|---|---|---|---|---|
| 2-8 | NED \(\downarrow\) | \(\text{IoU}_{\text{bbox}}\) \(\uparrow\) | FID \(\downarrow\) | LPIPS \(\downarrow\) | SSIM \(\uparrow\) | PSNR \(\uparrow\) | CLIP-I \(\uparrow\) |
| Scene Text Generation | |||||||
| AnyText2 [12] | 0.9954 | 0.1852 | 87.15 | 0.2122 | 0.6722 | 17.06 | 0.8224 |
| FluxText [11] | 0.3696 | 0.7408 | 49.43 | 0.0579 | 0.9165 | 21.44 | 0.9131 |
| Qwen-Image-Edit-2509 [6] | 0.4782 | 0.6836 | 52.79 | 0.0955 | 0.8560 | 20.44 | 0.9017 |
| Seedream 4.5 | 0.3361 | 0.2550 | 76.42 | 0.2624 | 0.6898 | 15.77 | 0.8677 |
| Nano Banana Pro | 0.4032 | 0.3436 | 52.02 | 0.1252 | 0.7585 | 20.28 | 0.9013 |
| TextWand (Ours) | 0.3319 | 0.8837 | 11.46 | 0.0325 | 0.9340 | 27.35 | 0.9654 |
| Scene Text Replacement | |||||||
| AnyText2 [12] | 0.9938 | 0.1538 | 90.22 | 0.2179 | 0.6629 | 17.09 | 0.8204 |
| FluxText [11] | 0.4629 | 0.7115 | 49.45 | 0.0629 | 0.9124 | 21.36 | 0.9056 |
| Qwen-Image-Edit-2509 [6] | 0.4536 | 0.5821 | 51.84 | 0.0882 | 0.8988 | 20.38 | 0.8950 |
| Seedream 4.5 | 0.3199 | 0.5349 | 62.06 | 0.1770 | 0.7665 | 18.52 | 0.8816 |
| Nano Banana Pro | 0.3592 | 0.5341 | 52.32 | 0.1100 | 0.7623 | 20.54 | 0.9043 |
| TextWand (Ours) | 0.3368 | 0.8721 | 14.03 | 0.0358 | 0.9291 | 26.87 | 0.9614 |
d
Data Construction Pipeline. To obtain explicit and reproducible supervision for unified scene text editing, we design a programmatic data construction pipeline that synthesizes paired samples with fully controlled content, layout, style, mask, and target image. As shown in 3, each sample consists of five aligned components: the source image \(\mathbf{I}_{src}\), the erasure mask \(\mathbf{M}\), the structural guide \(\mathbf{I}_{str}\), the style reference \(\mathbf{I}_{sty}\), and the ground-truth target image \(\mathbf{I}_{target}\), together with a metadata file recording all rendering parameters. This design allows us to train and evaluate the model under precise supervision rather than relying only on coarse natural language descriptions.
We start from text-free background images. For each sample, the text content is randomly sampled from a character pool containing over 5,000 Chinese characters, English letters, and common symbols. The typographic appearance is sampled from more than 300 font files and further diversified through randomized rendering effects. This produces a wide range of rasterized text styles, from simple flat typography to highly decorative poster-like text.
For layout construction, we generate both regular and expressive text arrangements. Horizontal text is randomly placed with varying font sizes, tracking, and small rotations. Curved text is generated by sampling cubic Bezier curves and placing characters according to arc length, which enables arched and slanted layouts. A trial-and-error validation procedure is used to reject invalid layouts whose glyph masks exceed image boundaries or violate placement constraints. This creates challenging replacement cases where the model must erase obsolete text and render new text in the same spatial region.
We construct three task types. For scene text generation, the source image is a clean background, the mask is empty, the structural guide is a black glyph mask rendered on a white canvas, the style reference is a centered exemplar rendered with the target style, and the ground truth is obtained by compositing the stylized target text onto the background. For scene text removal, we first render stylized text onto a clean background to form the source image, derive the erasure mask from the glyph region with dilation and blur, and use the original clean background as the ground truth. For scene text replacement, the source image contains the old stylized text, the mask is generated from the old text region, the structural guide specifies the new text layout, the style reference provides the desired appearance, and the ground truth is rendered by compositing the new stylized text onto the clean background. All masks are generated from exact glyph masks and then expanded to better cover strokes, shadows, and antialiasing artifacts, making the erasure supervision closer to practical user-provided brush masks.
The pipeline records all sampled parameters, including text strings, font identities, layout type, Bezier control points, character positions, rotation centers, bounding boxes, style attributes, and task instructions. Therefore, every sample is exactly traceable and can be regenerated or analyzed. By jointly varying text content, layout, and style between old and new text, our construction process provides diverse supervision for the three atomic editing abilities required by TextWand: clean erasure, faithful structural rendering, and exemplar-driven style transfer.
Implementation Details. Our method is built upon the Qwen-Image-Edit-2509 [6] foundation model. We employ Low-Rank Adaptation (LoRA) [58] to fine-tune the model, setting the LoRA rank to 128. The hyperparameter \(\lambda_{ras}\) is set to 0.4. To ensure stable optimization, the process strictly follows the proposed progressive curriculum training strategy. Specifically, the model is trained for 1,000 steps in the first stage, 1,000 steps in the second stage, and 4,000 steps in the final stage, with a total training batch size of 64.
Interactive Graphical User Interface. To facilitate highly natural and intuitive scene text editing, we developed a comprehensive interactive Graphical User Interface (GUI) powered by our TextWand framework. As illustrated in Figure 4, the UI is designed to streamline the complex process of explicit control signal provision into a user-friendly workflow:
Input & Erasure Module: Users upload the source image \(\mathbf{I}_{src}\) and can directly use a flexible brush tool to paint over obsolete text. This operation intuitively defines the binary erasure mask \(\mathbf{M}\) for seamless text removal.
Layout & Style Control Module: To define the structure guide (\(\mathbf{I}_{str}\)), users type the target text and can freely manipulate its spatial layout into arbitrary forms, including horizontal, diagonal, arched, and freely rotated orientations. For the style reference (\(\mathbf{I}_{sty}\)), the UI offers dual modes: users can either upload an external exemplar or conveniently draw a bounding box to extract in-context typography directly from the source image. If no reference is provided, the system seamlessly defaults to contextual blending.
Execution Module: With a single click, the unified framework coordinates the erasure and rendering primitives (\(\mathcal{P}_{erase} \diamond \mathcal{P}_{render}\)) within the same inference pass to generate the final highly realistic target image.
This interactive system demonstrates the practical applicability, high degree of freedom, and robust zero-shot generalization of TextWand in real-world graphic design and photo editing scenarios.
Evaluation Metrics. To align with the stringent requirements of scene text editing discussed earlier, we evaluate the editing performance across three distinct sets of metrics. (1) Image Quality and Background Consistency: We utilize FID , LPIPS [59], SSIM [60], PSNR and CLIP-I [4] to assess the perceptual quality and visual fidelity. These metrics are applied across all tasks, serving as the primary indicators. (2) Text Content and Layout Accuracy: For text generation and replacement tasks, we adopt Normalized Edit Distance (NED) to evaluate the OCR-level text accuracy, and Bounding Box IoU (\(\text{IoU}_{\text{bbox}}\)) to measure the precision of spatial layout control. (3) Style Consistency: Traditional metrics often struggle to capture fine-grained typographic styles. Following recent advancements in Large Vision-Language Models (VLMs) as visual evaluators, we employ Qwen3-VL-8B [61] as an objective judge. Given a triplet consisting of the ground truth (GT), our generated result, and the result of a comparison method, the VLM is instructed to select the image that better matches the font style, color, and texture of the GT. We randomize pair ordering and blind method identities when querying the judge to reduce evaluation bias. In 7, we report the win rate of our method to quantify style transfer performance.
Figure 7: Visual style assessment and human preference. VLM win rates on the (a) scene text generation and (b) scene text replacement tasks. (c) Overall preference rate from the user study.. a — Text Generation, b — Text Replacement, c — User Study
Comparative Methods. Due to the absence of existing unified frameworks for comprehensive scene text editing, we construct task-specific comparison groups. Across all three tasks (removal, generation, and replacement), we benchmark against leading general-purpose image editing models, encompassing both open-source (Qwen-Image-Edit-2509 [6], FLUX.1-Kontext [7], LongCat [62]) and closed-source (Nano Banana Pro, Seedream 4.5) systems. For the rendering-intensive generation and replacement tasks, we additionally incorporate the latest text-centric models, AnyText2 [12] and FluxText [11]. To maintain a rigorous evaluation protocol, our chosen baselines represent the current state-of-the-art in handling explicit spatial guidance or localized text rendering. Methods lacking architectural support for fine-grained region editing fundamentally fail at these precise tasks, yielding trivial comparisons. Thus, they are excluded to ensure our benchmark remains strictly focused on competitive models.
Scene Text Generation. Scene text generation demands simultaneous adherence to strict content, layout, and style constraints. As detailed in 1, TextWand establishes new state-of-the-art performance across all perceptual image quality metrics and secures a commanding win rate in the VQA-based style assessment (7 (a)). These quantitative achievements are visually evident in 5. While all comparative methods systematically suffer from severe spatial misalignments and incorrect typographic styles, TextWand flawlessly executes the user intent in every instance. In contrast to these competing approaches, our method strictly anchors to the provided layout guidance and accurately renders the target text with the exact desired lighting, color, and font style, consistently delivering highly realistic in-the-wild editing without exception.
| Method | Evaluation Metrics | ||||
|---|---|---|---|---|---|
| 2-6 | FID \(\downarrow\) | LPIPS \(\downarrow\) | SSIM \(\uparrow\) | PSNR \(\uparrow\) | CLIP-I \(\uparrow\) |
| FLUX.1-Kontext [7] | 60.16 | 0.0852 | 0.9106 | 23.59 | 0.8726 |
| LongCat-Image-Edit [62] | 25.85 | 0.0853 | 0.7418 | 22.34 | 0.9440 |
| Qwen-Image-Edit-2509 [6] | 21.32 | 0.0686 | 0.8100 | 25.35 | 0.9538 |
| Seedream 4.5 | 31.80 | 0.1475 | 0.7724 | 23.94 | 0.9415 |
| Nano Banana Pro | 19.53 | 0.0549 | 0.7940 | 25.48 | 0.9586 |
| TextWand (Ours) | 25.84 | 0.0498 | 0.9155 | 27.28 | 0.9577 |
Scene Text Replacement. Scene text replacement presents the formidable dual challenge of entirely erasing legacy text while synthesizing new content under strict layout and style constraints. As detailed in 1, TextWand consistently outperforms all baselines across perceptual image quality metrics, demonstrating superior background preservation. Furthermore, our method achieves a commanding win rate in the VQA-based style assessment (7 (b)). As shown in 6, our method achieved the best visual results compared to other methods. By fundamentally decoupling erasure from rendering, TextWand successfully eliminates the residual ghosting artifacts that severely limit prior methods, achieving unprecedented stylistic fidelity.
Scene Text Removal. Scene text removal requires eliminating outdated texts while perfectly reconstructing occluded backgrounds. As demonstrated in 2, our method outperforms other comparative methods across most of image quality metrics, and maintains a marginal performance gap in the remaining few. This quantitative advantage is further corroborated by our qualitative results in 8. FLUX.1-Kontext [7] method fails to remove the target text. Nano Banana Pro method generates additional anomalous characters, while the Seedream 4.5 method excessively erases adjacent non-target text. In contrast, our approach seamlessly reconstructs complex background textures without affecting the surrounding visual context.
User Study. A blind 6-AFC user study (23 participants, 10 diverse cases) demonstrates TextWand’s commanding 61.74% preference rate (7 (c)). This overwhelming human consensus validates our visual superiority and highly realistic syntheses, definitively offsetting the aforementioned OCR metric discrepancies. Questionnaire details are in the supplementary materials.
| Method | Evaluation Metrics | ||||||
|---|---|---|---|---|---|---|---|
| 2-8 | NED \(\downarrow\) | \(\text{IoU}_{\text{bbox}}\) \(\uparrow\) | FID \(\downarrow\) | LPIPS \(\downarrow\) | SSIM \(\uparrow\) | PSNR \(\uparrow\) | CLIP-I \(\uparrow\) |
| Scene Text Generation | |||||||
| w/o ORPE | 0.3777 | 0.8710 | 12.24 | 0.0330 | 0.9340 | 27.23 | 0.9635 |
| w/o RAS | 0.3769 | 0.8651 | 12.90 | 0.0341 | 0.9332 | 26.95 | 0.9630 |
| Train in Single Stage | 0.4152 | 0.8503 | 18.67 | 0.0402 | 0.9284 | 25.66 | 0.9516 |
| TextWand (Ours) | 0.3319 | 0.8837 | 11.46 | 0.0325 | 0.9340 | 27.35 | 0.9654 |
| Scene Text Replacement | |||||||
| w/o ORPE | 0.3653 | 0.8718 | 13.92 | 0.0372 | 0.9253 | 26.73 | 0.9615 |
| w/o RAS | 0.3986 | 0.8665 | 15.30 | 0.0384 | 0.9245 | 26.46 | 0.9590 |
| Train in Single Stage | 0.4415 | 0.8223 | 22.08 | 0.0451 | 0.9246 | 24.90 | 0.9445 |
| TextWand (Ours) | 0.3368 | 0.8721 | 14.03 | 0.0358 | 0.9291 | 26.87 | 0.9614 |
To validate the necessity of our proposed components, we conduct extensive ablation studies on the text generation and replacement tasks, evaluating the model under three degraded settings. The quantitative results are summarized in 3. The qualitative results are displayed in 3.
To evaluate the effectiveness of the proposed ORPE, we replace it with the original sequential positional encoding, MSRoPE, in our base model Qwen-Image-Edit-2509. As shown in 3, removing ORPE in the scene text generation and replacement tasks severs the explicit spatial correspondence between the structure guidance and the canvas. Forced to rely on implicit long-range dependencies, the model suffers a substantial decline across the majority of evaluation metrics. Furthermore, qualitative results in 9 visually corroborate this finding, demonstrating that the model without ORPE frequently generates text with incorrect scales and misaligned positions, utterly failing to adhere to the provided structural constraints. This widespread performance drop confirms that ORPE is crucial for enforcing joint layout-style control.
To evaluate the effectiveness of the proposed RAS, we remove this suppression mechanism from our model. As reported in 3, without RAS, the self-attention mechanism fails to suppress the original text and inevitably aggregates these obsolete features. This feature entanglement leads to a drastic degradation in image quality metrics. Furthermore, qualitative comparisons in 9 visually corroborate this decline, revealing that the variant without RAS produces severe overlapping artifacts in the edited regions. These widespread quantitative and qualitative degradations firmly highlight the indispensable role of RAS in decoupling outdated semantic signals for clean, artifact-free editing.
To evaluate the effectiveness of the proposed progressive curriculum training strategy, we train the model directly from scratch without this stage-wise strategy. As reported in 3, abandoning the curriculum leads to severe optimization conflicts between structural generation and texture blending. This instability causes a significant performance drop across all quantitative metrics. Furthermore, qualitative comparisons in 9 visually corroborate this decline, revealing that the model trained with a single-stage strategy exhibits weaker preservation of the reference text style and often suffers from missing or incomplete characters, indicating that directly learning layout construction and style rendering together leads to unstable optimization. The variant without RAS fails to fully erase the original text, leaving visible remnants that interfere with the final editing result. Meanwhile, removing ORPE causes the generated text t lose the desired reference style; instead, its appearance tends to remain close to the original text. This variant also produces more frequent spatial misalignment, with the rendered text deviating from the target layout. These qualitative degradations demonstrate that progressive curriculum training, robust text erasure, and explicit style-layout disentanglement are all essential for achieving accurate and visually consistent scene text editing.
We propose TextWand, a unified scene text editing framework that introduces ORPE for precise layout-style control and RAS for seamless background reconstruction. Empowered by our custom dataset and progressive curriculum, it achieves state-of-the-art performance across text removal, generation, and replacement without exhaustive engineering optimizations, highlighting its immense scaling potential.
Although TextWand demonstrates strong performance in unified scene text editing, several limitations remain. First, the current framework has not been fully optimized for inference efficiency. Future work can investigate model distillation, quantization, efficient sampling, and lightweight attention designs to accelerate inference. Second, deploying TextWand on resource-constrained devices remains challenging. For mobile-side applications such as on-device poster editing, e-commerce image retouching, and interactive photo editing, it is important to further reduce model size while preserving text legibility, layout fidelity, and reference-style consistency. Adapting the proposed ORPE and RAS mechanisms to smaller generative backbones is therefore a promising direction.