ReFocusEraser: Refocusing for Small Object Removal with Robust Context-Shadow Repair
Authors: Qingping Zheng
Bo Huang
Yang Liu
Haoyu Zhao
Ling Zheng
Zengmao Wang
Ying Li
Jiankang Deng
Venue: ICLR 2026 Poster (2026)
Keywords: Diffusion-based Object Removal， Image Inpainting
Primary area: applications to computer vision, audio, language, and other modalities

Abstract: Existing diffusion-based object removal and inpainting methods often fail to recover the fine structural and textural details of small objects. This is primarily due to the VAE encoder’s downsampling, which inevitably compresses small masked regions and causes significant detail loss, while the decoder’s upsampling alone cannot fully restore the lost fine details.
However, the adverse effects of this fixed compression can be mitigated by enlarging the perspective of these regions.
To this end, we propose ReFocusEraser, a two-stage framework for small object removal that combines camera-adaptive zoom-in inpainting with robust context- and shadow-aware repair. In Stage I, a camera-adaptive refocus mechanism magnifies masked regions, and a LoRA-tuned diffusion model ensures precise semantic alignment for accurate reconstruction. However, reintegrating these magnified inpainted regions into the original image introduces challenges due to VAE asymmetry, such as color shifts and seams. Stage II addresses these issues by fine-tuning an additional decoder to create a seam- and shadow-aware module that eliminates residual artifacts while preserving background consistency. 
Extensive experiments demonstrate that our proposed RefocusEraser achieves state-of-the-art performance, outperforming existing methods across benchmark datasets. 
Related code and data are available at https://github.com/ProAirVerse/ReFocusEraser.git.

REFOCUSERASER: REFOCUSING FOR SMALL OBJECT REMOVAL WITH ROBUST CONTEXT-SHADOW REPAIR
Qingping Zheng .2,- Bo Huang
Yang Liu
Haoyu Zhao Jiankang Deng
Ling Zheng
Zengmao Wang'
Ying Li
'Shool of Informatics, Xiamen University
Key Laboratory of Multimedia Trusted Perception and Efficient Computing,
Ministry Education of China, Xiamen University
School of Computer Science, Northwestern Polytechnical University
DDparrmeett of Engineering. King's College London
6 Institttee of Trustworthy Embodied AI, Fudan University
FFujian Maternal and Child Health Hospital, Fujian, China
Schooo of Computer Science, Wuhan University MMVP Lab, Imperial College London
zhengqi i ng@ xmu. edu on yang 15. www.kcl..accc.cc uk
bohuangêma ill nwpu. edu, on hyzhao226m fudan. edu. on warggzengma@@whu edu, on j (eleggeeimmereee
zhenglinge jssy com lybypenwpu. enu.en
uk
ABSTRACT
Existing diffusion-basee object removal and inpainting methods often fail to re- cover the fine structural and textural details of small objects. This is primarily due the VAE encoder's s downsampling, which inevitably compresses small masked regions and causes significant detail loss, while the decoder's upsampling alone cannot fully restore the lost fine details. However, the adverse effects of this fixed compression can be mitigated by enlarging the perspective of these regions. To this end, we propose ReFocusEraser, a two-stage framework for small object re- moval that combines cumera-adaptiin zoom in inpainting with robust context- and shadow-aware repair. In Stage a camera-adaptive refocus mechanism magni- fies masked regions, and LoRA-tuned diffusion model ensures precise semantic alignment for accurate reconstruction. However, reintegrating these magnified in- painted regions into the original image introduces challenges due VAE asymme- try, such as color shifts and seams. Stage II addresses these issues by fine-tuning an additional decoder create seam- and shadow-aware module that elimi- nates residual artifacts while preserving background consistency. Extensive ex- periments demonstrate that our proposed ReFoocusEraser achieves state-of-the-art performance, outperforming existing methods across benchmark datasets. Related code and data are available at wttp://twwwbbcoo//ooo/o/eeeeeeee
INTRODUCTION
Image object removal seeks fill user-specified regions with content that is both visually and seman- tically consistent Berrallioo et al.] (2000). While diffusion- methods Xie et al. (2023) achieve state-of-the-art results, producing realistic and coherent restorations, they often favor generating new objects over completing backgrounds. To address this, recent approaches introduce explicit guidance to better align generated content with intended semantics and maintain visual coherence, including sampling known pixels during reverse diffusion Lugmayr et al. (2022), leveraging Alpha- CLIP Sun et al. (2024) embeddings to prioritize background regions Ekin et al. (2024), employing task and negative prompts for controllable inpainting /Zhuang et al. (2024), separating foreground and background embeddings Xu et al. (2025), or incorporating both foreground and background images independent guidance signals Wei al. (2025).
"Equal Contribution. Correspondence Qingping Zheng (zhenggingping@@ wwtpappiin@xxuu.uuumm xmm..du.cc)

---

(a) Input Image
(b) YAK Reconstruet
(c) Inpaint Result
FX
Input Image
2x
Camena Control
3X
Mask
Figure Illustration of camera-adaptive refocus. Far-field regions are zoomed in near-field views, enlarging small masked objects and preserving details during inpainting. 'FL' is focal length.
However, existing diffusion-based object removal methods struggle to accurately restore fine struc- tural and textural details of small unwanted objects. This limitation primarily arises from the down- sampling layers in the VAE encoder of these generative models |Peebles & Xie (2023a); Esser et al. (2024), which inherently cause information loss. Specifically, under fixed VAE compression rate, large masked objects can retain most of their structure, whereas small masked objects suffer from severe detail loss Rombach et al. (2022). This effect is evident in Figure Ib), where high-frequency details of small objects are largely discarded during encoding, leading to noticeably degraded re- construction quality. Although finetuning the entire VAE can mitigate this issue, comes a high computational cost, requires large-scar scgle-scaeeaae training data, and is prone to unstable optimization that may incur posterior collapse Lucas et al. (2019), ultimately reducing the diversity of generated outputs.
Intuitively, increasing the input resolution can alleviate this problem Wu et al. (2025). Motivated by camera zoom mechanisms in real-world photography, far-field views can be transformed into near- field perspectives through focal length adjustment, effectively bringing distant subjects closer and making them appear larger. Following this principle, we can simulate zoomed-in views to refocus the image, enlarging small masked objects and enhancing detail preservation prior to inpainting. As demonstrated in Figure [T] this camera- adaative refocus strategy yields substantial improvements in reconstruction quality for small regions. Since this process improves inpainting quality only within the magnified region, the result must be zoomed out and pasted back into the original image. How- ever, this step is challenging: the inherent asymmetry between VAE downsampling and upsampling often introduces color shifts Wang et al. (2025). leading to visible seam artifacts.
In this paper, we propose ReFocusEraser framework for small masked object removal with robust context and shadow repair. Given an image with user-defined mask, we first transform far-ffeld regions into near-field perspectives using a camera calibration algorithm Veicht al. (2024) avoid distortion. Then, we introduce LoRA to fine-tune the FLUX. I-de''s diffusion transformer Black- Forest-Labs (202)) by minimizing the reconstruction loss of the enlarged masked object, improving semantic alignment between the inpainted region and its surrounding context. To maintain back- ground consistency completely, we adopt mask-based stitching to paste the zoomed-out inpainted region back into the original masked image. However, this approach can introduce color discrepan- cics and fails to remove shadows of small objects that are not explicitly masked. To address these issues, we keep the FLUX. Idee encoder unchanged and fine-tune additional decoder create a seam- and shadow-awar decoder. This enables seamless integration of the inpainted region and automatic shadow correction before reintegration into the original masked image. In summary, our main contributions are as follows:
We introduce a Camera- Adaptive Refocus Inpainter which enlarges small masked objects via simulated near-field perspectives and improves semantic consistency by fine-tuning the diffusion model with LoRA on the enlarged regions.
We develop Seam- and Shadow-Aware Repair that seamlessly integrates inpainted regions and automatically corrects shadows of small objects while using a mask-bases stitching strategy to robustly preserve background context.
2

---

