ReFlex: Text-Guided Editing of Real Images in Rectified Flow via Mid-Step Feature Extraction and Attention Adaptation
Jimyeong Kim, Jungwon Park, Yeji Song, Nojun Kwak, Wonjong Rhee, Department of Intelligence, Information & IPAI, Seoul National University {wlaud1001, quoded97, ldynx, nojunk, wrhee}@snu.ac.kr · 2025
Read ReFlex: Text-Guided Editing of Real Images in Rectified Flow via Mid-Step Feature Extraction and Attention Adaptation by Jimyeong Kim, Jungwon Park, Yeji Song, Nojun Kwak, Wonjong Rhee, Department of Intelligence, Information & IPAI, Seoul National University {wlaud1001, quoded97, ldynx, nojunk, wrhee}@snu.ac.kr (2025) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2507-01496.txt.
Introduction
Jimyeong Kim and four co-authors present ReFlex, a training-free way to edit real photos with text inside rectified flow models. Their work appeared in twenty twenty-five. These newer image models beat diffusion on quality, but bending them to edit real pictures has lagged.
The method studies the model's middle layers and finds three features worth keeping. Inverting a photo only halfway preserves its structure while freeing it for change. Attention is then tuned during feature injection, sharpening obedience to the target text. No mask and no source prompt are required. Across two benchmarks and nine rival methods, ReFlex won, and human judges preferred its edits strongly.
Catalog record
| CREATOR | Jimyeong Kim, Jungwon Park, Yeji Song, Nojun Kwak, Wonjong Rhee, Department of Intelligence, Information & IPAI, Seoul National University {wlaud1001, quoded97, ldynx, nojunk, wrhee}@snu.ac.kr |
|---|---|
| YEAR | 2025 |
| COLLECTION | PAPERS |
| FORMAT | TXT |
| FILE SIZE | 49 KB |
| VERSION | 1.0 |
| LICENSE | http://creativecommons.org/licenses/by/4.0/ |
| RIGHTS | CC BY |
| SOURCE | arXiv |
Source: https://arxiv.org/abs/2507-01496
Browse the full library · About the Tower of Babel
Full text
The opening of the work, from the library's hosted text:
ReFlex: Text-Guided Editing of Real Images in Rectified Flow via Mid-Step Feature Extraction and Attention Adaptation Jimyeong Kim, Jungwon Park, Yeji Song, Nojun Kwak, Wonjong Rhee, Department of Intelligence, Information & IPAI, Seoul National University {wlaud1001, quoded97, ldynx, nojunk, wrhee}@snu.ac.kr Abstract Rectified Flow text-to-image models surpass diffusion models in image quality and text alignment, but adapting ReFlow for real-image editing remains challenging. We propose a new real-image editing method for ReFlow by analyzing the intermediate representations of multimodal transformer blocks and identifying three key features. To extract these features from real images with sufficient structural preservation, we leverage mid-step latent, which is inverted only up to the mid-step. We then adapt attention during injection to improve editability and enhance alignment to the target text. Our method is training-free, requires no user-provided mask, and can be applied even without a source prompt. Extensive experiments on two benchmarks with nine baselines demonstrate its superior performance over prior methods, further validated by human evaluations confirming a strong user preference for our approach. Figure 1 : Given a source image and a target prompt, our method can preserve core information of the source image, including structure and background, while adapting high-level attributes in accordance with the target prompt. 1 Introduction The emergence of text-to-image foundation models [ 30 , 33 , 28 ] has not only empowered image generation but also enabled text-guided editing of real images [ 11 , 36 , 4 , 23 , 22 , 13 , 3 , 2 ] . While early methods on text-guided real-image editing were predominantly developed using U-Net based diffusion models (DMs), such as Stable Diffusion [ 30 ] , their effectiveness is often constrained by the inherent performance limitations of DMs, leading to compromised image quality and weaker text alignment in the edited images. Recently, Rectified Flow (ReFlow)-based text-to-image models, such as FLUX [ 17 ] , have demonstrated substantially higher image quality and stronger text alignment than DMs by leveraging flow matching [ 20 , 19 ] and multi-modal diffusion transformer (MM-DiT) [ 8 , 26 ] . However, existing ReFlow-based image editing methods [ 32 , 39 , 7 , 15 ] often struggle with real image editing, particularly in preserving the source structure and handling significant modifications, such as color changes. While techniques developed for DM-based editing methods provide a useful starting point, adapting them to ReFlow models has been challenging. This difficulty arises from the differences in training process and architecture between DMs and ReFlow, meaning that a simple plug-and-play approach cannot be applied. In DM-based editing, feature-based methods have emerged as the most effective and widely adopted approach for image editing [ 11 , 36 , 4 , 25 ] . Within this framework, cross- and self-attention in U-Net have been identified as the key features, encoding text-image relationships and image structural information, respectively [ 11 , 36 ] . However, in ReFlow models, these features are not directly applicable. This is because, unlike U-Net, MM-DiT entangles text and image information within the architecture through joint self-attention [ 32 , 17 ] . As a workaround, previous studies [ 39 , 7 ] have explored the use of value features in MM-DiT, but these approaches often suffer from appearance leakage. As of today, it remains unclear which MM-DiT features can enable effective editing. To address this problem, we conduct a broad investigation of MM-DiT features. Specifically, we decompose MM-DiT’s joint self-attention map into four components based on query–key modality and examine them. Furthermore, we investigate residual and identity features of image embeddings. Through our investigations, we identify three key features of MM-DiT that are effective for real-image editing: two components of the joint self-attention map that are associated with image query and the residual feature. Even after identifying the three key features, another major challenge lies in extracting the features reliably from real images and injecting them into the target image in an effective manner. This process remains highly challenging as it requires inverting the image into the noise and reconstructing it back to its original image [ 11 , 36 , 22 ] . Various inversion methods have been explored in DMs [ 34 , 22 , 13 ] , but they cannot be directly applied to ReFlow due to differences in sampling process. Furthermore, existing ReFlow-based inversion methods [ 32 , 39 , 7 ] often fail to accurately reconstruct the original image. To address these challenges, we introduce a simple yet effective approach, mid-step feature extraction : instead of relying on the reconstruction process that starts from the fully inverted latent, we extract features from the mid-step latent, which is inverted only up to the mid-step. As shown in Fig. 2 , the mid-step latent exhibits significantly higher reconstructability than the fully inverted latent, thereby providing more accurate source information for feature extraction. While the use of mid-step feature in our method is crucial for source structure preservation, this approach also causes a reduction in editability because of its excessive preservation of source information. To counter this effect and recover editability, we introduce adaption techniques that can be effectively applied in the injection step to the two key features that are associated with joint self-attention map. For instance, we strengthen the feature with the query-key modality of image-text. For the third key feature, residual feature, we inject it without any modification. For local editing task, we extract an editing mask from the joint self-attention map and apply latent blending [ 2 ] to mitigate unintended alterations in non-edit regions. Our method, ReFlex ( Re cified Fl ow via Mid-Step Feature Ex traction and Attention Adaptation), uses the state-of-the-art ReFlow-based model FLUX [ 17 ] as its backbone and demonstrates strong performance in real image editing. We compare ReFlex against nine baseline methods, including four FLUX-based and five Stable Diffusion (SD)-based methods, using two widely used benchmarks: PIE-Bench [ 14 ] and Wild-TI2I-Real [ 36 ] . ReFlex achieves text alignment improvements of 1.69% to 7.11% on PIE-Bench and 3.21% to 16.46% on Wild-TI2I-Real. Furthermore, in human evaluation, ReFlex is preferred in 68.2% of cases against four FLUX-based methods, while the second-best method is preferred in only 11.2% of cases. Similarly, in the comparison with four SD-based methods, ReFlex is preferred in 61.0% of cases, with the second-best method preferred in only 11.4% of cases. These results demonstrate the effectiveness of ReFlex in producing high-quality results. Figure 2 : Mid-step feature extraction. The vanilla ReFlow inversion extracts features starting from the fully inverted latent, during the image reconstruction process. In contrast, our method extracts features at the mid-step of the inversion. While ReFlow models struggle with structural preservation in the case of fully inverted latents, our mid-step approach effectively resolves this problem. Figure 3 : Overview of our method, ReFlex: (a) We extract three key features—I2T-CA, I2I-SA, and the residual feature—from a mid-step latent, while the fully inverted latent serves as initial noise for target image generation. To enhance text alignment, we propose two adaptation methods, respectively for two attention maps, (b) I2T-CA and (c) I2I-SA, whereas residual feature is injected without modification. (d) For local editing, we generate an editing mask from the source I2T-CA. This