Manuscript Offprint

arXiv:2611.04303

FlowTranslator: Training-Free In-Image Machine Translation with Flow-Based Editing

Zhixian Li, Xingsong Ye, Yongkun Du, Yunyan Xiao, Yanglin Huang, Pinxuan Chen, Jiyu Zhuang, Cong Xu, Zhineng Chen

Abstract

In-image machine translation (IIMT) replaces text in an image with its translation while preserving the surrounding visual context. Existing task-specific models achieve convincing performance but require massive paired training images before and after translation. As advanced text-to-image (T2I) models have reached a practically usable level of multilingual text generation, we argue that this capability can be transferred to IIMT and present FlowTranslator. It is a training-free IIMT framework that first employs an OCR model and an LLM to generate the translation prompt, which is injected into the T2I-based diffusion model. To optimize the accurate and natural generation of translated text, we introduce two trajectory controls: Region Coupling Release (RCR) partially decorrelates target-branch noise inside the text region early in the trajectory, while Coupling Expansion (CE) amplifies the emerging edit displacement mid-trajectory. Under the EasyOCR read-back protocol, FlowTranslator achieves average PRIM BLEU and COMET scores of 20.6 and 57.2, respectively, substantially outperforming the strong training-based baseline UniTranslator. On the more challenging and realistic whole-image ScenePair photographs translated into Chinese, it reaches 40.1% exact-match accuracy and surpasses existing editing systems, some of which only address the text-rendering stage rather than the complete IIMT task. These results establish flow-based editing as a strong, fully training-free baseline for IIMT.

Correspondence: zhinchen@fudan.edu.cn

1 Introduction

In-image machine translation (IIMT) translates the text embedded in an image and renders the translation back into the original text regions while keeping the rest of the image intact [15, 19]. The task underpins applications from mobile photo translation to localizing signage and product imagery, and has attracted dedicated benchmarks and models [18, 26, 27]. A dominant line of work approaches IIMT with a cascaded pipeline: an OCR model localizes and reads the source text, a translation model converts it, and a rendering module writes the translation back into the image [14, 47]. With the rapid advance of OCR and machine translation, the remaining bottleneck for this task is the rendering step.

Early rendering systems erase the source glyphs and paste separately rendered text, a procedure that leaves visible seams, mismatched typography, and destroyed textures. Subsequent work replaces the paste step with

Figure

Figure 1 Overview of the IIMT framework and editor paradigms. (a) The pipeline: OCR extracts text → a translator produces the translation → a scene text editor generates the output image. (b) Rule-based: remove, render, and paste separately. (c) Training-based: a learned GAN or diffusion editor (requires extra training). (d) FlowTranslator (ours): training-free flow editing with trajectory controls (CE and RCR) for text translation with background preservation.

a learned scene-text-editing (STE) generator, first GAN-based [23, 32] and then diffusion-based [3, 28, 36], trained to blend the translated glyphs into the surrounding texture. However, these generators need paired images for training. Such cross-lingual pairs are scarce beyond a handful of high-resource directions, so training pipelines fall back on synthetically rendered text [26], which narrows the fonts, layouts, and backgrounds the generator ever sees and leaves the fragile rendering step as the bottleneck of the cascade.

Text-to-image (T2I) generation has meanwhile progressed to a point where multilingual text rendering is usable in practice: recent flow-matching backbones render legible non-Latin and CJK (Chinese-Japanese-Korean) text directly from a caption [41]. This raises a natural question. Rather than training another dedicated STE generator on scarce cross-lingual pairs, can a frozen T2I model be repurposed, with no task-specific training, to perform the rendering step of an IIMT cascade?

Inversion-free flow editing offers exactly this machinery. FlowEdit [12] edits a real image with a frozen T2I flow model by integrating an ODE between a source-conditioned branch and a target-conditioned branch, and TextFlow [16] shows that such training-free editing can match trained scene-text editors in visual quality. Both operate on a single word or crop given a user-provided target string. Neither addresses the full IIMT problem of localizing, translating, and re-rendering every text region in an image automatically.

Therefore, we propose FlowTranslator, a novel IIMT system that requires no task-specific training. Every module is a frozen, publicly documented pretrained model, and no parameter is updated or fine-tuned for IIMT (the components themselves are, of course, products of large-scale pretraining). FlowTranslator keeps the modularity of a cascade. A general OCR model [4] finds text blocks, and a frozen LLM translates them. The pipeline replaces the training-based rendering stage with region-masked flow editing on a frozen T2I model [41]. The translation is generated into the original image rather than pasted onto it, so the diffusion prior handles perspective, lighting, and typography.

Making this transfer work requires solving a problem specific to cross-lingual, mask-confined editing: an ignition failure of the underlying flow editor. The FlowEdit update is driven by the velocity difference between the source-conditioned and target-conditioned branches, which share the same noise. The difference is meant to grow as the caption change propagates a semantic edit. FlowEdit is demonstrated on edits, such as swapping an object or changing a global style, that alter a substantial fraction of the image and so produce an early, sizeable velocity difference. IIMT edits invert this premise. The text region is typically a small minority of the frame, so the two branches barely differ at the outset and the edit never starts, no matter how the difference is subsequently amplified. This text-minority regime is intrinsic to cross-lingual scene-text editing rather than an artifact of our implementation, so a generic remedy such as increasing the velocity gain cannot repair it: there is no signal left to amplify. We introduce two trajectory controls confined to the text-region mask to force ignition: Region Coupling Release (RCR) replaces the target-branch noise inside the mask with a partially decorrelated sample early in the trajectory, giving the target branch room to diverge. Coupling Expansion (CE) amplifies the nascent edit displacement mid-phase, letting the target branch complete the edit it has started. Both add no forward passes and contribute zero latent update outside the mask.

We evaluate FlowTranslator on three benchmarks spanning synthetic and real imagery, seven languages, and nine translation directions. It achieves the highest average BLEU on Translatotron-V(ision) [15] and the highest average BLEU and COMET on PRIM [26] without any IIMT training data. On ScenePair photographs translated into Chinese [23], FlowTranslator reaches 40.1% exact-match accuracy and outperforms six released editing systems under a common evaluator. These results establish FlowTranslator as a strong training-free baseline across diverse IIMT settings.

In summary, our main contributions are:

  • We repurpose a frozen, training-free text-to-image flow model to replace the training-based rendering stage of IIMT cascades and remove its dependence on scarce cross-lingual training pairs.

  • We identify an edit-ignition failure of coupled flow editing and propose two mask-confined trajectory controls (RCR and CE) without additional forward passes to resolve it.

  • We report results on TTV, PRIM, and ScenePair competitive with trained systems, establishing a strong training-free baseline for IIMT.

References (46)