We propose ReFocusEraser, two-stage framework for both small and large object moval, surpassing prior state-of-thh-ar methods (PSNR/SSIM/FID: 31.26/0.924/21.33 vs. 24.06/0.656/25.39 for AttentiveEraser and 25.03/0.794/65..2 for Flux-Filll.
2 RELATED WORK
Image Inpainting. Image inpainting aims to restore missing or corrupted regions with visually and semantically coherent content. Traditional methods Criminisi al. (2004); Zhang et al. (2018a);
Barnes et al. (2009) based on texture symthesis or patch matching often fail in complex scenes duc to limited structural and global reasoning. GAN-based approaches Zhao et (2021 et (2022);
Suvorov et al. (2022) improve realism via learned priors but suffer from artifacts and unstable train- ing. Diffusion- based inpainting has recently emerged as powerful alternative due its strong generative capacity and controllability. Early works Avrahami et al. (2023); Yang et al. (2023); Zhang et al. (2023); ; Lugmayr et al. (2022); [iu et al. (2023); Corneanu al. (2024) sample masked regions using pre-trained text-to-image models, achieving impressive results but often lacking se- mantic alignment in complex scenes. To improve structure and content awareness, later methods fine-tune diffusion models with explicit mask conditioning in latent space.
Coss--onddtioeed Diffusion Inpainting. To mitigate this limitation, diffusion-basee inpainting methods typically require explicit guidance (e.g. prompts, structural cues, contextual priors) to maintain semantic accuracy and visual consistency. For instance, RePaint Lugmayr et al. (2022)
guides generation with masked input, sampling known pixels during reverse diffusion improve semantic consistency using the DDPM [Song et al. (2020) prior. CLIPAway [Ekin et al. (2024) uses AlphaCLIP (Sun al. (2024) embeddings separate foreground and background, prioritizing the background to enhance inpainting quality and reduce object ballucination. PowerPaint Zhuang et al. (2024) uses task-specific prompts, including negative prompts and controllable shape-fitting, to per- form object removal while maintaining semantic consistency across tasks. PixelHacker Xu et al. (225)) modifies latent diffusion by using separate embeddings for foreground and background fea- tures. OmniEraser Wei et al. (2025) leverages both the foreground object and background images as independent guidance signals, enhancing the model's contextual understanding.
METHODOLOGY
3.1
OVERALL FRAMEWORK
Preliminaries. Given an input image x and a user-defined mask m, object removal aims to re- store the masked regions & with content that is semantically aligned and color-consistet with the surrounding background. Our framework builds upon WLUX.1-dde [Black- DiT-hased Peebless & Xie (2023b) diffusion model with strong generative capacity. In the forward diffusion process, Gaussian noise is progressively added to a clean image & to obtain a noisy sample 2, at timestep æ; = Va,, ( & + VI ōGE, (N, I), where at denotes the diffusion noise schedule and c is standard Gaussian noise. In the reverse process, a DiT network predicts the noise 6 at each timestep, enabling image reconstruction through iterative denoising. The model is trained with the flow- wwwchinthig objective:
(2024), a
dei
Cftow = E.zp,t..,bb b(t) co t) b(t) = dt
(1)
To enable object removal, we extend the DIT input layer eg accept the masked foreground x m, the visible background æ @ (1 m), the binary mask m, and the noisy latent Fy. These inputs are concatenated and projected through learnable linear layer, providing explicit bjckk-bba guidance for denoising. Following Wei et al. (2025). the training objective becomes:
foow F. b(1)21kc - <x y;
where y (m. Do O m. Bg @ (1 m)) denotes the conditioning input. This design improves the model's understanding of both masked regions and surrounding context, thereby enhancing back- ground consistency and reducing artifact generation.
3

---

Stage-l: Camero-Adpative Refocus Inpainter
Stage-I: I: Loss
Noise
Mask
Input Pripare
Bg
Envoder
Food Forme
Camere LameeeLLRR.AA
Da Lokk
Decoler
Flux. dee
Inpuint
Zoomtin x
GT
Mask:
not
Image
Stuge-I::
Ropuir
Stage II: Loss
stschf.tthiining sttching
Repair:: Roasck
Stadow Aawn--wwzre Aware
Drooki
Enccuder
Ispaint Fg.
Mask:m
Inpaint:
Color +
Shadow Loes
Resalt:
Amaac
Image Hg
Im
Image:
Figure 2: Pipeline of ReFocusEraser, including: (1) Stage-I, Camera-Adaptive Refocus Inpainter enlarges small masked objects via simulated near-field perspectives and improves semantic consis- tency through LoRA fine-tuning the enlarged regions, and (2) Stage-IL II, Seam- and Shadow-Aware Repair accepts the zoomed-in image from mask-hased stitching and fine-tunes Flux. 1 -dde decoder seamlessly integrate inpainted regions and corrects small-object shadows automatically.
Overview of ReFocusEraser. While explicit guidance can improve object removal, the fixed com- pression rate of the VAE encoder imposes an inherent bottleneck for small object restoration, caus- ing high-frequency details to be lost during downsampling Rombach et al. (2022). To address this challenge, we propose ReFocusEraser, two-stage diffusion-basee framework specifically designed for small masked objects. It combines adaera-e refocusing enlarge small objects, LoRA- based fine-tuning of the diffusion model to enhance semantic alignment, and a seam- and shadow- aware decoder with mask-based stitching preserve background consistency and automatically correct shadows. This design enables detail-preserving, artifact-free removal of small objects while maintaining visually and semantically coherent inpainting results (Figure
3.2
CAMERA-ADAPTIVE REFOCUS INPAINTER
Camera-Adaptive Refocus Mechanism. Since the sizes of target objects vary across input im- ages applying fixed crop or zoom often fails to preserve small masked objects. To address this, we introduce camera-adaptie refocus strategy that dynamically enlarges small masked objects, producing a camera-adaptive input af and mask m that better preserves fine details during inpaint- ing. Concretely, we first estimate the focal length the input image æ using a camera calibration algorithm Veicht al. (2024) and classify the scene as far-field near-field. Based empirical observation, we set 500 pixels as the focal length threshold, and images with focal lengths below this considered far-field scenes. Far-field scenes typically correspond to large field of view, where masked objects are relatively small. Directly compressing such images through the VAE leads to severe information loss. To mitigate this, apply cemeer--onniiiooed zoom-in to bring the scene closer and relatively enlarge small masked objects. Details are in Appendix A
LoRA for DiT-Based Refocus Inpainter. To improve inpainting of small or distant objects, we replace the original image with the camera-adaptive zoomed input x and apply Low-Rank Adap- tation (LoRA) Hu et al. (2022) to the gencral-purpose Flux- I.dev. The low-rank adapters are injected into all linear layers the DIT backbone, including self-attention and feedforward blocks. For- mally, for linear layer with weight matrix W Radu Xhe and input feature X E ddd derived from camera-adaptive zooming, the adapted output WLORAX = WX+ + & BAX, where
IR and B e Xr are trainable low-rank matrices, r & minndmm. dra) the rank, and a is a scaling fac- tor. This enables the model to effectively leverage zoom-adaptive features throughout the generative
4

---

process by minimizing the flow-based loss:
flow Eagier See, b(t) co ;
where y = Im. : 0 @ m T6 @ (1 m Unlike the inpainting-specialized Flux-Fill Black- Forest-Labs (2024) and Flux- Kontext BBttffll al. (225), applying LoRA to the general-purpose Flux-1.dev preserves pre-trained parameters while enhancing cross-task transferabiliity
3.3 SEAM- AND SHADOW-AWARE REPAIR
Mask-based Stitching Strategy. To reintegrate the inpainted patch & into the original image æ, we consider two stitching strategies (see visual comparison in Appendix B.. A straightforward op- tion is box-based stitching, which scales and pastes the inpainted patch back into the original image: box S) While this strategy preserves the full patch structure, it often introduces bound- ary misalignment and visible seams. In contrast, mask-based stitching pastes only the inpainted masked region: x mask ing context unchanged. Despite minor color inconsistencies near the mask boundary, bask-based stitching ensures better spatial alignment and semantic coherence, making the preferred strategy in our framework. Notably, mask-based stitching camnot remove shadows cast by the unwanted object, which may degrade inpainting quality introduce spatial inconsistencies.
S((1 m²) @ x m + i²)), thereby maintaining the surround-
Seam- and Shadow-Aware Repair. To correct color shifts and automatically remove shadows introduced by mask-based stitching, we propose a Seam- and Shadow-Aware Repair stage that leverages the strong reconstruction capability of the FLUX.I-dev VAE [lack-Forestt-aate (2024) to restore contextual consistency. This is achieved by fine-tuning only the decoder, as fine-tuning the entire VAE often results in severe catastrophic forgetting of the pretrained reconstruction prior. Addressing this issue would require substantially larger training datasets, longer optimization sched- ules, and significantly higher computational costs Otani (2025), which are impractical given our current data volume and computational resources. By fine-tuning only the decoder, we maximally leverage the pretrained FI.UX. 1-dev VAE's reconstruction abilities, reduce model complexity, and enable Slage-Il to focus exclusively on correcting color shifts and shadow artifacts without dis- rupting the global scene representation learned Stage-I. Let a' denote the inpainted result from Stage-I, and the mask-stitched input be:
maask (1 (1) m²)
x m. O a..
(4)
We initialize the Stage-Il decoder D from the Stage-I decoder and fine-tune it specifically correct color discrepancies and mitigate shadow artifacts at mask boundaries.
Since finetuning VAE with L1 or L2 reconstruction losses often produces blurry outputs. particularly for small or distant objects. This is because downscaling and encoding compresses fine-grained information in the latent space, causing the decoder to lose high-frequency details such as edges, textures, and shadows Roabacs et al. (2022). When the encoder is frozen, the decoder cannot rely on updated latent representations to recover lost details, making simple L1/L2 supervision insufficient.
Color-Shadow Consistency Loss. To effectively fine-tune the Stage-II decoder, we introduce color-shadow consistency loss Leotor shadow that separately supervises the inpainted foreground and surrounding background. Specifically, an L, loss is applied to the masked foreground to maintain pixel-level color consistency, while LPIPS Zhang et al. (2088)) is applied to the unmasked back- ground to preserve high- fighueryy details, including shadows. Formally, the loss defined as
Sholor_shadow = E || Lf + E LPIPS( #5eg)
(5)
where 2ig and 2ig denote the masked foreground and background regions from the mask-based stitching a respectively. This region-aware perceptual supervision enables the decoder to restore fine object structures while maintaining realistic and consistent background. Finally, the refined inpainted region is mapped back to the original image through a camera- aligned transformation, ensuring seamless spatial and color consistency in the final output.
5

---

4 EXPERIMENTS
4.1 EXPERIMENTAL SETUPS
Datasets. We train our models on 12,757 high-resolution image pairs from the Real-world Ob- ject Removal Dataset (RORD) SSagong et al. (2022), where each input consists of an image and corresponding mask indicating the unwanted object, and evaluate on 1,542 RORD validation pairs as well as the real-world benchmark RemovalBench Wei et al. (2025), ensuring both controlled and in-the-wild performance assessments. See Appendix for data collection and preprocessing details.
Evaluation Metries. We evaluate method from two complementary perspectives: (1) overall image quality, assessed by FID Heusel et al. (2017) and CMMD Jayasumana et al. (2024), which capture distributional alignment and semantic similarity ground truth; and (2) region-leve fidelity, measured by PSNR Hore & Ziou 2010), SSIM Wang et al. (2004). and LPIPS /Zhng et al. (2018h), which reflect pixel accuracy and perceptual consistency. To ensure fair comparison, all evaluation metrics are computed on the full image after reinserting the zoomed-in inpainted patch.
Implementation Details. Our framework is built on the general-purpose FLUX. and trained in two stages. In Stage I, we apply LoRA as a plug-and-plas adaptation, trained with rank 32, learning rate of 3e-5, and batch size for 20 epochs on 4 NVIDIA H200 GPUs (= days). In Stage II, we fine-tune dedicated VAE decoder to correct color and shadow inconsistencies, while reusing the pretrained encoder from FLUX.1 1 -evv. The decoder is optimized with learning rate of le-4 and batch size 4 for up to 80K steps on 8 H200 GPUs ( 1.5 days).
Baseline and Comparisons. We adopt OmniEraser Wei et al. (2025) as our baseline and train it on the RORD dataset. To demonstrate the superiority of our proposed method, we compare it with state-of- oh-thh-art diffusion- based approaches for both general inpainting [RePaint[Lugman
et al.
(022),, PixelHacker Xu et al. (2025), Flux-Knotext Batifol et al. (2025), Flux-Fill Black-FFrress
Labs (2024) and object removal (AttentiveEEraser [Snn et al. (2025), CLIPAway Ekin et al. (002)),
PowerPaint /Zhung al. (2024), OmniEraser Wei al. (2025) ). All results are evaluated using
their official implementations and default settings to ensure a fair and consistent comparison.
4.2 COMPARISON WITH DTATE-OF-THE-AR
reports our method's improvements over state-of-the-art ap- proaches in overall image quality and region-level fidelity. 1) For region-level fidelity, Flux-Fill, which takes a text description and binary mask, achieves the prior best results (PSNR 25.025, SSIM 0. 0.794, LPIPS 0.092) on RORD-val for small-object removal. Compared this, our ReFocusEraser substantially improves reconstruction quality, raising PSNR to 31.256 (+6.231), SSIM to 0.924 (+0. 13), and lowering LPIPS 0.04I (-0.051). Similarly, RemovalBennch for normal-object re- moval, AttentiveFiraser outperforms previous methods, whereas ReFocusFraser further surpasses it, achieving PSNR 30.495, SSIM 0.841, and LPIPS 0.223, compared to 25.365, 0.751, and 0.284, re- spectively. 2) For overall image quality, AttentiveEraser achieves the previous best results on both RORD and RemovalBench. Our ReFocusEraser further improves performance, achieving lower FID and CMMD scores on both benchmarks (e.g., FID 25.393 + 21.378 and CMMD 0.276 - 0.263 on RORD, FID 65.326 - 38.115 and CMMD 0.169 - 0.117 on RemovalBench). These results show that our method excels at maintaining detail and semantic consistency across diverse scenes.
Quantitative Comparisons.
Qualitative Comparisons. Figure visually compares our method with prior methods, highlight- ing its superior object removal and region repair. From the visual results in columns (b)-(e), general inpainting methods struggle with object removal; even when Flux- Kontext and Flux-Fill succeed, they often fail to restore the removed regions consistently with the background (see green boxes in the first row). From the results in columns (f)((i, early specialized removal methods such as Power- Paint and CLIPAway fail effectively remove and repair target regions. While AttentiveEraser and

---

Table 1: Quantitative comparison of our ReFocusEraser with state-of-hhe-arts.
Method
RORD-val
Sagong al.
2022]
RemovalBench Wei et al. (205 (2025
PSNR1
SSIM
LPPSS]
FID
CMMDL
SSIM
I.PISS]
FID]
CMMD)
Repain[L_gmayer Lugmayr et al.
Repaint
2022
15.250
0.330
0.787
144.120
1.011
20.747
0.705
0.564
155.695
0.548
PixelHacker
2025
0.530
0.340
0.499
22.058
0.25
143.315
0.483
CLIPAway Ei al
2024
21.916
0.511
0.333
61,670
0.535
22.076
0.721
0.412
140.610
0.404
PowerPainn Zuuagg ci
2224
23,229
0.619
0.176
42.519
0.301
23.228
0.732
0.323
143,619
0.463
OmnilIraser
2025
22.380
0.562
0.226
47.765
0.293
24.624
0.728
0.291
66.871
0.324
Flux-Knotes
Bainlol et s..
2125
13,522
0.251
0.628
127.330
0,824
22.234
0.679
0.317
88.768
0.191
65:215
0.297
Attentive
Sun al.
112.5
24.064
0.656
0.145
25. 393
0.276
25,265
0.751
0.284
65.326
0.169
Our ReFocustrasser
31.256
0.924
0.041
21.378
0.263
30,495
0.841
0.223
38.115
0.117
Mack & Iinage
lu BePhist
16 Reo-Kectec
be Fis-Fill
Ig) Prweehiist Oi) taetioofreee Fersirroe
Das
Figure Qualitative comparison of our method with state-of-the-arts on both the RORD- val (top three rows) and RemovalBench (bottom two rows), including general inpainting methods (b) RePaint, (c) PixelHacker, (d) Flux-Fill, (e) Flux-Knotext and specialized object removals (f) CLIPAway, PowerPaint, (h) AttentiveEraser, (i) OmniEraser, and our ReFocusEraser.
OmniEraser can remove objects. they often fail to consistently repair the background. As highlighted by the yellow boxes column (i), OmniEraser removes the foreground but disrupts background con- sistency. AttentiveErasee preserves background consistency but leaves object shadows. In contrast, our ReFocusEraser consistently removes objects while maintaining structural and semantic consis- tency.
4.3 ANALYSIS OF BASELINE IMPROVEMENTS
Table 2 and Figure summarize the improvements from our proposed components: Camera- Adaptive Refocus (CAR), mask-based stitching, and Seam- and Shadow-Aware Repair. As high- lighted by the yellow boxes in columns (a) and (c) of Figure 4 the bascline trained via LoRA on the original images can remove unwanted objects but often disrupts background consistency due to asymmetry between the VAE encoder and decoder. Incorporating the CAR mechanism substantially improves performance: compared to (a) in Table 2 (b) raises PSNR by 7.399 and SSIM by 0.297, while lowering LPIPS, FID, and CMMD by 0.277. 15.999, and 0.218, respectively. Mask-based stitching reduces the severe color shifts box-based stitching and further improves region- fi- delity (PSNR +0.65, SSIM +0.009, LPIPS -0.007). although FID and CMMD slightly degrade due to remaining shadows. As shown Figures 4 (d), introducing the Seam- and Shadow- Aware Repair effectively corrects color seams while automatically removing object shadows.
7

---

Table Quantitative evaluation against baseline. 'CAR' denotes the Camera-Adaptive Refocus
mechanism. "maak" and "Soon" refer to mask-based and box-based stitching strategies. (a) is the baseline trained on original images, while (b)-(d) are trained on 3x zoomed-in in images.
Configuration
Capabilities
RORD-val Sagong et al. (2022)
Exp.
LoRA
Stitch
Decoder
Seam
Shadow
Color Shift
PSNR1
SSIM
LPIPS]
FID
CMMDL
(a)
N
N
23.683
0.626
0.323
40.287
0.476
(b)
CAR
Shaz
X
Y
Y
31.082
0.923
0.046
24.288
0.258
(c)
CAR
S Smork
Y
Y
Y
31,732
0.932
0,039
25,036
0.272
(d)
monk
N
N
31.256
0.924
0.041
21.378
0.263
Mask Image
(6) Baseline
(b) Stage-1 w/ Sea
(c) Stage-I w/ Sea
(d) Syaa w: Dess
(e) GT
Figure 4: Visual comparison against baselines. (a) Baseline: trained original images; (b)
Stage-I w/ Sbor: trained on 3x images, patch reintegrated via box-based stitching; (c) Stage-I w/ Smask: trained on 3x images, patch reintegrated via mask-based stitching. Stage-Il Seam- and Shadow-Aware Decoder, added on top of (c) to repair seam and shadow.
(d) Smask w/ D Daskk:
4.4 ABLATION STUDIES
We perform ablations on ReFocusEraser, analyzing the Camera-Adaptive Refocus Inpainter, stitch- ing strategies, and loss functions for Seam- and Shadow-Aware Repair.
Effect of Camera-Adaptive Refocus Inpainter under Different Focal Lengths. Table shows that increasing focal length consistently improves inpainting performance. Compared to 1x, train- ing at 2x improves PSNR by 2.856 and SSIM by 0.198, while reducing LPIPS by 0. 0.184, FID by 20.69, and CMMD by 0.43. Extending to 3x yields further gains, with PSNR +5.891, SSIM +0. 20.265,
8

---

Table
Performance on camera-adaptive refocus inpainter under various focal lengths.
RORD-val Sagong et al.
2022
#Focal Length
PSNR
SSIM
LPIPS L
FID L
CMMD 1
1x
23.683
0.626
0.323
40.287
0,476
2x
26.539 (+2.856)
0.824 (+0. 198)
0.139 (-0.184)
19,597 (-20.690)
0,046 (-0.43)
3x
29.574 (+5.891)
0.891 (+0.265)
0.096 (-0.227)
13.283 (-27.004)
0.026 (-0.45)
Mask & Image
x FL.
2 FL
3 FL
GT
Figure 5: Visual comparison of camera-adaptive refocus inpainter under various focal lengths.
and reductions of 0.227, 27.004, and 0.45 in LPIPS, FID, and CMMD, respectively. Visual results in [igure[]]yyllovv boxes) confirm that higher focal lengths recover finer semantic details. This im- provement arises because, under the fixed compression ratio of the inpainting network, increasing the focal length allows the model to perceive finer details, effectively providing more suitable com- pression of the input image. Training at 3x yields the best trade-off, highlighting the effectiveness of Camera-Adaptive Refocus in improving both perceptual quality and reconstruction fidelity.
Mask-based vs. Box-based Stitching Meth- ods. Table 3 compares mask- and box-based stitching for reinserting zoomed-in inpainted patches into the original image using the in- verse camera calibration algorithm Veicht et al.
(2024). Mask-based stitching consistently improves region-level fidelity over box-based stitching, achieving higher PSNR and SSIM and lower L.PPS at both 2x (PSNR +0.66, SSIM +0.012, LPIPS -0.013) and 3x (PSNR +0.65, SSIM +0.009, LPIPS -0.007). For over- all image quality. CMMD comparable (0.279 vs. 0.270 at 2x, 0.272 vs. 0.258 at 3x), though FID slightly higher (13.041 vs. 8.458 at 2x; 25.036 vs. 24.288 at 3x) due to shadow incon- sistencies during mask-based reinsertion. As shown in Figure 6 (a) and (c), smaller focal lengths in Itage-I produce more noticeable box seams. In contrast, mask-based stitching intro- duces seam artifacts only along object bound- aries, which are fixed, primarily affecting de- tails within the masked region (see Figure 6) (b) and (d)). These results suggest that mask-based stitching better preserves background integrity and visual coherence, making more effective strategy for unwanted object removal.
Mask & Image
(a) x FL w/SS....
(b) x FL w/S...sk
GT
(c) 3 x FL w/S (d) 3 Fl. w/Smaak
Figure 6: Visual comparison of mask- vs. box- based stitching. ix FL w/ S' denotes Stage-I painted result at 2x and 3x focal lengths pasted into the input image using different stitchings.
Fine-tune Flux.1-dev Decoder at Stage-II with different losses. Our seam- and repair builds the VAE of 1-de,, with only the decoder fine-tuned. Table 5 and Figure evaluate the effectiveness of our proposed color-shadow consistency loss, which applies LPIPS to the background and I.1 to the foreground address both color shift and shadow artifacts. Observing
aware

---

Table 4: Performance of different stitching strategies for Stage-I inpainted results at 2x and 3x focal lengths. Mask-based stitching consistently outperforms box-based stitching.
RORD-val Sagong et al.
2022
#Stitching
PSNR t
SSIM f
LPIPS +
FID +
CMMD +
2x FL w/ Shoz
31.245
0,919
0.053
8,458
0,270
2x FL. w/ Smask
31,905 (+0.66)
0.931 (+0.012)
0.040 (-0.013)
13.041 (+4.583)
0.279 (+0.009)
3x FL w/ Show
31.082
0.923
0.046
24.288
0.258
3x FL w/ Smask
31.732 (+0.65)
0.932 (+0.009)
0.039 (=0.007)
25.036 (+0.748)
0.272 (+0.014)
Misk Image
L1)11
(3) LPIPS
(c) (Bp) LPIPS (Fg) (4) LPIPS (Bg.) Li(P)))
GT
Visual comparison of fine-tuning the Flux.I-dew decoder with different losses. Using LPIPS for the background and L1 for the foreground not only ensures visual consistency to address seam issues caused by color shifts but also effectively repairs object shadows.
Figure 7:
Table 5: Comparison of fine-tuning the Flux.I-dev decoder with different losses.
RORD-val Sagong al. 2022
#ooss
PSNR f
SSIM f
I.PIS 4
FID +
CMMD
LI
30.954
0.922
0.044
24.580
0.275
LPIPS
30.920 (-0.034)
0.921 (-0.001)
0.043 (-0.001)
24.618 (+0.038)
0.262 (-0.013)
LI(PS.))..IPS(Fgg)
30.948 (-0.006)
0.921 (-0.001)
0.044
24.124 (-0.456)
0.283 (+0.008)
LPIPS(Bg.+LI(fg))
31,256 (40.302)
0.924 (+0.002)
0.041 (-0.003)
21.379 (-3:201)
0.263 (-0.012)
Figure 7 (a) and (b), training with only L1 loss limits foreground repair and causes background detail loss. while using only LPIPS preserves background semantics but fails to restore fine foreground regions. As reported in Table [5] both settings yield nearly identical scores (e.g., PSNR 30.954 vs. 30.920, SSIM 0.922 vs. 0.92T). This reflects their complementary strengths: I.1 enforces pixel- level accuracy, whereas LPIPS emphasizes perceptual similarity but is less sensitive to small objects. Based on this observation, we explored combining LPIPS and LI losses to jointly train the decoder. Using LPIPS for foreground repair with L1 for background preservation yields only modest FID improvement (-0.456 in Table 5). while other metrics remain largely unchanged, consistent with the visual results in Figure (a) and (c). In contrast, applying LPIPS to background reconstruction with L regularization on the foreground (last row) achieves the best overall performance, providing superior metric gains and improved visual quality. As shown in Figure 7 (d), this setting ensures seamless color consistency between the inpainted region and surrounding context and effectively removes residual shadows, demonstrating the effectiveness of our color-shadow consistency loss.
CONCLUSIONS
In this paper, we address small object removal, task where existing methods often struggle to accurately erase and repair fine details. We propose RefocusEraser, a two-stage framework that combines small object refocusing with robust context- and shadow-aware repair. In Stage Camera-Adaptice Refocus Inpainter enlarges masked objects and enhances semantic consistency through LoRA fine-tuning. Stage introduces Seam- and Shadow-Aware Repair with mask-based stitching to seamlessly integrate inpainted regions and remove shadows. Extensive experiments on benchmark datasets demonstrate the effectiveness of our approach, and the framework generalizes to other tasks requiring cross-scale semantic alignment and seamless region integration.
10

