HarmonyText: Harmonious Scene Text Editing via Reverse-to-Refined Pair Synthesis and Region-Decoupled Frequency Learning

Ziqi Yi, Huiguo He, Guitao Xu, Peirong Zhang, Cheng Da, Xinyao Yu, Zhanpeng Wang, Changqian Yu, Huan Yang, Kun Gai, Lianwen JinarXiv 2026 · arXiv

TL;DR

HarmonyText is a mask-free scene text editing (STE) framework that achieves superior visual realism by decoupling background preservation from text generation. By combining region-aware optimization, frequency-domain texture guidance, and a novel "Reverse-to-Refined" data synthesis pipeline, it eliminates the common pitfalls of color shifts and blurred textures found in existing instruction-following models.

What Problem Does This Paper Address?

Scene Text Editing (STE) is the task of changing text within a natural image (like a street sign or a product label) while keeping the background, lighting, and texture perfectly intact. While recent "mask-free" models allow users to edit images using simple natural language instructions, they face three major hurdles:

  1. Background Degradation: Without explicit masks, models often "hallucinate" changes in unedited regions, leading to noticeable color shifts and loss of original detail.
  2. Texture Smoothing: Standard training objectives (like Mean Squared Error) tend to favor low-frequency information, resulting in edited text that looks blurry or "sticker-like" rather than naturally integrated.
  3. Data Scarcity: There are no massive datasets of "before and after" real-world photos. Researchers usually rely on synthetic "pseudo-ground truth" data, which often contains artifacts that the model then learns to replicate.
Fig. 1. Harmonious scene text editing. Given only a natural-language instruction, HarmonyText edits the target text while preserving its natural integration with the surrounding scene, including local color and texture. In contrast, strong instruction-following editors may produce the correct text but introduce color shifts or texture mismatches. High-quality STE requires text accuracy together with visual harmony between the edited text and the scene.

Methods

The authors propose a multi-pronged approach to ensure "harmony" between the edited text and the original scene:

1. Region-Decoupling Optimization (RDO)

Instead of applying a single loss function to the whole image, RDO identifies which parts of the image are being edited in the latent space. It then "anchors" the non-edited regions to the source image to ensure the background remains unchanged, while supervising the edited region against the target text.

2. Cascaded High-Frequency Texture Guidance (CHFTG)

To combat blurriness, the authors introduce a frequency-aware loss. They use a Discrete Wavelet Transform (DWT) to decompose the image into different frequency bands. By specifically supervising the high-frequency subbands, the model is forced to learn sharp text boundaries and fine-grained surface textures (like the grain of wood or the crinkle of paper).

3. Reverse-to-Refined Pair Synthesis (RePair)

This is a clever data generation trick. Since high-quality paired data is rare, the authors take flawed edits from existing models and treat them as "corrupted" inputs. They train a model to reverse the edit—reconstructing the original real image from the flawed one. This teaches the model how to remove artifacts and restore realism. This "refined" model is then used to generate a high-quality training dataset called STE25K.

Fig. 2. Overview of the proposed HarmonyText framework. (Left) RePair constructs high-quality paired data from unpaired real scene text images. A base editing model first produces flawed edits with color shifts and incoherence. The editing direction is then reversed, treating flawed outputs as corrupted inputs and original real images as clean supervision targets, training the model to reconstruct artifact-free scene text. The resulting pairs are further curated via text verification, region matching, and quality filtering to form STE25K. (Right) Region-Decoupled Optimization (RDO) assigns distinct objectives to edited and non-edited regions: non-edited regions are anchored to the source image for background preservation, while edited regions are supervised against the pseudo-target for accurate text generation. Cascaded High-Frequency Texture Guidance (CHFTG) further applies region-decoupled wavelet constraints across two frequency levels, preserving fine-grained textures and enforcing crisp text strokes.

Datasets

  • STE25K: A new, high-quality dataset of 25,000 paired images generated via the RePair pipeline.
  • HarmonyText-Bench: A benchmark of 155 high-resolution images with diverse styles and challenging backgrounds.
  • Public-STR Generalization Set: 345 images sampled from six public scene text recognition datasets to test real-world performance.
  • H2R (Human Harmony Reference): 80,000 images used to train a Harmony Assessment Model (HAM), a new metric for evaluating how well text blends into its surroundings.

Key Insights and Ideas

  • Learning from Failure: The "aha" moment of the RePair pipeline is that a model can learn more about realism by fixing a bad edit than by trying to generate a perfect one from scratch. Reversing the process provides a clean, real-world target (the original photo) for supervision.
  • Frequency Matters: Most diffusion-based editors struggle with text because text is essentially high-frequency information (sharp edges). Decoupling these frequencies during training is essential for legibility and texture.
  • GT-Free Evaluation: The authors introduce Color Distribution Divergence (CDD). By comparing the color histograms of the original text and the edited text in the CIELAB color space, they can objectively measure color consistency without needing a ground-truth image.

Key Results

HarmonyText consistently outperforms state-of-the-art models like AnyText2 and FireRed-Image-Edit:

  • Background Fidelity: Achieved a 28.44 dB PSNR, outperforming the strongest open-source baseline by 1.65 dB.
  • Color Consistency: Reduced color distribution divergence (CDD) by 19.2% compared to the next best method.
  • Human Preference: In a blinded user study, HarmonyText was preferred over baselines in over 82% of cases, and even beat strong commercial competitors like Nano Banana Pro.

Limitations and Future Work

  • Dependency on Upstream Models: The framework relies on external tools (like PaddleOCR and HiSAM) for text localization and segmentation. Errors in these components can propagate through the pipeline.
  • Complex Layouts: While it handles standard text well, extremely curved, tiny, or low-resolution text remains a challenge.
  • Linguistic Scope: The current evaluation primarily covers Chinese and English. Expanding to a wider variety of languages and scripts is a suggested direction for future research.

Summary updated

Abstract

Natural language-guided, mask-free scene text editing aims to modify text in real-world images using only textual instructions, yet remains challenged by unreliable pseudo-GT supervision, over-smoothed text generation, and the absence of GT-free evaluation. Existing methods often rely on imperfect pseudo-targets with background discrepancies, while standard MSE-based velocity regression tends to suppress high-frequency details, leading to blurred text boundaries and weakened local textures. To address these issues, we propose HarmonyText, a mask-free scene text editing framework with region- and frequency-aware supervision. HarmonyText introduces Region-Decoupling Optimization (RDO), which aligns edited text regions with pseudo-targets while anchoring preserved regions to the source image, and Cascaded High-Frequency Texture Guidance (CHFTG), which applies cascaded wavelet-domain constraints to preserve sharp boundaries and fine-grained textures of textual content. We further propose Reverse-to-Refined Pair Synthesis (RePair) to construct STE25K, a high-quality 25K paired dataset, and introduce a GT-free evaluation protocol with Color Distribution Divergence and a Harmony Assessment Model. Extensive experiments show that HarmonyText outperforms existing methods in text editing accuracy, background fidelity, color consistency, and perceptual harmony.
BibTeX
@misc{yi2026harmonytext,
  author = {Ziqi Yi and Huiguo He and Guitao Xu and Peirong Zhang and Cheng Da and Xinyao Yu and Zhanpeng Wang and Changqian Yu and Huan Yang and Kun Gai and Lianwen Jin},
  title = {{HarmonyText: Harmonious Scene Text Editing via Reverse-to-Refined Pair Synthesis and Region-Decoupled Frequency Learning}},
  year = {2026},
  eprint = {2611.17733},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.17733},
}
Figure