---

ACKNOWLEDGEMENTS
This work is supported by the National Natural Science Foundation of China (NSFC) 62502448.
ETHICS STATEMENT
Our work introduces RefocusErassr, a diffusion-based framework for object removal. While our method can benefit applications such as image editing, content restoration, and virtual background generation, it could also be misused to generate highly realistic synthetic images, potentially raising ethical concerns regarding privacy, consent, and misinformation.
To mitigate these risks, all experiments are conducted using publicly available datasets with appro- priate licenses, and no personally identifiable or sensitive information is included. We encourage responsible use of our models and advise careful consideration of ethical and societal implications when deploying such generative technologies. Our primary goal is advance scientific research in controllable image generation, and we advocate for precautions to prevent malicious or unethical applications.
USE OF LARGE LANGUAGE MODELS STATEMENT
We did not use any large language models (LLMs) in the development, experimentation, or writing of this work. All models, algorithms, and analyses presented in this paper implemented and evaluated without reliance on L.Mss. The datasets, training procedures, and evaluation protocols are entirely independent of LLM-generated content. This ensures that our results and conclusions fully derived from the methods described in this paper and are not influenced by any external LLM outputs.
REPRODUCIBILITY STATEMENT
We provide detailed description of our RefoeusEraser framework, which is optimized through two decoupled training stages: Stage-I Camera-Adaptin Refocus Inpainter and Stage-Il Seam- and Shadow-Aware Repair. Each stage is fine-tuned separately to address its specific objective. We include comprehensive training details, hyperparameter settings, and evaluation protocols in both the main paper and supplementary material to facilitate replication. All datasets used are publicly available with appropriate licenses. While the full source code will be released upon publication, all results reported in this work can be reproduced using the provided descriptions and publicly accessible data.
REFERENCES
Omri Avrahami, Ohad Fried, and Dani Lischinski. Blended latent diffusion. ACM TOG, 42(4):1-11, 2023.
Connelly Barnes, Eli Shechtman, Finkelstein, al. Patchmatch: randomized correspondence algorithm for structural image editing. ACM TOG, 28()):24, 2009.
Stephen Batifol, Andreas Blattmann, Frederic Boesel, Saksham Consul, Cyril Diagne, Tim Dock- horn, Jack English, Zion English, Patrick Esser, Sumith Kulal, al. Flux.1 kontext: Flow match- ing for in-context image generation and editing in latent space. arXiv e-prints, pp. arXiv-2506, 2025.
Marcelo Bertalmio, Guillermo Sapiro, Caselles, et al. Image inpainting. In SIGGRAPH, pp. 417- 424, 2000.
FlasksForest.Labs. Flux.
flux 2024.
Ciprian Corneanu, Raghudeep Gadde, and Aleix Martinez. Latentpaint: Image inpainting in latent space with diffusion models. In WACV, pp. 4334 4343, 2024.

---

Antonio Criminisi, Patrick Pérez, and Kentaro Toyama. Region filling and object removal by exemplar-bar baapla image impainting. JEEE TIP. 13(9)1100--221, 2004.
Yigit Ekin, Ahmet Burak Yildirim, Erdem Eren Çağlar, Aykut Erdem, Erkut Erdem, and Aysegul Dundar. Clipaway: Harmonizing focused embeddings for removing objects via diffusion models. NeurlPS, 37:17572-17600 2024.
Patrick Esser, Sumith Kulal, Blattmann, et al. Scaling rectified flow transformers for high-resolution image synthesis. ICML, 2024.
Martin Heusel, Hubert Ramsauer, Thomas Unterthiner, Bernhard Nessler, and Sepp Hochreiter. Gans trained by two time-scale update rule converge to a local nash equilibrium. NeurIPS, 30, 2017.
Alain Hore and Djemel Ziou. Image quality metrics: Psnr vs. ssim. In ICPR, pp. 2366-2369. IEEE, 2010.
Edward J Hu, Yelong Shen, Wallis, et al. Lora: Low-rank adaptation of large language models. ICLR, 1(2):3, 2022.
Sadeep Jayasumana, Srikumar Ramalingam, Andreas Veit, Daniel Glasner, Ayan Chakrabarti, and Sanjiv Kumar. Rethinking fid: Towards better evaluation metric for image generation. In CVPR, pp. 9307-9315, 2024.
Wenbo Li, Zhe Lin, Kun Zhou, et al. Mat: Mask-aware transformer for large hole image inpainting. In CVPR, pp. 10758- 10768, 2022.
Anji Liu, Mathias Niepert, and Guy Van den Broeck. Image inpainting via tractable steering of diffusion models. ICLR, 2023.
James Lucas, George Tucker, Roger Grosse, and Mohammad Norouzi. Don't blame the elbo! linear vae perspective on posterior collapse. NeurIPS, 32, 2019.
Andreas Lugmayr, Martin Danelljan, Andres Romero, Fisher Yu, Radu Timofte, and Luc Van Gool. Repaint: Inpainting using denoising diffusion probabilistic models. In CVPR, pp. 11461-11471, 2022.
Aoi Otani. Mitigating catastrophic forgetting and mode collapse in text-to-image diffusion via latent replay, arXiv preprint arXiv:2509.10529 2025.
William Peebles and Saining Xie. Scalable diffusion models with transformers. In ICCV, pp. 4195- 4205, 2023a.
William Peebles and Saining Xie. Scalable diffusion models with transformers. In ICCV, pp. 4195- 4205, 2023b.
Robin Rombach, Andreas Blattmann, Lorenz, et al. High-resolution image synthesis with latent diffusion models. In CVPR, pp. 10684-10695, 2022.
Min-Cheol Sagong, Yoon-Jae Yeo, Seung-Won Jung, and Sung-Jea Ko. Rord: A real-world object removal dataset. In BMVC, pp. 542, 2022.
Jiaming Song, Chenlin Meng, and Stefano Ermon. Denoising diffusion implicit models. ICLR, 2020.
Wenhao Sun, Xue-Mei Dong, Benlei Cui, and Jingqun Tang. Attentive eraser: Unleashing diffusion model's object removal potential via self-attention redirection guidance. In AAAI, volume 39, pp- 20734-20742, 2025.
Zeyi Sun, Ye Fang, Tong Wu, et al. Alpha-clip: A clip model focusing on wherever you want. In CVPR, pp. 13019-13029, 2024.
Roman Suvorov, Elizaveta Logacheva, Mashikhin, et al. Resolution-robust large mask inpainting with fourier convolutions. In WACV, pp. 2149-2159, 2022.
12

---

Alexander Veicht, Paul-Edouard Sarlin, Philipp Lindenberger, and Mare Pollefeys. Geocalib:
Single-image calibration with geometric optimization. In ECCV, 2024.
Yikai Wang, Chenjie Cao, Junqiu Yu, Ke Fan, Xiangyang Xue, and Yanwei Fu. Towards enhanced image inpainting: Mitigating unwanted object insertion and preserving color consistency. In CVPR, pp. 23237-23248, 2025.
Zhou Wang, Alan C Bovik, Hamid R Sheikh, and Eero P Simoncelli. Image quality assessment: From error visibility to structural similarity. IEEE TIP, 13(4):600-61 -12,00006666200 2004.
Rumpu Wei, Zijin Yin, Shuo Zhang, and Zhouand others. Omnicraser: Remove objects and their effects in images with paired video-frame data. arXiv preprint arXiv:2501.07397, 2025.
Chen Wu, Ling Wang, Long Peng, Dianjie Lu, and Zhuoran Zheng. Dropout the high-rate down- sampling: A novel design paradigm for uhd image restoration. In WACV, pp. 2390-2399, 2025.
Shaoan Xie, Zhifei Zhang, Zhe Lin, et al. Smartbrush: Text and shape guided object inpainting with diffusion model. CVPR, pp. 22428-22437, 2023.
Ziyang Xu, Kangsheng Duan, Xiaolei Shen, Zhifeng Ding, Wenyu Liu, Xiaohu Ruan, Xiaoxin Chen, and Xinggang Wang. Pixelhacker: Image inpainting with structural and semantic consistency. arXiv preprint arXiv:2504.20438, 2025.
Siyuan Yang, Lu Zhang, Liqian Ma, et al. Magicremover: Tuning-free text-guided image inpainting with diffusion models. arXiv preprint arXiv:2310.02848. 2023.
Dengyong Zhang, Zaoshan Liang Gaobo Yang. et al. robust forgery detection algorithm for object removal by exemplar-based image inpainting. Multimedia Tools and Applications, 77(10): 11823-11842, 2018a.
Guanhua Zhang, Jiabao Ji, Yang Zhang, Mo Yu, Tommi Jaakkola, and Shiyu Chang. Towards coherent image inpainting using denoising diffusion implicit models. In ICML, pp. 41 41164-41193, 2023.
Richard Zhang, Phillip Isola, Alexci A Efros, Eli Shechtman, and Oliver Wang. The unreasonable effectiveness deep features as perceptual metric. In CVPR, pp. 586-595, 2018b.
Shengyu Zhao, Jonathan Cui, Yilun Sheng, et Large scale image completion via co-modulated generative adversarial networks. ICLR, 2021.
Junhao Zhuang. Yanhong Zeng, Wenran Liu, Chun Yuan, and Kai Chen. A task is worth word: Learning with task prompts for high-quality versatile image inpainting. In ECCV, pp. 195-211. Springer, 2024.
13

---

A DETAILS OF CAMERA-ADAPIIS REFOCUS STRATEGY
Step 1: Focal-Length-Awaal Image Selection. Since the original images lack known focal lengths, estimating camera parameters essential for our refocus mechanism. We first predict the camera patrinsics-incluee
roll, pitch, vertical field of view (vFoV), and focal length-using GeoCalib Veicht al. (024)). Then, using images captured by real cameras reference, we align the predicted focal lengths with ground-trute parameters. Based on these aligned values, we filter and select images for our dataset.
Step 2: Camera-Adaptivy Refocus Strategy. After obtaining the images based on their estimated focal lengths, we introduce a Camera-Adaptive Refocus Strategy, which leverages camera-adaae -adativve zoom-in simulate varying focal perspectives. Specifically, we design transformation pipeline that performs central field-of-view (FoV) cropping and rescaling to generate images at zoom factors of 2x, 3x, and 4x, corresponding to different effective focal lengths. Given an original image of size W x H and a target zoom factor 2 E 2, 3, 4, we define the cropping ratio as 1/2. Using this ratio, we extract central region of width W rW and height H' rH simulate the visual narrowing effect of increased focal length. Formally, the cropping operation can be expressed as:
3 zoom
Resize
(1-r)
(1
( (1
where Zrom denotes the image generated at different focal length. The resizing operation produces images with distinct focal characteristics, corresponding to zoom factors of 2x, 3x, and 4x.
Step 3: Complete-Mask Image Filter. To prevent partial truncation of foreground objects during the zoom-in cropping process, particularly at higher focal lengths, we ensure foreground complete- ness through mask-based image filtering strategy. Let Σ m' denote the number of foreground pixels in the original mask m. and let m2x represent its corresponding zoomed-in version at zoom level 3, To guarantee foreground completeness, m.x with the expected area under ideal central cropping, Assuming the foreground is fully con- tained within the central crop, the expected area after zooming 1 Σ m' of the original mask area. We define the completeness error rate as:
compare the actual foreground area in
= Σ mix - Σ m'|
Σmm
where Σ max denotes the number of foreground pixels in the zoomed-in mask. A sample re- tained only if the completeness error å is below predefined threshold (set to 0.1); otherwise, it
(a) 1 X FL Image
(b) x FL Image
3x) Image
(d) 4 FL Image
Figure 8: Visual examples of simulated camera-adaptive zoom-in images, where larger focal lengths correspond to wider fields of view, providing the VAE with more contextual information and enabling better preservation fine structural details.
14

---

is discarded. This filtering is applied across zoom levels 2x, 3x, and 4x, resulting in curated set of zoomed images with verified foreground integrity. Examples the simulated camera-adapting zoom-in images shown in Figure 8 where successive zoom levels replicate narrower fields of view and enable better preservation of fine structural details the foreground objects.
B COMPARISON OF MASK- BASSD AND
STITCHING
After obtaining the inpainted outputs from Stage-I, the next challenging step is to reintegrate them into the original image. To analyze the impact different compositing strategies, we consider two stitching methods, as illustrated in Figure
(a) Box-based stitching
Resize& Paste
H
Stage-I Result
Input Image
Box-seam Image'
1// WW 81-1FFL KH
(b) Mask-based stitching
Stage-I Result
Mask
Foreground
Mask-seam Image
Image
1-Mask
Background
Figure 9: Performance comparison of stitching strategies. (a) Box-based stitching introduces visible seams and color inconsistencies along object boundaries, whereas (b) proposed mask- based stitching achieves better semantic alignment with fewer artifacts.
Box-based stitching. A straightforward strategy is directly resize the inpainted patch and paste back into the original image according to the zooming scale. However, this box-based compositing introduces noticeable artifacts. Since the entire rectangular patch, including unmodified background regions, is reinserted, sharp seams often emerge along its boundaries. Moreover, local inconsisten- cies texture illumination across the cropped edges disrupt spatial continuity, and these artifacts are further amplified at higher zoom levels.
Mask- stitching. Rather than reinserting the entire rectangular crop, the restored foreground selectively extracted using the binary mask and blended with the corresponding background. This ensures that only inpainted pixels are composited back, eliminating redundant overlaps and reducing visible seams along object boundaries, thus improving spatial continuity and visual co- herence. Nevertheless, since the inpainted region produced by the VAE decoder, subtle color discrepancies may still arise between the restored foreground and the untouched background, occa- sionally resulting in faint mask-shaped seams at the boundaries.
C DATA COLLECTION AND CONSTRUCTION
Data Collection. To train both the LoRA module and the VAE decoder in ReFocusEErasrr, we con- struct a high-quality dataset for small object removal, consisting of paired foreground images and their corresponding ground-truth backgrounds. This dataset is derived from RORD, large-scale real-world object removal dataset containing 516,709 high-resolution images (960x540) across 3,447 unique scenes. For each scene, we provide both foreground image and background image
15

---

FFFcal Length Fstimation
@31 Lage FOV Image Selection
RORD Dataset
Camera Intrinsic
Parameters Estimation
Discard
Foreground Completeness Filtering
Pers Perspective Fields
Focal > 500 px
Stimulate Zoom
Processed Datasets
Wide-Angle
C Tiltered
Image
Roll: 0.55
Pitch: -2.29
vFoV: 31,50
Focal: 457.39
Figure 10: Overview of our data preprocessing pipeline, including: ①D Focal Length Estimation,
where camera parameters for all images in the raw RORD dataset are estimated using GeoCalib; @ Large FOV Image Selection, which retains images with focal lengths smaller than 500 px; and @ Foreground Completeness Filtering, ensuring mask objects remain complete across all scales.
Train Datasct
Test Dataset
4x
4x
3x
3991
314
12757
1542
O
2x 67214
2x
7603
4x
2
Figure 11: Train and Test Splits of the Processed RORD Dataset. The numbers of valid images at each zoom level (2x, 3x, 4x) for training and testing are listed.
with the target object removed, enabling precise supervision for training. For our experiments, select subset of images corresponding to the 2 focal length, comprising 12,757 training images and 1,542 testing images. We employ the object mask annotations provided by RORD, derived from semantic segmentation maps, directly as object masks. When multiple masks correspond to distinct regions of individual objects, we merge them into unified masks to ensure accurate and complete object representations.
Construction Pipeline. As shown in Figure 10 our data construction pipeline for RORD consists of three main steps: @ Focal Length Estimation (detailed in Appendix A Steps 1-2), @ Large FOV Image Selection, and Foreground Completeness Filtering (detailed in Appendix A Step 3). After applying this pipeline, the selected images partitioned into training and testing subsets according to their zoom levels. The statistics are summarized in Figure [1] The training set contains 67, 67,21 17,214 images 2x, 12,757 images at xx, and 3,991 images at 4x, while the testing includes 7,630 images at 2x, 1,542 images at 3x, and 314 images at 4x, ensuring balanced distribution across focal lengths for model evaluation.
D TRAINING DETAILS
Our ReFocusEraser framework is optimized through two decoupled training stages: (1) Stage-I Camera-Adaptive Refocus Inpainter and (2) Stage-II Seam- and Shadow-Aware Repair. Each stage is fine-tuned separately to focus on its specific objective. In this section, we elaborate on the corresponding training strategies for both stages.
Stage-I: SET for Adapiiee Refocus Inpainter. this stage, we build the Camera- Adaptive Refocus Inpainter upon Flux.1-dew Blacc-Fooret-- (2024), further augmented with refocus mechanism. We first train LoRA module to adapt the model for inpainting across varying focal lengths. Concretely, freeze all pre-trained DIT' parameters and insert lightweight LoRA
16

---

layers into both self-attention and feed-forward blocks. Input images and masks processed with our camera-control strategy, which simulates nx zoom to enrich contextual detail. The zoomed foregrounds, backgrounds, masks, and noisy inputs are concatenated and linearly projected before being fed into DiT for denoising. Training is supervised via a diffusion loss between the denoised outputs and the ground-truth targets. Owing to the scareity of high-zoom data, train independent models for 1x, 2x, and 3x zoom levels. Each model is optimized for 20 epochs with LoRA rank of 32, learning rate of 3e-5, and batch size of 2 on four NVIDIA H200 GPUs, requiring approximately two days per run.
Stage-II: SFT for Seam- and Shadow-Aware Repair. This stage is built the VAE of Flux. 1- BwyBBlack-ForestLLaae (2024). The inpainted results from Stage-I are stitched into the corresponding zoom-in inputs using a mask-based compositing strategy, which preserves local structures while avoiding boundary artifacts. The fused outputs then refined by the VAE to ensure seamless blending and automatic shadow correction. The encoder shares weights with Stage-I, while the decoder is separately optimized. The Stage-Il decoder is initialized with the trained weights of the Stage-I decoder. Training is performed with a batch size of 4 and a learning rate of le-4 for 80k steps eight NVIDIA H200 GPUs (approximately 1.5 days).
After training, they are integrated into unified inference pipeline. For a given input image, it is first processed by the Stage-I Refocus Inpainter to perform inpainting. The generated content is then refined by the Stage-Il Seam- and chadow-Aware Decoder and blended back into the original image, yielding final output that is visually coherent and free of seams or shadow inconsistencies.
E ADDITIONAL. VISUALIZATIONNS
To provide further qualitative insights into the effectiveness of ReFocusEraser, we present supple- mentary visual comparisons and ablation studies in this appendix.
Visual Comparison Against Other SOTA Methods. Figures 12 and 13 provide additional visual comparisons with state-of-the-art specialized object removal and general inpainting methods across diverse scenes. Our approach consistently produces semantically faithful and visually coherent re- sults, excelling at recovering fine details of small objects and eliminating residual shadows, even in challenging scenarios with complex textures.
Visual Impact of the Refocus Inpainter Trained at Different Focal Lengths. Figure 14 provides additional visualizations demonstrating the effect of training the LoRA module at different focal lengths (1x, 2x, 3x). Models trained at higher focal lengths capture finer structural details and context information, producing more accurate and visually coherent inpainting. These results offer further evidence of the benefits of focal-length-specinn training.
Visual comparison of fine-tuning the Flux.1-dev decoder with different losses. Figure 15 pro- vides additional visualizations that highlight the effectiveness of our proposed color-consistency loss. By applying L1 to foreground and LPIPS background, our proposed loss not only pre- serves fine foreground details and mitigates color shifts to improve seamless integration, but also automatically removes residual shadows, producing more natural and visually coherent results.
17

---

Mask & Image
Repaint
CLIPAway
PowerPaint
AttentiveLraser
PixelHHackr
OmnilEraser
Flux-Fill
Flux-Knotext
Ours
GI
Figure 12: Additional qualitative comparisons with state-of-the-art methods, The red solid box shows zoom-in view of the corresponding red dashed box. All visual results demonstrate the superiority of our method over existing approaches.
18

---

Mask & Image
Repaint
CLIPAway
Power nwwerPaint
AttentiveFrasee
PixelHacker
OnniFraser
Flux-Fiill
Flux-Knotexe notext
Ours
Figure 13: Additional qualitative comparisons with state-of-the-art methods. The red solid box shows zoom-in view of the corresponding dashed box. All visual results demonstrate the superiority of our method over existing approaches.
19

---

Mask & Image
x FL
2 FL
x FL
GT
Figure 14: Additional qualitative comparisons of the camera-adaptive refocus inpainter at dif- ferent focal lengths (1x, 2x, and 3x). Increasing zoom levels improve impainting performance for large field-of-view images, with the 3x producing the most accurate and visually coherent results.
Image
Mask
L1
LPIPS
Li (Bg.)
I.I + Lppe (ee)
GT
Figure 15: Visual comparison of fine-tuning the Flux. 1 dev decoder with different losses. Using LPIPS for the background and LI for the foreground not only ensures visual consistency to address seam issues caused by color shifts but also effectively repairs object shadows.
20

---

(a) Imae
(b) OmniEraser
(c) Ours
(d) GT
Figure 16: Comparison between OmniEraser and our method on shadow-object removal. While both methods remove the masked shadow, our results better preserve unrelated shadows the scene and produce more complete shadow removal in the target region.
Table Comparison of inference time, parameter count, and computational cost (GFLOPs) across different inpainting methods.
Method
Inference Time(s)
Parameters(B)
GFLOPs
Repaint
173.58
0.55
554K
PixelHacker
1.94
0,95
30K
CLIPAway
3.65
1.09
84K
PowerPaint
7.76
1.07
198K
Omnieraser
9.07
16.96
1709K
Flux-Kontext
33,02
16.87
3152K
Flux-Fill
30.79
16.87
3066K
AttentiveEraser
15,60
3.47
562K
Fraserr
12.28
17.01
1723K
21

---

(a) Image
(b) Stage-I Result
(c) Stage-ll Result w/ L1 Loss
(d) Stage-Il Result
(c) GT
w/ Loolor shadow
Figure 17: Comparison of shadow removal results. From left to right: input with mask, Stage- I output, Stage-Il output, L1-VAE decode, OmniEraser, and ground truth. The two-stage model progressively improves structural recovery and texture consistency.
22

---

Maskel
RePann
PicelHakerr
Flux
CLiPAway
PowerPaint
Atteniivelraser
Omniiiisser
Figure 18: Fair comparison with object and shadow masks provided to all methods.
23

---

Input Image
Reconstructed
Stage-I Result
Reconstructed
Figure 19: Demonstration of the strong reconstruction capability of the VAE.
24

---

Mask& Image
OmniEraser
Ours
Figure 20: Our method removes only the target shadows while preserving shadows cast by other objects, demonstrating its robust selectivity.
Mask & Image
Stage Result
Stage 11 Result
Figure 21: Comparison of Stage-I and Stage-Il results on cases where the shadow region spatially distant from the corresponding object. Each column shows the masked input, the intermediate Stage- I output, and the final Stage-Il refinement.
25

---

Mask Trraage
RePain
PivelHacker
Flux-Knoteen Knotext
Flux- Fill
CLIPAWWR Awayy
PowerPaint
Tnentiverrraee
OmniFrraser
Figure 22: Compared with existing inpainting models, method achieves stable and coherent removal of large objects, avoiding the severe distortions and missing textures observed in competing approaches.
26

---

Mask& Seask&&lmne Image
RePaint
PixelHacker
Flux- Kntooxt
Flux- Flux-Fill
CLIPAway
PowerPaint
AttentiveFrrsser
OmniEraser
Figure 23: Examples of testing on non-camera images.
27


Reviews:
[{"review_id": "A4XiAylGR7", "reviewer": "Reviewer_bExM", "summary": "This paper proposes a two-stage framework to address the small object removal problem. First, the small object is enlarged using the Camera-Adaptive Refocus Strategy and input into the first-stage Camera-Adaptive Refocus Inpainter, where the object is removed via a fine-tuned pre-trained FLUX model. After that, the second-stage Seam- and Shadow-Aware Repair is applied. This step uses a fine-tuned FLUX VAE to maintain background consistency and eliminate shadows. Both metric validation and visual result demonstrations confirm the effectiveness of this framework.", "questions": "1. It is noted that RORD’s masks include objects, shadows, and an extra expanded edge, whereas the masks presented in this work only fit tightly around objects. It remains unclear whether these masks were re-labeled, and whether the same \"object-only\" masks were used for model training.\n2. The reason for selecting VAE for the second-stage correction requires further clarification, as other architectures may exhibit better performance. Additionally, VAE typically tends to reduce image quality, and how this issue is addressed in the proposed method needs more explanation.\n3. In the second stage, since only the zoomed image (with shadows but without the target object) is input, the model may struggle to distinguish which shadow originates from the target object. It is recommended to provide test results on a more challenging scenario: when other non-target-related shadows exist in the zoomed image, can the method exclusively remove the target’s shadow without affecting the others?\n4. Whether the Camera-Adaptive Refocus Strategy has considered the possibility that part of the object’s shadow may be cropped outside the zoomed-in region needs to be confirmed.", "limitations": "", "rating": 4, "confidence": 4, "soundness": 2, "presentation": 3, "contribution": 2, "strengths": "1. This method can address the small object removal challenge and the color shift issue inherent in diffusion models.\n2. The framework not only achieves significant metric improvement over most SOTA models but also produces high-quality visual results.", "weaknesses": "1. The first stage is reported to remove shadows, yet the shadowy background is pasted back and shadow removal is repeated in the second stage. This process seems to waste the shadow-free result obtained from the first stage.\n2. In the experimental comparison with other models that lack the ability to remove unmasked shadows, providing only object-only masks may introduce unfairness to these competing methods.", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "", "claims_and_evidence": "", "methods_and_evaluation_criteria": "", "theoretical_claims": "", "experimental_designs_or_analyses": "", "relation_to_broader_scientific_literature": "", "essential_references_not_discussed": "", "other_strengths_and_weaknesses": "", "other_comments_or_suggestions": "", "questions_for_authors": "", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "", "reasons_to_reject": "", "questions_to_authors": "", "extra_scores": {}}, {"review_id": "gl4beJLABA", "reviewer": "Reviewer_Prd8", "summary": "This paper proposes a two-stage framework for small object removal, addressing the performance limitations caused by detail loss in the VAE encoder’s downsampling process. In the first stage, the authors introduce a camera-adaptive refocus mechanism that enlarges masked regions to facilitate coarse object removal. In the second stage, they fine-tune an additional decoder to correct residual artifacts such as color shifts and seams. The method is evaluated through experiments on both small and large object removal tasks.", "questions": "Please refer to the weaknesses.", "limitations": "", "rating": 6, "confidence": 2, "soundness": 2, "presentation": 3, "contribution": 2, "strengths": "1. The paper effectively addresses the challenging and often overlooked problem of small object removal.\n2. The work is supported by extensive experiments and demonstrates compelling qualitative results.\n3. The paper is well-structured and clearly presented.", "weaknesses": "1. The camera-adaptive refocus mechanism in Stage-I appears highly effective for small objects, but its contribution to large object removal is less clear. An ablation study specifically isolating the contributions of Stage-I and Stage-II for large object removal would be insightful.\n2. For Stage-II, it is unclear how robust the shadow-aware repair is to shadows that are cast far from the original mask region. Could such cases lead to failures or the introduction of new artifacts?\n3. In Table 2, the metrics for Exp. (d) show a slight degradation in PSNR, SSIM, and LPIPS compared to Exp. (c). Could the authors provide further analysis on the reason for this performance trade-off?\n4. Including a discussion or visualization of typical failure cases would further strengthen the paper by clarifying the method's limitations.", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "", "claims_and_evidence": "", "methods_and_evaluation_criteria": "", "theoretical_claims": "", "experimental_designs_or_analyses": "", "relation_to_broader_scientific_literature": "", "essential_references_not_discussed": "", "other_strengths_and_weaknesses": "", "other_comments_or_suggestions": "", "questions_for_authors": "", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "", "reasons_to_reject": "", "questions_to_authors": "", "extra_scores": {}}, {"review_id": "XJ4QgfN8MI", "reviewer": "Reviewer_5SDG", "summary": "This paper proposes diffusion-based framework to handle *object removal*, capable of handling objects of various sizes. To improve the object removal of small objects with securing the consistency between inpainted region and surrounding context, the paper proposes two main components:\n\n1. Camera-adaptive zoom-and-crop module to upscale the appearance of small objects.\n2. Additional decoder to mitigate the misalignment between surrounding context and removed region.", "questions": "NA", "limitations": "", "rating": 6, "confidence": 4, "soundness": 3, "presentation": 3, "contribution": 2, "strengths": "* The paper points out the limitation of previous works that struggle to remove the small objects in the image due to the information loss in VAE encoder. The paper addresses aforementioned issue where the motivation is clear.\n* The paper proposes *Camera-adaptive Refocus Mechanism* where it crops the target object based on the camera parameters, better preserving the object context. Furthermore, it introduces additional decoder to enhance the inconsistency between removed part and surrounding context such as boundary of the removed object. The framework makes sense with resulting in clear performance improvement compared to the baseline.", "weaknesses": "My main concern is on the efficiency of the model. \n\n* **Training Efficiency:** In L47-49, the paper points out that fine-tuning the VAE incurs huge computational cost.  However, ReFocusEraser also needs substantial amounts of GPUs which is 8 H200 GPUs to optimize the additional decoder. \n* **Inference/parameter Efficiency:** ReFocusEraser needs two decoder for the inference which raises the concern on the efficiency of inference time and parameter size. Can you compare the inference time of ReFocusEraser with the baselines in Tab. 1? Also, it would be also better to compare the size of parameters as well.\n* In Fig. 6b and Fib. 6d, it seems that there are color shift (more brighter) on the removed part compared to the Fig. 6a and Fib. 6c. Due to this color shift, it seems that box-based stitching results in more natural output compared to the mask-based stitching which is inconsistent with the paper's conclusion on L431. \n* In Tab. 2, PSNR of row (c) is higher than row (d). However, the number on row (d) is bolded. Furthermore, not using decoder achieves better results on PSNR, SSIM and LPIPS compared to the setting with using additional decoder while opposed results can be found in FID and CMMD metrics. Can you explain more about this inconsistent results?\n* In Tab. 3, it is better to add the results with fixed crop or zoom to validate the effectiveness of camera-adaptive zoom-in method.", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "", "claims_and_evidence": "", "methods_and_evaluation_criteria": "", "theoretical_claims": "", "experimental_designs_or_analyses": "", "relation_to_broader_scientific_literature": "", "essential_references_not_discussed": "", "other_strengths_and_weaknesses": "", "other_comments_or_suggestions": "", "questions_for_authors": "", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "", "reasons_to_reject": "", "questions_to_authors": "", "extra_scores": {}}, {"review_id": "Xm0N5ipYHL", "reviewer": "Reviewer_BXbz", "summary": "This paper proposes ReFocusEraser, an innovative two-stage framework for small masked object removal with robust context and shadow repair.", "questions": "Refer to \"Weaknesses\".", "limitations": "", "rating": 6, "confidence": 3, "soundness": 2, "presentation": 3, "contribution": 3, "strengths": "1. This paper proposes an innovative two-stage framework for small masked object removal with robust context and shadow repair. By integrating a Camera-Adaptive Refocus Inpainter with a Seam- and Shadow-Aware Repair module, the method effectively enhances the structural and textural restoration of small masked regions.\n2. Experimental results demonstrate that the proposed method achieves significant performance improvements on benchmark datasets such as RORD-val and RemovalBench, outperforming existing state-of-the-art methods.", "weaknesses": "1. Regarding the generalization of ReFocusEraser, this method is mainly evaluated on camera-captured data and scenes. It is unclear whether it remains effective on non-camera-captured images.\n2. The current framework adopts a two-stage decoupled training strategy. If the two stages are trained jointly in an end-to-end manner, what are the differences in training cost and performance?\n3. While training details are reported, the paper does not provide a discussion or comparison of inference efficiency. The overall training time, inference time, and computational complexity compared to mainstream methods remain unclear.", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "", "claims_and_evidence": "", "methods_and_evaluation_criteria": "", "theoretical_claims": "", "experimental_designs_or_analyses": "", "relation_to_broader_scientific_literature": "", "essential_references_not_discussed": "", "other_strengths_and_weaknesses": "", "other_comments_or_suggestions": "", "questions_for_authors": "", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "", "reasons_to_reject": "", "questions_to_authors": "", "extra_scores": {}}]

Author rebuttal:

Decision: Accept (Poster)