WorksComputer Science
FlashReFocus: Interactive Image Refocusing in Seconds
Abstract
Single-image refocusing changes the focal plane and depth of field of a photograph after capture. Users compare focal choices on one photograph, so content stability across edits matters alongside quality and speed. Recent generative methods rerun large diffusion models for every edit, even when they first restore an all-in-focus image, so content can change inconsistently between edits. Yet only this restoration is highly ill-posed and benefits from a generative prior, whereas rendering blur is largely determined by depth and the focal plane. We therefore propose FlashReFocus, which runs diffusion once per photograph and renders each edit with a lightweight network. A one-step diffusion deblurrer with a decoder refiner recovers fine detail efficiently while balancing fidelity and perceptual quality. The renderer uses an explicit defocus map for control and defocus-bias attention to promote information exchange between tokens with similar blur magnitudes. Because every edit reuses the same reconstruction, in-focus content stays consistent across edits, and editing the map enables tilt-shift and two-plane effects. We further collect 3CReal, a benchmark of 89 pairs from three camera-lens systems, to evaluate generalization to unseen optics. For zero-shot bokeh rendering on EBB! Val176 and 3CReal, FlashReFocus leads the evaluated methods in fidelity and perceptual quality. At 1536x1536, a complete refocus takes 2.45 s and each subsequent edit 0.46 s on one RTX PRO 6000.
Introduction
Depth of field (DoF) decides what is sharp in a photograph, and it is fixed at capture. Smartphone portrait modes only add blur to a sharp image using recorded depth [61], so anything captured out of focus stays blurred. Single-image refocusing instead recovers an all-in-focus (AiF) image and then renders blur around a new focal plane [41].
In practice, a user reviewing a portrait may move focus from the face to the background and then adjust the blur strength. Existing approaches fall into two families (Figure 1). Single-stage methods [53, 64] map the blurred input directly to the refocused image with a large diffusion
Figure 1. Diffusion-based refocusing paradigms. (a) Single-stage diffusion and (b) two-stage generative refocusing run a large diffusion model for every focal edit. (c) FlashReFocus restores the AiF image once and renders each new focal setting with a lightweight defocus-aware network. (d) Runtime in seconds at for every stage of a refocusing session.
model. They keep no intermediate representation to reuse, so every edit reruns the full model, and recovering detail while rendering blur in one pass often leaves newly focused regions insufficiently sharp. Two-stage methods first restore an AiF image and then render blur, two operations with different requirements. Restoration is highly ill-posed: defocus lowers sharpness and contrast, so crisp, high-contrast edges become blurred and fine scene detail fades or disappears. Regression-based restorers [25, 73] can over-smooth detail [7], whereas diffusion priors [18, 46] can synthesize realistic texture. Rendering is more constrained: given depth, a focal plane, and camera parameters (aperture and focal length), the circle of confusion (CoC) largely determines the blur [41], allowing a compact feed-forward renderer. Yet GenRefocus [36] and AnyBokeh [19] render with
Defocus Image Formation
a second large diffusion model for its strong prior and flexible conditioning on focus and blur, taking minutes per edit at . Diffusion methods in both families treat focus as an implicit condition, lacking explicit control for diverse edits such as tilt-shift, and resynthesize the whole image, so moving only the focal point can also largely alter another region. Lightweight bokeh renderers [38, 50] are fast for processing but are designed to blur a sharp image: because they cannot restore content captured out of focus, existing blur propagates into the result, making them less suited to refocusing. These factors limit interactive image deblurring and professional photographic editing.
To address these issues, we present FlashReFocus, an interactive two-stage framework for photorealistic refocusing that restores a high-resolution photograph once and renders many edits in seconds (Figure 2). The deblurring stage (Stage I) adapts a diffusion prior to a single step [56] with dual LoRAs for a dynamic trade-off between pixel fidelity and perceptual quality, and a lightweight multi-scale decoder refiner restores fine structure. Accordingly, restored images stay photorealistic with crisp, natural detail.
Figure 2. Overview of FlashReFocus. (A) Stage I restores an AiF image with one-step diffusion and an optional decoder refiner. (B) balances fidelity and detail by blending the pixel and detail predictions. (C) Depth and the selected focal point define the defocus map for (D) feed-forward bokeh rendering. (E) Defocus-bias attention favors tokens of similar blur, with scale controlled by .
Afterwards, to follow diverse blur controls with realistic lens blur, the rendering stage (Stage II) specifies blur with an explicit defocus map and renders each edit as a residual to the fixed reconstruction; its defocus-bias attention favors tokens of similar blur, so one renderer follows user instructions on focus, strength, and spatial blur. We train it with mixed supervision: synthetic multi-focal pre-training [38] teaches how blur changes across edits and adaptation to real pairs [22, 50] teaches lens-specific appearance. To further evaluate generalization, we introduce 3CReal, 89 aperture pairs from three camera–lens systems unseen in renderer training. Experiments demonstrate that FlashReFocus advances zero-shot bokeh rendering and also performs well in related tasks, such as complete refocusing, consistent focal editing, real-aperture control, and tilt-shift effects.
In summary, our main contributions are as follows:
We propose FlashReFocus, a refocusing framework that decouples generative restoration from lightweight rendering: diffusion runs once per photograph, and every focal edit reuses its AiF image to keep in-focus content stable.
We develop a one-step diffusion deblurrer with dual LoRAs and a lightweight multi-scale decoder refiner for an adjustable fidelity–detail trade-off; the restored image also yields more accurate depth for rendering.
We design a lightweight renderer with an explicit defocus map and defocus-bias attention for focal, strength, and spatial control in seconds, enabling accurate and photorealistic refocusing even on unseen cameras.
Related Work
Image restoration and defocus deblurring. Convolutional and Transformer models trained with reconstruction losses [10, 30, 73] achieve high PSNR and SSIM, while the perception–distortion trade-off [7] motivates generative priors to improve perceptual quality. Defocus blur has a point-spread function that varies with scene depth and focal distance [6, 74]. Classical methods estimate spatially varying kernels and deconvolve the image [26, 76, 79]. Learned models predict kernels or adaptive filters, exploit dual-pixel cues [1, 2, 25, 42, 55], train on light-field pairs [48], or explicitly model the physics of image formation [77].
Diffusion models supply a learned prior for image restoration [18, 46]. Existing models use input conditioning, residual prediction, or latent priors [13, 33, 69]; recent defocus models combine diffusion with Transformer features or fidelity-aware guidance [9, 27, 28, 29]. Diffusion priors can hallucinate texture [4], while VAE compression can discard fine structures such as small text.
Bokeh rendering and refocusing. Classical renderers convolve depth-dependent kernels, trace rays, or scatter in image space [24, 40, 41, 70], and layered or light-field inputs add scene information [37, 61]. Learned renderers predict depth from one image [63], learn DSLR blur from EBB! pairs [22], refine analytical scattering [38], render inpainted multiplane images [39], add strength control [50], or model occlusion [52]. BokehDiff, MagicBokeh, and DiffCamera synthesize bokeh with diffusion [53, 64, 78]; Any-to-Bokeh extends one-step diffusion bokeh to video [71], and Bokeh Diffusion controls blur strength in text-to-image generation without a focal plane [15]. Ours conditions on depth-derived signed defocus and a global strength.
Refocusing combines restoration and rendering. RefocusGAN estimates an AiF radiance image before applying focal blur [49]; DC2 uses a dual-camera rig [5]; and GenRefocus trains two diffusion transformers for the two operations with semi-supervised learning [36]. Learning to Refocus generates a focal stack with video diffusion [58], AnyBokeh edits photographs that already contain bokeh [19], and EXIF-conditioned text-to-image generation uses the same AiF, depth, and lens-blur decomposition [14]. FlashRefocus applies it to real photographs with a lightweight feed-forward renderer that reuses the AiF image across edits, so diffusion runs once per photograph.
Proposed Method
Preliminaries. Let be a photograph with unknown, spatially varying defocus. We first estimate an AiF image and then render the requested depth of field:
where contains the control signals defined in § 3.1.1. Under a thin-lens model, a point at depth forms a CoC when the lens is focused at , with diameter
where is the aperture diameter. Recovering the AiF image is an ill-posed inverse problem, while rendering a requested focal setting is a depth-controlled forward task. We therefore use diffusion for restoration and reuse its output with a lightweight renderer across all later focal edits.
Stage I: One-Step Diffusion Deblurring
Figure 3 illustrates Stage I. To recover detail lost to defocus, we use a diffusion prior in a single step. Following PiSA-SR [56], a LoRA-adapted Stable Diffusion U-Net maps the VAE latent to an estimated sharp latent,
Figure 3. One-step deblurring with pixel and detail LoRAs. (A) A LoRA-adapted U-Net restores the input latent. (B) The pixel LoRA, VAE-encoder LoRA, and input convolution are trained with , then frozen during detail-LoRA training with LPIPS and CSD. (C) At inference, blends the two predictions, and the refiner produces .
where and are the VAE encoder and decoder and is the empty prompt; no tagger or iterative sampling is used.
Pixel and detail LoRAs. Intuitively, pixel losses can over-smooth detail, while generative objectives can introduce hallucinations [7]. We balance fidelity and detail with two sequentially trained LoRA branches [20]. In the pixel phase, a rank-16 pixel LoRA, a VAE-encoder LoRA, and the U-Net input convolution are trained against the sharp target with . With these components frozen, a rank-4 detail LoRA (PiSA-SR’s semantic LoRA) minimizes
where LPIPS [75] measures perceptual distance. Classifier score distillation (CSD) [72] encourages sharp natural images using guidance from the frozen Stable Diffusion model, with RAM++ tags of the target [21] as the prompt and defocus terms in the negative prompt. Let and denote the U-Net predictions with the pixel LoRA alone and with both LoRAs. Then in Eq. (3) becomes
where controls the fidelity–detail trade-off, with using only the pixel branch. We use , selected on validation data; adjustable blending at requires a second U-Net pass to evaluate both LoRA branches.
Mixed supervision. Real pairs capture lens blur but may retain residual defocus or misalignment, whereas rendered pairs provide exact correspondence under simplified degradations. Accordingly, we combine DPDD [1], reversed RealBokeh pairs [50, 51], LFDOF [47], and synthetically blurred DIV2K [3] to expose the restorer to real blur while retaining precisely supervised examples. For DIV2K, we generate spatially varying blur as follows:
where is a blur kernel of radius , and blends three radii according to a random gradient map . Dataset filtering and sampling are detailed in App. § 9.
The decoder refiner. To recover fine structures degraded by VAE compression, a decoder refiner fuses multi-scale input-encoder features at matching decoder resolutions. A Laplacian map emphasizes detail retained in the input. Sharp-target supervision discourages transferring input blur. We train the fusion modules and decoder with
where is the refined output and is the error after a per-image affine color fit, reducing sensitivity to global color shifts. The optional refiner provides an additional fidelity–perception trade-off (§ 4.0.1). Optical defocus and latent compression are distinct sources of information loss. The diffusion prior estimates missing image content, while input-guided decoding gives surviving structure a path around the latent bottleneck. These roles motivate evaluating both perceptual detail and paired fidelity.
Stage II: Defocus-Aware Bokeh Rendering
Explicit global control signal. By Eq. (2), blur grows with the depth offset from the focal plane, and the sign of this offset separates foreground from background, so the renderer (Figure 4) takes this signed defocus explicitly. To this end, Depth Anything V2 [67] predicts relative inverse depth on the restored image, where defocus no longer obscures depth cues, and per-image min–max normalization and inversion give , with the farthest point. A user-selected pixel then sets , and we define
Figure 4. Lightweight bokeh rendering with explicit defocus control. (A) Depth, focal point, and strength define the condition stack . (B) A NAF encoder–decoder predicts a residual from and ; its bottleneck contains defocus residual groups (DRGs), each with defocus-aware attention blocks (DAABs). (C) Each DAAB biases attention using strength-scaled defocus differences.
Since predicts inverse depth up to scale and shift, the difference in Eq. (8) cancels the shift, so is a relative CoC whose unknown scale, like , is left to the
We therefore use as a relative CoC, with in place of , and the sign of Mˢ for separating foreground from background blur.
strength. The sign of Mˢ identifies the side of the focal plane (Figure 7). Together with a global blur strength , the condition stack is
Figure 7. Illustration of the thin-lens model. Far and near points can share a CoC size yet lie on opposite sides of the focal plane.
where marks points on or in front of the focal plane. Furthermore, centering depth on the focal plane gives all edits a common coordinate in which zero always denotes the plane intended to remain sharp, irrespective of image position, improving generalization across focal settings.
Defocus-bias attention. However, image proximity poorly predicts which features to exchange: a wall facing the camera can span the frame yet needs uniform blur, whereas a subject’s edge and the background behind it are adjacent yet need very different blur. Hence, we bias attention by requested-blur difference, not by the Manhattan token distance that Bokelhioucs [50] decays as in RetNet [57]:
where and are query and key vectors of dimension , and . Here, is the value of M at token , is a learned embedding ( in App. C), and is a scale set by . At a sharp boundary, the bias thus discourages the in-focus subject from mixing into its blurred surroundings as a halo. Moreover, since is recomputed at each edit, the grouping follows the selected focal plane, and a larger strengthens it. Nevertheless, M is unsigned, yet foreground blur spreads over the in-focus subject whereas background blur stays behind it; the signed and tell the two apart. A NAFNet encoder–decoder [10] conditions each scale on and applies this attention at its bottleneck. Finally, it predicts a residual, , keeping a direct path from the AiF image, so residuals stay small in focus and restored detail is kept (Figure 8).
Figure 8. Preservation of in-focus regions. Magnitude of the renderer’s residual, , when focusing at the white cross with strength and 1. Changes remain small on the in-focus subject and grow elsewhere with and .
Two-phase training. Synthetic data provide focal diversity, whereas real pairs capture lens-specific appearance at few focal settings. We therefore first pre-train on Hypersim [45] RGB-D scenes, sampling focal depths and strengths and rendering targets with BokehMe [38], . Afterwards, we adapt to RealBokeh with a larger learning rate for defocus-attention parameters than for the encoder and decoder, to learn lens appearance while retaining multi-focal control. Both phases minimize
against the synthetic or real target . At inference, the renderer then takes , the selected focal point, and the strength, so each edit needs one forward pass.
Experiments
Datasets and baselines. We evaluate deblurring on DPDD [1] and RealDOF [25], and bokeh rendering on EBB! Val176 [22] and 3CReal. Our 3CReal benchmark contains 89 aperture pairs from three camera–lens systems excluded from renderer training. We compare with seven deblurring and nine bokeh methods (Table 1 and Table 3).
| Methods | Full-reference Metrics | No-reference IQA Metrics | Distribution | |||||||
| PSNR↑ | SSIM↑ | LPIPS↓ | DISTS↓ | NIQE↓ | MUSIQ↑ | MANIQA↑ | BRISQUE↓ | CLIPIQA↑ | FID↓ | |
| DPDD [1] | ||||||||||
| IFAN (CVPR’21) [25] | 25.3637 | 0.7953 | 0.2158 | 0.1331 | 4.7407 | 59.3878 | 0.3522 | 34.7442 | 0.4026 | 40.4626 |
| Restormer⋆ (CVPR’22) [73] | 25.9768 | 0.8157 | 0.1762 | 0.1204 | 4.9868 | 61.7751 | 0.3887 | 39.3745 | 0.4405 | 32.0235 |
| DRBNet (CVPR’22) [48] | 25.7217 | 0.7978 | 0.1820 | 0.1063 | 4.5813 | 59.6612 | 0.3576 | 22.9788 | 0.4373 | 37.8632 |
| INIKNet (ICCV’23) [43] | 26.1000 | 0.8102 | 0.1838 | 0.1234 | 4.5837 | 59.3054 | 0.3505 | 32.9875 | 0.4092 | 35.4650 |
| ViTDeblur (TCI’24) [31] | 26.1209 | 0.8187 | 0.2009 | 0.1303 | 4.7617 | 60.7682 | 0.3660 | 34.4846 | 0.4037 | 38.8199 |
| Swintormer⋆ (ICASSP’25) [9] | 25.8700 | 0.8201 | 0.1911 | 0.1228 | 4.6015 | 60.7700 | 0.3661 | 37.3643 | 0.4462 | 33.1271 |
| GenRefocus (arXiv’25) [36] | 23.9342 | 0.7230 | 0.1686 | 0.0843 | 4.1277 | 63.4728 | 0.4449 | 22.5078 | 0.5290 | 31.0665 |
| FlashReFocus () | 24.6061 | 0.7347 | 0.1718 | 0.0980 | 4.6871 | 60.3919 | 0.3724 | 21.3672 | 0.5051 | 36.1772 |
| FlashReFocus + Refiner () | 25.3699 | 0.7814 | 0.1557 | 0.0870 | 4.5208 | 59.6043 | 0.3576 | 19.4685 | 0.4936 | 33.1274 |
| RealDOF | ||||||||||
| IFAN (CVPR’21) [25] | 24.7069 | 0.7611 | 0.3040 | 0.1687 | 6.0264 | 33.0571 | 0.2145 | 49.3803 | 0.2293 | 32.2959 |
| Restormer⋆ (CVPR’22) [73] | 25.0813 | 0.7791 | 0.2863 | 0.1573 | 6.0189 | 37.4911 | 0.2420 | 52.7651 | 0.2899 | 27.5180 |
| DRBNet (CVPR’22) [48] | 25.7426 | 0.7818 | 0.2551 | 0.1312 | 5.2477 | 36.3471 | 0.2236 | 38.9563 | 0.2277 | 28.0395 |
| INIKNet (ICCV’23) [43] | 25.3061 | 0.7762 | 0.2866 | 0.1622 | 5.7921 | 33.3927 | 0.2151 | 47.5150 | 0.2896 | 29.1291 |
| ViTDeblur (TCI’24) [31] | 25.1551 | 0.7793 | 0.2950 | 0.1580 | 5.8195 | 34.8663 | 0.2321 | 49.5526 | 0.2771 | 32.3875 |
| Swintormer⋆ (ICASSP’25) [9] | 25.0624 | 0.7874 | 0.2828 | 0.1545 | 5.7826 | 34.7316 | 0.2245 | 49.8921 | 0.3166 | 30.2399 |
| GenRefocus (arXiv’25) [36] | 23.4872 | 0.7076 | 0.2447 | 0.1148 | 4.5444 | 42.4468 | 0.2722 | 35.6132 | 0.2912 | 24.2483 |
| FlashReFocus () | 23.7002 | 0.7095 | 0.2527 | 0.1227 | 4.7525 | 44.2995 | 0.2601 | 36.0310 | 0.3342 | 30.3751 |
| FlashReFocus + Refiner () | 24.2544 | 0.7373 | 0.2437 | 0.1187 | 5.0235 | 38.8832 | 0.2271 | 34.6319 | 0.2894 | 28.8223 |
Table 1. Defocus deblurring on DPDD and RealDOF. Regression-based restorers lead PSNR, GenRefocus leads DISTS and FID, and FlashReFocus with the refiner achieves the best LPIPS and BRISQUE on both datasets. ⋆Retrained on DPDD.
| Methods | PSNR↑ | SSIM↑ | MS-SSIM↑ | LPIPS↓ | LPIPS↓ | DISTS↓ | CLIP-I↑ | CLIPIQA↑ | MUSIQ↑ | MANIQA↑ | LVCorr↑ |
| EBB! Val176 [22] | |||||||||||
| DeepLens (TOG’18) [63] | 23.42 | 0.8707 | 0.8716 | 0.2254 | 0.3092 | 0.1157 | 0.9562 | 0.2903 | 49.72 | 0.2830 | 0.8866 |
| MPIB (ECCV’22) [39] | 24.10 | 0.8860 | 0.8922 | 0.2172 | 0.3089 | 0.1309 | 0.9630 | 0.4046 | 51.47 | 0.3149 | 0.6056 |
| BokehMe (CVPR’22) [38] | 24.52 | 0.8929 | 0.9007 | 0.2020 | 0.2968 | 0.1235 | 0.9696 | 0.4063 | 50.52 | 0.3136 | 0.7879 |
| Dr.Bokeh (CVPR’24) [52] | 24.13 | 0.8856 | 0.8904 | 0.2187 | 0.3114 | 0.1357 | 0.9644 | 0.3793 | 47.74 | 0.3026 | 0.6905 |
| Bokehlicious# (ICCV’25) [50] | 23.74 | 0.8561 | 0.8723 | 0.2354 | 0.3051 | 0.1585 | 0.9398 | 0.2656 | 28.47 | 0.2595 | 0.8473 |
| BokehDiff# (ICCV’25) [78] | 23.87 | 0.8568 | 0.8745 | 0.2137 | 0.3110 | 0.1182 | 0.9636 | 0.3981 | 55.34 | 0.3240 | 0.8281 |
| GenRefocus (arXiv’25) [36] | 23.80 | 0.8680 | 0.8815 | 0.2025 | 0.2860 | 0.1111 | 0.9644 | 0.3120 | 47.60 | 0.2880 | 0.6898 |
| MagicBokeh (CVPR’26) [53] | 23.14 | 0.8441 | 0.8629 | 0.2398 | 0.3334 | 0.1445 | 0.9331 | 0.4152 | 57.40 | 0.3241 | 0.7987 |
| AnyBokeh (NeurIPS’26) [19] | 22.81 | 0.8611 | 0.8902 | 0.2291 | 0.3164 | 0.1308 | 0.9416 | 0.3196 | 50.55 | 0.3162 | 0.6720 |
| FlashReFocus | 24.52 | 0.8917 | 0.9032 | 0.1805 | 0.2671 | 0.1039 | 0.9725 | 0.3534 | 50.86 | 0.3067 | 0.8570 |
| 3CReal | |||||||||||
| DeepLens (TOG’18) [63] | 25.97 | 0.8500 | 0.8933 | 0.2865 | 0.3539 | 0.1557 | 0.9626 | 0.3055 | 41.22 | 0.2794 | 0.8746 |
| MPIB (ECCV’22) [39] | 27.10 | 0.8759 | 0.9269 | 0.2643 | 0.3511 | 0.1631 | 0.9738 | 0.4180 | 43.42 | 0.3077 | 0.6367 |
| BokehMe (CVPR’22) [38] | 27.58 | 0.8835 | 0.9342 | 0.2471 | 0.3389 | 0.1569 | 0.9761 | 0.4183 | 43.52 | 0.3094 | 0.7768 |
| Dr.Bokeh (CVPR’24) [52] | 26.64 | 0.8713 | 0.9202 | 0.2830 | 0.3652 | 0.1772 | 0.9682 | 0.4032 | 39.44 | 0.3009 | 0.7137 |
| Bokehlicious# (ICCV’25) [50] | 26.72 | 0.8528 | 0.9090 | 0.2836 | 0.3298 | 0.1768 | 0.9630 | 0.3072 | 29.90 | 0.2833 | 0.6677 |
| BokehDiff# (ICCV’25) [78] | 25.80 | 0.8115 | 0.8610 | 0.3112 | 0.3791 | 0.1589 | 0.9566 | 0.4085 | 46.97 | 0.3102 | 0.7972 |
| GenRefocus (arXiv’25) [36] | 26.38 | 0.8528 | 0.9218 | 0.2426 | 0.3185 | 0.1493 | 0.9715 | 0.2928 | 37.66 | 0.2893 | 0.6658 |
| MagicBokeh (CVPR’26) [53] | 25.64 | 0.8329 | 0.8957 | 0.2543 | 0.3506 | 0.1553 | 0.9430 | 0.3920 | 48.52 | 0.3190 | 0.7589 |
| AnyBokeh (NeurIPS’26) [19] | 24.74 | 0.8388 | 0.9196 | 0.2298 | 0.3142 | 0.1378 | 0.9543 | 0.3227 | 43.03 | 0.3157 | 0.6719 |
| FlashReFocus | 27.98 | 0.8855 | 0.9375 | 0.2178 | 0.3004 | 0.1368 | 0.9807 | 0.3482 | 43.06 | 0.3043 | 0.8391 |
Table 3. Zero-shot bokeh rendering on EBB! Val176 and 3CReal. LVCorr correlates strength with rendered blur (negative Laplacian variance) on LFDOF (top) and 3CReal (bottom; first 20 scenes for GenRefocus and AnyBokeh). # Uses its own focus strategy (App. E).
Evaluation protocol. Baselines use released weights, except Restormer and Swintormer, retrained on DPDD with official code. We evaluate deblurring on aligned DPDD regions and RealDOF outdoor scenes. Bokeh methods receive the same AiF input and annotated focal point when
supported; # denotes the official focus strategy otherwise. Each method’s strength is selected by SSIM to the target, so all methods are compared at their best-matching strength. Stage-I settings (the refiner and ) minimize the rank sum over PSNR, LPIPS, DISTS, and FID on data used neither for training nor in Table 1: the DPDD validation split, 50 LFDOF test scenes (reused in App. H; in-domain for Stage I), and 60 RealBokeh validation pairs at .
Training protocol. Stage I adapts Stable Diffusion 2.1 [46] through pixel, detail, and decoder-refinement phases. Stage II uses synthetic multi-focal pre-training followed by RealBokeh adaptation. Full training and inference settings for both stages are given in App. E.
Metrics. For deblurring, we report PSNR, SSIM [66], LPIPS [75], DISTS [11], and FID [16], along with the no-reference metrics NIQE [35], MUSIQ [23], MANIQA [68], BRISQUE [34], and CLIPIQA [62]. For bokeh rendering, we additionally report MS-SSIM [65], LPIPS with VGG features, CLIP-I [44], and LVCorr [15], the correlation between the strength setting and rendered blur.
Defocus Deblurring
Comparison with prior work. In Table 1, FlashReFocus with the refiner achieves the best LPIPS and BRISQUE and the second-best DISTS on both DPDD and RealDOF. Without the refiner, it leads MUSIQ and CLIPIQA on RealDOF. GenRefocus achieves the best FID, while regression-based restorers attain the highest PSNR, consistent with their pixel-wise objectives. Overall, FlashReFocus best balances fidelity and perceptual quality, exceeding GenRefocus by 1.44 and 0.77 dB PSNR on DPDD and RealDOF while requiring 165× fewer TFLOPs for restoration (Table 2).
| Method | Params↓ (M) | Time↓ (s) | TFLOPs↓ | Mem.↓ (GiB) |
| IFAN | 10.48 | 0.08 | 1.85 | 4.37 |
| Restormer | 26.13 | 1.37 | 11.15 | 20.01 |
| DRBNet | 11.69 | 0.14 | 3.19 | 7.02 |
| INIKNet | 1.98 | 0.62 | 5.52 | 9.28 |
| ViTDeblur | 121.60 | 5.65 | 42.78 | 1.60 |
| Swintormer | 194.12 | 321.57 | 10,179 | 4.04 |
| GenRefocus | 17,102.40 | 147.05 | 17,298 | 37.24 |
| FlashReFocus () | 1,290.32 | 0.72 | 53.9 | 9.43 |
| FlashReFocus () + Refiner | 1,363.24 | 1.64 | 104.8 | 19.29 |
Table 2. Deblurring inference cost at 1536 × 1536.
A low FID and faithful recovery of a particular photograph are distinct criteria: GenRefocus leads FID but changes the face in Figure 6, where FlashReFocus better retains the subject’s identity and appearance.

Figure 6. Deblurring on DPDD (a) and RealDOF (b). GenRefocus alters the face and newspaper in (a).
Ablation. Table 4 cumulatively modifies the official PiSA-SR recipe (4K pixel iterations at rank 4), trained on our data. Our pixel phase jointly increases training length and adapter rank: LPIPS falls on both datasets and RealDOF MUSIQ rises from 37.94 to 44.30. The refiner brings outputs closer to the paired target, raising PSNR by 0.90 dB and 0.84 dB on DPDD and RealDOF, while MUSIQ decreases. Increasing then improves LPIPS at some PSNR cost. Figure 13. These trends support separate controls for structural fidelity and perceptual detail: decoder guidance and detail strength affect the fidelity–detail balance differently.
| Pix. | Ref. | \multicolumn{3}{c | }{DPDD} | \multicolumn{3}{c | }{RealDOF} | |||
| PSNR↑ | LPIPS↓ | MUSIQ↑ | PSNR↑ | LPIPS↓ | MUSIQ↑ | |||
| × | × | × | 24.57 | .177 | 60.08 | 23.77 | .260 | 37.94 |
| ✓ | × | × | 24.61 | .172 | 60.39 | 23.70 | .253 | 44.30 |
| ✓ | × | ✓ | 25.51 | .167 | 59.07 | 24.54 | .248 | 37.35 |
| ✓ | ✓ | ✓ | 25.37 | .156 | 59.60 | 24.25 | .244 | 38.88 |
Table 4. Deblurring ablation on DPDD and RealDOF. Cumulative additions to PiSA-SR: our pixel phase (Pix.), decoder refiner (Ref.), and . Here × under denotes 1. Each addition lowers LPIPS on both datasets.
Figure 13. Detail weight control. Increasing from 0 to 1.25 reveals more detail in the RealDOF LED grid and plate holes.
Controllable Bokeh Rendering
Comparison with prior work. In Table 3, FlashReFocus achieves the best MS-SSIM, LPIPS, LPIPS, DISTS,
and CLIP-I on both EBB! and 3CReal, as well as the best PSNR and SSIM on 3CReal; its EBB! PSNR ties BokehMe. Relative to the next-best result for each metric, it reduces EBB! LPIPS from 0.202 to 0.181 and DISTS from 0.111 to 0.104; on 3CReal, it improves PSNR by 0.40 dB and reduces LPIPS from 0.230 to 0.218. These gains concern agreement with captured bokeh; no-reference IQA ranks other methods higher. Figure 9 shows subject preservation and background blur, including the railing and leaves highlighted in the insets. Its LVCorr of 0.857/0.839 also exceeds every diffusion-based method (at most 0.828/0.797), so its blur follows the strength control more faithfully.

Figure 9. Bokeh rendering on EBB! Val176. The insets show the background railing (red) and foreground leaves (green), both blurred in the reference.
Controllability. The sharp region follows focus (Figure 10), and higher strength increases background blur (Figure 12a). On MODEST, SSIM-selected strengths never decrease as the aperture opens in 16 of 17 series (mean per-series Spearman with inverse -number; App. § 12.0.0.2).

Figure 10. Focal control. The same all-in-focus input is rendered as the focal point (green marker) moves from the nearest stones to the distant trees; the rightmost panel shows the estimated depth. The sharp region follows the selected depth while the rest blurs.

Figure 12. Controls beyond the focal point. (a) With the focal point fixed (green marker), increasing the strength from to enlarges the background blur (green box), as a wider aperture would, while preserving the sharp subject (red box). (b) A vertical depth ramp keeps the band at face height and the receding wall (red box) sharp while blurring the shirt (green box).
The tilt-shift edit (Figure 12b) shows a broader property: the control map can specify where sharpness should remain even when its pattern no longer corresponds to the original scene depth. The depth-derived representation thus describes a desired blur field, letting one renderer serve focal choices and designed effects like tilt-shift (App. § 12.0.1).
Ablation. The training ablation in Table 5 favors complementary supervision: combining synthetic focal variation with real adaptation outperforms training on either source alone. This is consistent with learning broad defocus relationships before fitting real lens appearance. With training held fixed, defocus-bias attention adds 0.084 dB PSNR and reduces LPIPS by 0.005 relative to relative-position attention. The added gain supports explicitly shaping feature exchange even when the control map is already available to the feature branch. Replacing the depth estimator changes PSNR by dB on these benchmarks (App. § 12.0.0.2).
| Variant | PSNR↑ | SSIM↑ | MS-SSIM↑ | LPIPS↓ | DISTS↓ | CLIP-I↑ |
| RealBokeh only | 27.2844 | .8642 | .9173 | .2505 | .1389 | .9734 |
| Hypersim only | 27.4598 | .8815 | .9324 | .2513 | .1637 | .9759 |
| Uniform fine-tuning | 27.9383 | .8850 | .9363 | .2254 | .1416 | .9802 |
| Differential LR | 27.9815 | .8855 | .9375 | .2178 | .1368 | .9807 |
| Relative-position attn. | 27.8976 | .8838 | .9362 | .2232 | .1386 | .9800 |
| Mixed attention | 27.9555 | .8845 | .9375 | .2211 | .1390 | .9811 |
| Defocus-bias attention | 27.9815 | .8855 | .9375 | .2178 | .1368 | .9807 |
Table 5. Bokeh ablation on 3CReal. The upper block compares renderer training strategies; the lower block compares attention biases with the same training data and schedule, showing that both of our choices lead on most metrics.
Interactive Refocusing
Editing cost. After warm-up on one RTX PRO 6000, refocusing at takes 2.45 s and 16.84 GiB peak
memory (Table 6). Reusing and depth reduces subsequent edits to 0.46 s. MagicBokeh renders in 6.13 s. AnyBokeh estimates defocus in 8.00 s and renders in 183.38 s.
| Method | Params↓ (B) | Time (s)↓ First | Time (s)↓ New focus | TFLOPs↓ First | TFLOPs↓ New focus | Mem.↓ (GiB) |
| DiffCamera | 12.33 | 136.35 | 136.35 | 19,363 | 19,363 | 28.37 |
| GenRefocus | 18.30 | 370.65 | 217.32 | 42,061 | 24,763 | 42.82 |
| AnyBokeh | 12.09 | 191.38 | 183.38 | 25,368 | 24,240 | 24.93 |
| BokehDiff† | 3.83 | — | 3.43 | — | 73.4 | 11.82 |
| MagicBokeh† | 1.73 | — | 6.13 | — | 113 | 5.29 |
| FlashReFocus | 1.70 | 2.45 | 0.46 | 113 | 0.85 | 16.84 |
Table 6. Refocusing cost at . First: restoration plus first edit; New focus: subsequent edits. †Rendering only.
Consistency across consecutive edits. With out-of-focus blur matched over eight focal settings on three 3CReal scenes (long side 1024), in-focus PSNR against the fixed AiF input is 44.4 dB versus GenRefocus’s 29.0 dB (App. § 12.0.1). Consecutive edits also remain more consistent over regions whose requested blur barely changes (App. § 12.0.1). Unlike regeneration, our explicit map edits one fixed reconstruction, so each edit mainly changes the requested blur (Figure 11). In contrast, GenRefocus over-generates detail: the horse, now out of focus, keeps sharp strands, and the cliff gains exaggerated rock texture not in the input.

Figure 11. Refocusing to the background. FlashReFocus recovers detail in the cliff (red box) while blurring the horse (green box).
Complete refocusing. To further evaluate complete refocusing, we compare methods on 50 LFDOF [47] light fields: one defocused focal slice is the input, and another slice of the same scene is the target. Each method refocuses at an annotated focal point, with strength selected by SSIM as in Table 3. FlashReFocus leads the best baseline, an INIKNet+BokehMe cascade, by 0.89 dB PSNR and 0.023 LPIPS, and raises MUSIQ from 40.4 to 49.1 (App. § 12.0.1), showing that our two-stage design also produces accurate refocused images with realistic, fine-grained detail.
Conclusion
We presented FlashReFocus, which restores an AiF image once with one-step diffusion and renders each focal edit with a lightweight defocus-aware network. Reusing this shared reconstruction keeps in-focus content stable across edits, and the explicit defocus map supports focal, strength, and spatial control in seconds. Across deblurring, cross-camera bokeh rendering, and light-field refocusing, FlashReFocus best balances fidelity and perceptual quality.
Acknowledgments
This study was supported in part by the National Science and Technology Council (NSTC), Taiwan, under grants 115-2627-M-006-001, 115-2218-E-A49-023, and 115-2634-F-A49-014. We thank the National Center for High-performance Computing (NCHC) of National Applied Research Laboratories (NARLabs) in Taiwan for providing computational and storage resources.
LLM Usage Statement
We used large language model (LLM) assistants for language editing of the manuscript, for LaTeX formatting and layout, and for help writing and debugging code for data processing, baseline inference, evaluation, and timing. The LLMs did not originate the research questions, the method, or the claims of this paper. The authors designed the method and the experiments, checked all code, numbers, and text against the actual results, and take full responsibility for the content of this paper.
Defocus Image Formation
This section summarizes the thin-lens and disk-blur approximations underlying the defocus control signal and synthetic supervision. For focal length , object distance , and image distance ,
When the camera focuses at , the sensor lies at , where . A point at another depth forms a circle of confusion (CoC) with approximate diameter
where is the aperture diameter, the depth at pixel x, and converts CoC size to a pixel radius. The inverse-depth dependence makes equal depth offsets on opposite sides of the focal plane produce different blur sizes. Under the disk approximation,
where is a disk kernel and its support. This approximation omits aperture shape, lens aberrations, occlusion, and in-camera processing such as tone mapping.
Restoration Implementation Details
Conditioning and Data Preparation
Inference. Stage I follows PiSA-SR [56] using Stable Diffusion 2.1 [46]. The U-Net runs at timestep 1 with an empty prompt, and the VAE encoder uses its posterior mode. The resulting AiF image is reused for every subsequent edit and for depth estimation.
Detail weight. The detail weight in Eq. (5) blends two noise predictions rather than LoRA weights: because the detail LoRA is trained on top of the frozen pixel LoRA within a nonlinear U-Net, scaling its weights by would not reproduce the prediction blend. The adjustable mode of PiSA-SR therefore computes and with two U-Net evaluations at the same timestep when , a one-time cost per photograph rather than per edit.
LoRA placement. LoRAs adapt the convolution, attention, and feed-forward projections of the U-Net and the convolution and attention layers of the VAE encoder. Training starts from the released PiSA-SR LoRAs: the rank-4 pixel LoRA exactly fills the first four ranks of the rank-16 adapter, preserving the released scaling.
Distillation. CSD [72] uses the frozen model as a teacher with guidance scale 7.5 and timesteps from 20 to 500. Its prompt contains the 50 highest-scoring RAM++ tags [21] of the sharp target; its negative prompt adds bokeh, shallow depth of field, out of focus, and defocus blur to the official negative prompt. The student uses an empty prompt for half of the samples, matching inference.
Data sources. Figure B.1 summarizes the four sources: 350 DPDD training pairs [1] captured at , 4,179 filtered RealBokeh pairs [50] with blurred inputs at –, 11,261 LFDOF training pairs [47], and 639 sharp DIV2K images [3] for synthetic blur, totaling 16,429 samples. They are sampled with probabilities 0.3, 0.2, 0.3, and 0.2, respectively (Fig. B.1E).
Filtering. We rank RealBokeh scenes by the Laplacian variance of their small-aperture () images and retain the top 1,000 to reduce residual defocus in the targets. We also manually exclude DIV2K images with visible defocus and use the central 60% of each remaining image to generate synthetic pairs with Eq. (6).
Synthetic blur. To diversify the synthetic blur, we uniformly sample one kernel type per image from disk, Gaussian, and motion, apply it at radii of 1, 5.5, and 10 pixels, and blend the results with spatial weights . These weights follow a randomly sampled map : a vertical, horizontal, or diagonal ramp in either direction, a radial ramp from or toward the center, or a uniform map, min–max normalized to [0, 1] where nonconstant. The weights are tent functions centered at and normalized to sum to one, interpolating between adjacent blur levels.
Figure B.1. Mixed deblurring data. (A) DPDD provides real lens blur from a single camera. (B) RealBokeh pairs, reversed for deblurring and filtered to the 1,000 scenes with the sharpest targets, add strong real blur. (C) LFDOF provides pixel-aligned pairs refocused from light fields. (D) Synthetic DIV2K pairs use disk, Gaussian, or motion kernels with a random gradient map , providing exact alignment and spatially varying blur. (E) A source is sampled with the listed probability to (F) produce a pair .
High-Frequency Decoder Guidance
Figure 5 of the main paper isolates reconstruction errors introduced by VAE encoding and decoding; Figure B.2 shows the decoder guidance used to reduce these errors.

Figure 5. Detail lost in VAE reconstruction. Encoding and decoding with the original VAE degrade text and fine textures, as shown by the error maps and enlarged crops.
To identify input detail that may be lost in the latent representation, we compute a high-frequency map with a single-level Laplacian pyramid:
where is a Gaussian kernel with , denotes convolution, keeps every second pixel, denotes bi-linear upsampling, and the absolute value is averaged over color channels. The degraded image and high-frequency map are concatenated and encoded as
where is a convolution producing 32 channels followed by two NAFNet blocks [10]. We bilinearly re-size to each decoder resolution. After each decoder up-block that matches an input VAE-encoder feature (, from the input convolution and first two down-blocks), a fusion module concatenates the encoder and decoder features and projects them back to the decoder width with a convolution. It then appends , applies two NAFNet blocks, and adds the result through a zero-initialized convolution. This initialization preserves the original decoder output at the start of refiner training.
Input features may contain defocus, but supervision against the sharp target penalizes transferring that blur to the output. The map is typically weak in defocused regions and strong on in-focus edges and text, guiding fusion toward detail retained in the input. To reduce sensitivity to color shifts between real pairs, the structure term in Eq. (7) is
where the color matrix and offset are fitted per image to by ridge-regularized least squares (weight ). They are treated as constants during back-propagation, allowing the loss to emphasize structural discrepancies after global color alignment. The main paper evaluates the refiner’s fidelity–perception trade-off; Appendix F provides further examples and failure cases.
Rendering Implementation Details
Defocus-Bias Attention
We expand on the attention computation in § 3.1.1. For token feature ,
where , , and are learned per-head projections; we omit the head index below. Separately, encodes the defocus magnitude using fixed logarithmic features , with logarithmically spaced from to 1. These features are finite at and are mapped to one value per head by a learned linear layer, defining the pairwise bias
Figure B.2. Input-guided decoder refiner. (A) Multi-scale encoder features, (B) a high-frequency map, and (C) structure features of guide (D) the decoder as it reconstructs the Stage-I latent . Encoder features are fused at matching decoder resolutions. The fusion modules and decoder are trained with while the rest of Stage I remains frozen. is contrast-enhanced for display.
where and are tokens at positions and . Attention is then
where is the key dimension and is a learned per-head scale initialized to 1. Although unconstrained, all 27 learned values lie in [0.75, 1.77], so the trained bias penalizes differences in the defocus embedding. The positive scale depends on the global strength through learned per-head parameters and ; the main paper denotes by . To reduce the cost of full spatial attention, we use axial attention [17], as in Bokehlicious: attention is applied along rows and then columns, with ranging over one row or column. Before the output projection , we add locally enhanced positional encoding (LePE), a depthwise convolution over the value map :
Renderer topology. The renderer has 1.30M parameters.
Input embedding. Two convolutions embed the mean-subtracted , , and a strength map into 16 feature channels at full resolution.
Encoder. A two-level U-shaped NAFNet follows, with one block per encoder level (16 and 32 channels), each followed by a stride-2 convolution that doubles the width, and a bottleneck at resolution.
Decoder. The decoder has two and four NAFNet blocks at 32 and 16 channels, respectively, with pixel-shuffle up-sampling and additive skip connections from the encoder.
Conditioning. Every NAFNet block reads a resized .
Bottleneck. The bottleneck projects 64 channels to 96, fuses , and applies three DRGs. Each DRG contains three DAABs (three heads, MLP ratio 2, stochastic depth up to 0.1), followed by a convolution over the features and and a residual connection. All 27 attention heads use the bias above with resized to the bottleneck.
Output. A final convolution over features and predicts the residual added to .
Attention visualization.
Procedure. Figure C.1 isolates the effect of the bias by comparing each block’s attention with and without the bias term while keeping its queries, keys, and values fixed. For a query , the effective axial weight of token is , the product of its column and row attention weights, averaged over the nine DAABs and three heads (27 heads in total).
Qualitative effect. In these examples, the bias shifts attention toward tokens of similar blur: background queries attend less to the in-focus subject, and subject queries attend less to the blurred background. This soft preference reduces attention across different blur levels without imposing a hard mask on the attention weights.
Similar-blur mass. Across the 89 3CReal images, resized to a long side of 1024 and rendered at the annotated
focal point with , the mean attention mass on tokens of similar blur () rises from 0.40 to 0.64 (16 sampled queries per image).
Focal-plane side. Because the bias reads the unsigned , it does not explicitly encode focal-plane side. For the 249 sampled queries with and similar-blur tokens on both sides, adding the bias raises the mean attention mass on such tokens from 0.229 to 0.450 on the same side and from 0.086 to 0.120 on the opposite side. Focal-plane-side information is provided separately through and in .
Preservation of in-focus regions.
Residual magnitude. Figure 8 visualizes the residual added to the restored image. Its magnitude remains small on the in-focus subject across the tested strengths and generally grows elsewhere with defocus magnitude and strength . Over the 89 3CReal images, rendered as above, the mean is 0.7–1.8/255 where for from 0.25 to 1, compared with 6–17/255 at the largest defocus. Thus, in-focus content remains nearly unchanged across all tested strengths.
Defocus embedding. The learned embedding also allocates more of its range near focus: it reaches half of its range at (median over the 22 of 27 heads with an embedding range above one), compared with 0.5 for a linear map, giving finer resolution near focus.
Strength scale. grows with most strongly in each DRG’s first DAAB, by up to at .
Depth from the restored image. We evaluate the choice to estimate depth from the restored image (§ 3.1.1) on the 89 shallow-DoF photographs of 3CReal, using depth estimated from their paired deep-DoF captures as a reference. The mean absolute difference from this reference falls from 0.048 for input-derived depth to 0.027 for restoration-derived depth, with improvements in 74 of the 89 views. Figure C.2 illustrates how restoration recovers thin structures obscured by defocus. The reference is depth estimated from the paired deep-DoF captures of the same views.
Synthetic Multi-Focal Supervision
Figure C.3 illustrates synthetic pre-training followed by real-data adaptation. Real pairs offer limited focal diversity, so we independently sample focal depths and blur strengths for RGB-D scenes to generate targets:
where is the BokehMe renderer [38]. We compute from ground-truth depth in meters without per-image normalization. The sampled focal depth and strength define the target, with BokehMe blur parameter . Pre-training uses 59,543 RGB-D frames from 367 Hypersim [45] scenes, each paired with one target at a randomly sampled focal depth and strength. Adaptation uses 20,554 pairs from 3,960 RealBokeh training scenes, with depth from Depth Anything V2 min–max normalized per image as at inference (§ 3.1.1). Following Bokehlicious, we set for a target captured at . Appendix E lists the optimizer settings and augmentation.
| Benchmark | Pairs | Systems | Registration | Seen |
| EBB! Val176 [22] | 176 | 1 | SIFT+RANSAC | No |
| RealBokeh val. | 220 | 1 | Tripod | Yes |
| 3CReal (ours) | 89 | 3 | Tripod+ECC | No |
Table D.1. Real bokeh benchmarks. Each pair shows the same scene at a small and a large aperture. EBB! uses a Canon 7D with a 50 mm lens; RealBokeh uses a Canon EOS R6 II with a 28–70 mm lens [51]. EBB! Val176 is our filtered validation split, and RealBokeh val. is the official validation split (Appendix D.2). Registration specifies the alignment method; Seen indicates optics represented in our renderer’s training data.
Evaluation Data
3CReal Benchmark
We collect 3CReal to evaluate transfer to unseen camera and lens systems (Fig. D.1). The existing real bokeh benchmarks used here pair small- and large-aperture photographs from a single camera and lens system (Table D.1): EBB! [22] uses a DSLR with a 50 mm lens, and RealBokeh [50, 51] uses a Canon EOS R6 II with a 28–70 mm lens. Our renderer is adapted to the RealBokeh training split, so its validation results alone cannot establish cross-camera transfer. 3CReal covers three additional camera and lens systems, with no training pairs from these systems used by the compared methods. We capture campus scenes from a tripod at two aperture settings: a small-aperture exposure provides a deep-DoF input, and a large-aperture exposure provides a shallow-DoF target. Automatic ISO and shutter speed reduce exposure differences within each pair.
The three camera–lens systems contribute 89 pairs:
Canon EOS 750D with a Canon EF-S 18–55 mm f/3.5–5.6 IS STM zoom lens, contributing 31 pairs.
FUJIFILM X-E5 with a Viltrox AF 35 mm F1.7 Air lens for FUJIFILM X-mount, contributing 31 pairs.
FUJIFILM X100VI with its built-in Fujinon 23 mm F2 fixed lens, contributing 27 pairs.
The capture and processing steps are as follows:
Apertures. Deep-DoF inputs are captured at (FUJIFILM) or – (Canon), and shallow-DoF targets at – (Table D.2).
Aspect ratio. All images are 3:2 (three in portrait orientation) except eight 16:9 X100VI pairs.

Figure C.1. Effect of the defocus bias on attention. Ratio of effective attention weights with and without the bias for each query (circle), averaged over all attention blocks and heads. Colors use a logarithmic scale from 0.1× (blue) to 10× (red); the white cross marks the focal point. In these examples, the bias shifts attention toward similar blur levels: background queries attend less to the in-focus subject, and subject queries attend less to the blurred background.

Figure C.2. Depth estimation before and after restoration. Depth Anything V2 estimates from a shallow-DoF photograph in 3CReal, its Stage-I restoration, and the paired deep-DoF capture. Brighter regions are nearer.
Alignment. To correct residual global shifts, we use Enhanced Correlation Coefficient alignment [12] with a translation-only model to warp the deep-DoF input onto the shallow-DoF target, so targets are never resampled.
Cropping. We crop to the shared valid region and remove black padding, using the same cropping rule within each camera system. Table D.2 lists the resulting sizes.
Content. The scenes cover indoor and outdoor layouts, specular highlights, thin structures, and depth boundaries. None of these scenes is used for training.
All aligned crops are manually inspected. Residual exposure differences, vignetting, independently moving objects, and aperture-dependent occlusion can remain, as ECC corrects only global geometric shifts. We therefore interpret full-reference scores alongside visual comparisons. Figure D.2 provides additional paired examples.
| System | Pairs | Deep / shallow DoF | Post-processed size |
| 750D / 18–55 mm | 31 | –36 / –5.6 | 2966×1974 |
| X-E5 / 35 mm | 31 | / –5.6 | 1900×1256 |
| X100VI / 23 mm | 27 | / * | 1916×1272, 2032×1135 |
| Total | 89 | – | – |
Table D.2. 3CReal composition. Pair counts, EXIF apertures for deep-/shallow-DoF exposures, and processed image sizes (width×height; dimensions are transposed for the three portrait pairs), by camera and lens system. *Apertures are unknown for eight 16:9 X100VI pairs without EXIF metadata.
Other Evaluation Data
EBB! Val176.
Split. We use the EBB! validation split because its official test set is not publicly available. None of the evaluated methods is trained on the EBB! training set.
Capture. Pairs are captured in the wild in automatic mode with a Canon 7D DSLR and a 50 mm lens, at for the sharp image and for the bokeh image [22]. The authors register the exposures with SIFT and RANSAC, crop to their intersection, and downscale to a height of 1024 pixels. Viewpoint changes, exposure differences, black borders, and misalignment can remain.
Filtering. We identify mismatched pairs with SIFT matching [32] and RANSAC verification [14], then visually exclude them, leaving 176 pairs (EBB! Val176).
RealBokeh. We evaluate to rendering on 219 of the 220 validation scenes [50] at 2000 × 1500, using annotated focal points (Table G.1). We exclude scene 200, a night photograph of string lights with no in-focus structure for a focal point. The edit-consistency study (Appendix § 12.0.1) uses captures from the test split. Both splits are disjoint from our renderer’s training pairs but share their camera and lens, testing in-domain performance.
Figure C.3. Two-phase renderer training. (A) Pre-training on synthetic multi-focal Hypersim scenes, where each sampled focal depth and strength gives a new aligned target rendered by BokehMe. (B) Fine-tuning on RealBokeh pairs, with a larger learning rate for the defocus-attention parameters than for the rest of the renderer.
MODEST. MODEST [59] captures each scene at several -numbers. For aperture control, we use its camera-A 70 mm captures, pairing an input with , , , and targets from the same viewpoint, resized to a long side of 1536. We keep series with aligned targets and matching content, yielding 17 series from six scenes. The focal point lies in the sharpest region of the image.
In-the-wild images. We use unpaired Unsplash photographs [60] only for qualitative comparisons, alongside our own iPhone 15 and Canon EOS 750D captures.
Experiment Settings
Baselines. We use released weights and official inference settings for all baselines except Swintormer [9] and Restormer, which we retrain on DPDD using their official code and settings. Unless otherwise specified, deblurring outputs are evaluated at the reference resolution.
Bokeh rendering. Comparisons use these settings:
Focal points. We manually annotate focal points for EBB! Val176, 3CReal, and RealBokeh and share them across methods that accept this input. The two methods marked # do not accept a focal point. Under its official inference procedure, BokehDiff focuses at the median disparity within a BiRefNet foreground mask, which contains the annotated point in 162 of the 176 EBB! Val176 images. Bokehlicious controls only the aperture.
Auxiliary inputs. Auxiliary depth, disparity, and masks follow each method’s official inference settings. All outputs are kept at native resolution for evaluation.
Strength search. To account for different strength scales, we search within each method’s predefined range and evaluate the output with the highest SSIM to the target. Table E.1 lists the strength parameters and searches.
AnyBokeh. AnyBokeh [19] uses its official inference procedure: Stage 1 processes the whole image at 512 pixels, and Stage 2 processes overlapping 512-pixel tiles at full resolution, with 20 steps and guidance 30. Its strength is the bokeh scale used for optical fingerprint transfer, defined as the ratio of input and target -numbers. We initialize this scale from EXIF ( to on EBB!; pair on 3CReal, with to used for the eight X100VI pairs without EXIF), then multiply or divide it by while SSIM improves. This tuning substantially affects AnyBokeh: using the EXIF ratio alone, as in its paper, yields 22.27 dB PSNR and 0.2692 LPIPS on EBB! Val176 and 24.08 dB and 0.2796 on 3CReal; tuning improves these to 22.81 dB and 0.2291, and 24.74 dB and 0.2298, respectively.
End-to-end refocusing. For qualitative comparisons with the DiT-based DiffCamera [64] and GenRefocus [36], we resize each input to a shorter side of 768 pixels while preserving its aspect ratio. All methods receive the same resized input. DiffCamera requires square inputs, so we reflection-pad rectangular images to a square and remove the padding afterward to restore the original size.
Figure D.1. 3CReal collection. Campus scenes are photographed from a fixed tripod with three camera and lens systems (top), at small and large apertures with automatic exposure (bottom). ECC alignment, cropping, and manual inspection (middle) yield 89 aligned pairs (right). Camera and tripod photos from Wikimedia Commons: Canon EOS 750D by Badhon7010 (CC BY-SA 4.0), tripod by Andrés Nieto Porras (CC BY-SA 2.0), FUJIFILM cameras CC0.
| Method | Strength | Search |
| DeepLens | aperture | interval shrinking, 8 iterations |
| MPIB | ternary, 10 iterations | |
| BokehMe | binary | |
| Dr.Bokeh | interval halving, 6 steps | |
| Bokehlicious | binary | |
| BokehDiff | binary | |
| GenRefocus | binary | |
| MagicBokeh | binary | |
| AnyBokeh | scale , | from EXIF while SSIM rises |
| FlashReFocus | binary |
Table E.1. Strength search for each method (Table 3). The searches assume SSIM is unimodal with respect to strength and retain the best evaluated value.
Efficiency. We measure computational cost at on one NVIDIA RTX PRO 6000 GPU as follows:
Inference settings. Each method uses its official settings, including any patch- or tile-based inference.
Parameters and FLOPs. Parameter counts include every model loaded by a method. PyTorch’s FLOP counter measures FLOPs, counting a multiply-add as two and excluding element-wise operations. For diffusion methods, it covers denoising and VAE encoding and decoding.
Deblurring time. Deblurring time (Table 2) excludes disk I/O and is averaged over runs after warm-up.
Refocusing cost. In Table 6, FlashReFocus runs its optimized inference path (refiner in fp16, channels-last layout), which also lowers Stage-I peak memory, and each call reads its input and writes a PNG, as in interactive use. New focus denotes each additional focal edit on the same image. FlashReFocus estimates depth from the restored image once and reuses it; its reported memory is the joint peak of both stages, as both models stay loaded.
Metrics. We report the following metrics:
Full-reference metrics. We use PSNR, SSIM [66], LPIPS [75], and DISTS [11] for both stages. Following GenRefocus [36], bokeh rendering and refocusing additionally use MS-SSIM [65], VGG-based LPIPS, and CLIP-I, the cosine similarity between CLIP ViT-L/14 [44] image embeddings of output and reference.
No-reference metrics. Deblurring uses NIQE [35], MUSIQ [23], MANIQA [68], BRISQUE [34], and CLIP-IQA [62], plus FID [16]; bokeh rendering uses CLIPIQA, MUSIQ, and MANIQA, which need no reference.
Controllability. We measure blur-strength controllability with LVCorr [15] under the GenRefocus protocol [36]. For each all-in-focus image and a fixed focal point, a method renders ten strengths evenly spanning its own range. LVCorr is the Pearson correlation between strength and rendered blur, measured as negative Laplacian variance, averaged over scenes. We use the 50 LFDOF [47] test scenes and 89 3CReal inputs, resized to a long side of 1024. For GenRefocus and AnyBokeh, whose renderings each require a full diffusion pass, we use the first 20 scenes of each set. Here, FlashReFocus

Figure D.2. Additional 3CReal pairs. Four aligned pairs per camera system (Canon EOS 750D with an EF-S 18–55 mm f/3.5–5.6 lens, FUJIFILM X-E5 with a Viltrox 35 mm F1.7 lens, and FUJIFILM X100VI with its 23 mm F2 lens). Each deep-DoF input appears above its shallow-DoF target. The targets show lens-specific blur around thin structures, depth boundaries, and backgrounds.
reaches 0.879 (LFDOF) and 0.792 (3CReal), versus 0.690 and 0.666 for GenRefocus and 0.672 and 0.672 for AnyBokeh.
Implementation details. We implement the framework in PyTorch and train it in half precision as follows:
Stage I. Stage I adapts Stable Diffusion 2.1 [46] using the PiSA-SR recipe and released LoRAs on two NVIDIA RTX PRO 6000 GPUs. The effective batch size is 16 and the learning rate is , with 500 warm-up iterations followed by a constant rate. The pixel phase optimizes
the pixel LoRA, VAE-encoder LoRA, and U-Net input convolution for 20K iterations; the detail phase optimizes only the detail LoRA for another 20K, with , , and CSD guidance 7.5. Inference runs one step on the full, untiled image with .
Decoder refiner. During refiner training, the VAE encoder and U-Net remain frozen. The refiner’s fusion modules and decoder are trained on Stage-I latents in bf16 on crops for 15K iterations, with batch size 4, an initial learning rate of with cosine decay, , and .
Stage II. Stage II is trained on one RTX 4090. Synthetic pre-training uses three Hypersim [45] epochs, batch size 4, and learning rate . Five RealBokeh adaptation epochs follow, using for defocus-attention parameters and for the rest of the network. Both phases use cosine decay, , and .
Augmentation. Both stages use crops with random scaling, horizontal flips, and right-angle rotations; for renderer training, the scale factor is in .
Inference depth. At inference, Depth Anything V2 [67] estimates depth from the restored image for the renderer.
Additional Deblurring Results
Qualitative comparisons. Figures F.1 and F.2 show additional DPDD and RealDOF scenes with rich texture and dense structure. In both, FlashReFocus produces sharper natural textures than the deterministic baselines and fewer content changes than GenRefocus. Small characters and repeated man-made patterns remain susceptible to reconstruction errors. Figure F.6 further evaluates Stage I on shallow-DoF 3CReal photographs captured with unseen lenses, alongside deep-DoF captures of the same views.
Failure cases. Figure F.3 shows oversmoothing and ghosting in heavily defocused foreground regions, where the input provides insufficient structural information. Textureless regions can also acquire web-like patterns from hallucinated high-frequency content. The detail-weight study below examines how these artifacts increase with .
Ablation. The deblurring ablations cover the following:
Cumulative ablation. Table F.1 reports all metrics for the cumulative deblurring ablation of the main paper.
Detail weight. Table F.2 varies on the validation sets. PSNR peaks at –, while LPIPS, DISTS, and FID improve up to –. Beyond this range, all metrics worsen as extrapolated detail hallucinates texture. We use , which minimizes the rank sum.
Detail branch. Figure F.4 localizes the effect of the detail branch: differences between the outputs at and concentrate on bark, foliage, and print and are smaller on smooth surfaces. Over the 76 DPDD test images, the mean absolute difference is 4.3/255. The 20% of pixels with the most texture in the sharp target account for 32.5% of this difference; their error relative to the target decreases from 18.09/255 to 17.66/255, while the smoothest half stays at 7.3/255.
Decoder refiner. Figure F.5 shows that latent encoding and decoding can distort text that is relatively clear in the input. Decoder-side injection of high-frequency features helps recover this structure. Severely blurred characters remain difficult to reconstruct because their shapes cannot be inferred.
Additional Bokeh Results
RealBokeh validation. The RealBokeh validation and training splits share cameras and lenses. Both Bokehlicious and our renderer are trained on the training split, so Table G.1 evaluates in-distribution rendering at the original resolution. Bokehlicious, conditioned on the target aperture, obtains the best full-reference scores. FlashReFocus ranks second on PSNR, MS-SSIM, LPIPS, LPIPS, DISTS, and CLIP-I, as well as MUSIQ. On the ten GenRefocus pairs, FlashReFocus performs better on every metric (PSNR 25.46 vs. 23.38 dB; MUSIQ 47.61 vs. 38.79).
Real apertures. LVCorr measures whether blur increases with the strength setting. We use MODEST to test whether the selected strength also tracks real aperture changes.
Monotonicity. The strength selected for FlashReFocus increases as the aperture opens in 16 of the 17 series and has the highest rank correlation with (, Table G.2), close to the physically based BokehMe (0.979) and above the diffusion-based MagicBokeh (0.903).
SSIM. MagicBokeh’s smallest setting already blurs beyond the target. FlashReFocus’s SSIM is close to BokehMe at small apertures and highest at and among all evaluated methods (Table G.2).
Calibration. Its strength, however, is roughly monotonic rather than linear in (Fig. G.1), unlike the blur radii of BokehMe and DeepLens. Mapping -numbers to strengths therefore requires a per-lens calibration.
Qualitative comparisons. Figure G.4 shows an additional EBB! Vall76 example, Figs. G.5 and G.6 show two 3CReal examples, and Figs. G.7 and G.8 show two RealBokeh validation pairs, including GenRefocus results. These comparisons illustrate subject preservation, highlight appearance, and boundary transitions on real captures. Figure G.2 compares FlashReFocus renderings with real captures from two MODEST aperture series at to .
Ablation. We compare three attention designs:
Full metrics. Table G.3 extends the main-paper ablation with LPIPS-VGG and four-decimal precision.
Mixed variant. The mixed (relative-to-defocus) variant uses relative-position attention in the earlier blocks and defocus-bias attention in the later blocks. It

Figure F.1. DPDD, texture-rich scene. Deblurring results on a DPDD test scene with grass, leaves, and tree bark, alongside the reference. Two crops (red and blue boxes) are enlarged below each result. The deterministic baselines leave the grass blades and bark soft, while FlashReFocus recovers edges and texture closer to the reference.

Figure F.2. RealDOF, dense structure. Deblurring results on a RealDOF outdoor scene with shop signs, window frames, and foliage, using the layout of Fig. F.1. Most methods recover large letters and frames; the crops highlight differences in fine text and repeated structures.

Figure F.3. Failure cases. (a) Grid-like texture and a color shift in a low-texture region, where the diffusion prior introduces unsupported high-frequency content. (b) Oversmoothing and ghosting in a severely blurred foreground subject whose structure is poorly resolved in the input.
| Dataset | Setting | Pix. | Ref. | PSNR | SSIM | LPIPS | DISTS | FID | NIQE | MUSIQ | MANIQA | BRISQUE | CLIPIQA | |
| DPDD | Official PiSA-SR | × | × | × | 24.5703 | 0.7301 | 0.1771 | 0.0968 | 39.6962 | 4.8718 | 60.0842 | 0.3740 | 20.5959 | 0.5246 |
| + our pixel phase | ✓ | × | × | 24.6061 | 0.7347 | 0.1718 | 0.0980 | 36.1772 | 4.6871 | 60.3919 | 0.3724 | 21.3672 | 0.5051 | |
| + refiner | ✓ | ✓ | × | 25.5077 | 0.7902 | 0.1672 | 0.0927 | 34.7355 | 4.6987 | 59.0737 | 0.3526 | 23.2620 | 0.4765 | |
| + | ✓ | ✓ | ✓ | 25.3699 | 0.7814 | 0.1557 | 0.0870 | 33.1274 | 4.5208 | 59.6043 | 0.3576 | 19.4685 | 0.4936 | |
| RealDOF | Official PiSA-SR | × | × | × | 23.7706 | 0.7103 | 0.2598 | 0.1223 | 32.9355 | 5.0129 | 37.9446 | 0.2373 | 38.0189 | 0.3200 |
| + our pixel phase | ✓ | × | × | 23.7002 | 0.7095 | 0.2527 | 0.1227 | 30.3751 | 4.7525 | 44.2995 | 0.2601 | 36.0310 | 0.3342 | |
| + refiner | ✓ | ✓ | × | 24.5441 | 0.7521 | 0.2484 | 0.1200 | 28.4354 | 5.3277 | 37.3479 | 0.2232 | 37.7745 | 0.2775 | |
| + | ✓ | ✓ | ✓ | 24.2544 | 0.7373 | 0.2437 | 0.1187 | 28.8223 | 5.0235 | 38.8832 | 0.2271 | 34.6319 | 0.2894 |
Table F.1. Deblurring ablation with all metrics. Starting from the official PiSA-SR recipe trained on our data, we successively add our pixel phase (Pix.), the decoder refiner (Ref.), and (× under means ). Bold marks the best value per dataset.
ties defocus-bias attention throughout on MS-SSIM and scores marginally higher on CLIP-I (0.9811 vs. 0.9807); defocus-bias attention throughout performs best on the other five metrics and is used in FlashReFocus.
Visual differences. Figure G.3 illustrates differences in highlight halos and low-light blur among the variants.
Depth source. The renderer is trained with depth from Depth Anything V2 Large (DA-V2-L) and receives depth through the normalized map D, allowing alternative estimators to be used at inference without retraining.
Protocol. Table G.4 tests smaller DA-V2 models and Depth Pro [8], the estimator used by GenRefocus, under the protocol of Table 3.
Results. Across a range of depth-model size, PSNR and LPIPS vary by at most 0.21 dB and 0.009. Relative to DA-V2-L, DA-V2-S loses 0.11 dB on 3CReal, while Depth Pro gains 0.10 dB and improves LPIPS and DISTS on both benchmarks, at a higher runtime cost.
Cost. A stronger estimator can improve quality at the cost of a slower first edit: Depth Pro takes as long as DA-V2-L at and has its parameters.
| Depth | Params | 3CReal PSNR | 3CReal LPIPS | 3CReal DISTS | EBB! Val176 PSNR | EBB! Val176 LPIPS | EBB! Val176 DISTS |
| DA-V2-S | 25 | 27.87 | .2232 | .1390 | 24.49 | .1804 | .1026 |
| DA-V2-B | 98 | 27.99 | .2198 | .1373 | 24.51 | .1778 | .1007 |
| DA-V2-L (ours) | 335 | 27.98 | .2178 | .1368 | 24.52 | .1805 | .1039 |
| Depth Pro | 952 | 28.08 | .2145 | .1331 | 24.53 | .1746 | .0983 |
Table G.4. Depth source. The same renderer, trained with DA-V2-L, is evaluated with alternative depth estimators without retraining. Parameter counts are in millions.
Refocusing and Editing
Complete refocusing on LFDOF. Light fields provide aligned refocusing targets from the same capture.
Protocol. Following the LF-Refocus protocol of GenRefocus [36], we use the 50 LFDOF test scenes [47] at the largest aperture. For each scene, one defocused focal slice serves as input and another slice of the same light field serves as target, with a focal point annotated in a sharp target region. Each method refocuses at that point, with strength searched per image to maximize SSIM.
Cascade baseline. We also evaluate a conventional cascade that deblurs with INKNet [43] and renders with BokehMe [38] using MiDaS depth.
| DPDD val | LFDOF test | RealBokeh val60 | Rank | |||||||||||||
| PSNR | LPIPS | DISTS | FID | PSNR | LPIPS | DISTS | FID | PSNR | LPIPS | DISTS | FID | sum | ||||
| 0 | 25.08 | 0.288 | 0.149 | 38.37 | 28.90 | 0.187 | 0.107 | 26.17 | 21.42 | 0.460 | 0.231 | 109.53 | 75 | |||
| 0.5 | 25.27 | 0.234 | 0.121 | 34.75 | 29.22 | 0.144 | 0.084 | 20.07 | 21.54 | 0.413 | 0.203 | 101.57 | 59 | |||
| 0.75 | 25.27 | 0.205 | 0.106 | 32.19 | 29.27 | 0.125 | 0.073 | 17.95 | 21.52 | 0.377 | 0.184 | 93.82 | 48 | |||
| 1 | 25.20 | 0.182 | 0.094 | 30.95 | 29.21 | 0.111 | 0.065 | 16.75 | 21.41 | 0.342 | 0.166 | 87.97 | 39 | |||
| 1.25 | 25.02 | 0.169 | 0.087 | 30.37 | 28.98 | 0.104 | 0.062 | 16.27 | 21.14 | 0.318 | 0.151 | 85.48 | 29 | |||
| 1.5 | 24.65 | 0.170 | 0.086 | 30.34 | 28.54 | 0.105 | 0.063 | 16.63 | 20.65 | 0.308 | 0.144 | 87.91 | 32 | |||
| 1.75 | 24.02 | 0.185 | 0.094 | 32.05 | 27.88 | 0.113 | 0.069 | 18.75 | 20.00 | 0.316 | 0.146 | 93.28 | 54 |
Table F.2. Detail weight on the validation sets. Results use Stage I with the refiner; bold marks the best value per column. Summing ranks over PSNR, LPIPS, DISTS, and FID across all three sets selects .

Figure F.4. Detail branch of Stage I. DPDD crops (red box) from the pixel branch alone (), with the detail branch (), and the reference, alongside the absolute difference between the two outputs over the full image. Difference intensity ranges from 0 (dark) to 20/255 or more (bright).
Results. FlashReFocus performs best on all full-reference metrics except SSIM, where the cascade is 0.003 higher (Table H.1); the cascade trails by 0.89 dB PSNR and 0.023 LPIPS, and its MUSIQ of 40.4 versus 49.1 for FlashReFocus reflects smoother, less detailed output. Figs. H.1 and H.6 show four examples, and the ablations indicate contributions from both stages.
Caveats. Two qualifications apply: Stage I is trained on LFDOF training scenes, so the input domain is familiar, and these 50 test scenes belong to the validation data used to select the refiner and (§ 4). Neither selection used the renderer or refocusing targets.
| Method | PSNR | SSIM | LPIPS | DISTS | CLIP-I |
| Input | 25.97 | .779 | .319 | .152 | .945 |
| DiffCamera [64] | 27.23 | .824 | .204 | .124 | .955 |
| GenRefocus [36] | 26.07 | .840 | .173 | .101 | .961 |
| MagicBokeh [53] | 26.36 | .799 | .234 | .160 | .921 |
| AnyBokeh [19] | 24.82 | .802 | .213 | .129 | .932 |
| INIKNet+BokehMe [38, 43] | 28.50 | .870 | .167 | .111 | .962 |
| FlashReFocus w/o Stage I | 28.46 | .848 | .227 | .142 | .953 |
| FlashReFocus w/o refiner | 27.40 | .814 | .172 | .110 | .962 |
| FlashReFocus | 29.39 | .867 | .144 | .096 | .970 |
Table H.1. Complete refocusing on LFDOF. We evaluate 50 test scenes using two focal slices of each light field as input and target. Strength is searched per image to maximize SSIM. INIKNet+BokehMe deblurs with INIKNet, then renders with BokehMe.
Refocusing examples. The figures cover these cases:
Main-paper examples. For the aperture example (Figure 12a), increasing strength from to lowers background Laplacian variance from 237 to 29 and 11, while the subject retains 65% of its sharpness. For the tilt-shift example (Figure 12b), the vertical depth ramp raises
Figure F.5. Decoder refiner on text. Printed-text crops from the blurred input and the outputs of FlashReFocus decoded with and without the refiner. Plain VAE decoding distorts letters that are legible in the input; the refiner helps recover them by reinjecting high-frequency features from the input. Severely blurred characters remain difficult to reconstruct.

Figure F.6. Deblurring real lens blur. Shallow-depth-of-field 3CReal photographs from three unseen cameras and lenses, restored by Stage I and shown alongside deep-depth-of-field captures of the same views. The red box is enlarged on the right.
| Methods | PSNR↑ | SSIM↑ | MS-SSIM↑ | LPIPS↓ | LPIPSVGG↓ | DISTS↓ | CLIP-I↑ | CLIPIQA↑ | MUSIQ↑ | MANIQA↑ |
| All 219 pairs | ||||||||||
| DeepLens (TOG’18) [63] | 22.86 | 0.8297 | 0.8011 | 0.3245 | 0.3792 | 0.1698 | 0.9416 | 0.3195 | 43.81 | 0.2888 |
| BokehMe (CVPR’22) [38] | 25.68 | 0.9027 | 0.9010 | 0.2275 | 0.3295 | 0.1584 | 0.9627 | 0.4572 | 43.22 | 0.3362 |
| Bokehlicious#† (ICCV’25) [50] | 29.81 | 0.9320 | 0.9568 | 0.1086 | 0.1802 | 0.0697 | 0.9869 | 0.3604 | 42.83 | 0.3225 |
| BokehDiff# (ICCV’25) [78] | 22.92 | 0.8075 | 0.8038 | 0.3312 | 0.3855 | 0.1745 | 0.9401 | 0.4274 | 49.77 | 0.3378 |
| MagicBokeh (CVPR’26) [53] | 22.25 | 0.8267 | 0.8229 | 0.2730 | 0.3578 | 0.1751 | 0.9342 | 0.4026 | 45.54 | 0.3016 |
| FlashReFocus† | 26.38 | 0.8973 | 0.9042 | 0.1932 | 0.2911 | 0.1178 | 0.9701 | 0.3967 | 48.11 | 0.3270 |
| First 10 pairs | ||||||||||
| GenRefocus† (arXiv’25) [36] | 23.38 | 0.8301 | 0.8516 | 0.2641 | 0.3618 | 0.1830 | 0.9504 | 0.2800 | 38.79 | 0.3034 |
| FlashReFocus† | 25.46 | 0.8623 | 0.8705 | 0.2462 | 0.3389 | 0.1495 | 0.9744 | 0.3990 | 47.61 | 0.3157 |
Table G.1. Bokeh rendering on the RealBokeh validation split. We evaluate 219 – pairs at their original 2000 × 1500 resolution, using the annotated focal points and the protocol of Table 3. Green shading marks the top three results, with darker shades indicating higher ranks. Because of its cost at this resolution, GenRefocus is evaluated on the first 10 pairs (bottom). # Uses its own focus strategy (App. E). † Trained on RealBokeh pairs (Bokehlicious and FlashReFocus use the training split; GenRefocus does not specify its split).
Table G.2. Real apertures on MODEST. We use 17 aperture series (camera A, 70 mm), with an input and , , , and targets. Strength is searched per image as in Table 3. Monotonic: number of series whose selected strength never decreases as the aperture opens; : mean per-series Spearman correlation between selected strength and .
Figure G.1. Blur strength versus aperture on MODEST. Selected strengths, averaged over 17 aperture series and normalized at . The dashed line shows thin-lens blur relative to the input.
the receding wall’s Laplacian variance from 7 to 321 and lowers the shirt’s from 362 to 24 as it leaves focus, and FlashReFocus reconstructs it less sharply than GenRefocus and MagicBokeh, which invent facial detail.
Comparison with prior methods. Figure H.3 compares FlashReFocus with DiffCamera, GenRefocus, and MagicBokeh [53] on two Unsplash images. The new focal regions—the cliff in the first image and foreground rock in the second—are initially out of focus. MagicBokeh leaves these regions blurred, whereas FlashReFocus restores their detail before rendering the new focus.
Real captures. Figure H.4 shows the stages of complete refocusing on Canon EOS 750D and iPhone 15 photographs: the input, restored all-in-focus image, and rendered result at the new focal point.
Foreground to background. Figure H.5 moves the focus from the foreground subject to the background in three Unsplash images; enlarged crops show the new focal region and the transition into the blurred foreground. In the third image, the face behind the globe is initially blurred,
Portraits. We apply the tilt-shift edit of Figure 12b to a portrait (Fig. H.2), refocus eight portraits from face to background or a second subject (Figs. H.11 and H.12), vary strength with the face in focus (Fig. H.13), and move focus across flowers around a subject (Fig. H.15).
Consistency across focal edits. Interactive refocusing repeatedly moves the focal point on one image, ideally changing only the blur. We compare against GenRefocus [36]:
Design difference. GenRefocus also computes a defocus map from depth, the focal point, and its blur parameter , but this map only conditions a diffusion transformer that resynthesizes the whole image from noise at every edit; how closely the result follows the map, and what happens to the remaining content, is left to generation. In FlashReFocus, by contrast, the map explicitly specifies the blur, and the renderer adds a residual to one fixed restored image. Therefore, within the trained strength

Figure G.2. MODEST aperture series. Real captures (top) and FlashReFocus renderings of the input (bottom) for two series, using the strength selected for each aperture. The first column of each bottom row shows the renderer’s depth map (brighter is nearer) and focal point (green marker). Selected strength increases as the aperture opens. At , the real lens produces stronger blur in the near foreground of the first series than FlashReFocus.
Figure G.3. Attention design. A 3CReal scene rendered with three attention variants: relative-position attention as in Bokehlicious, relative-position attention followed by defocus-bias attention, and defocus-bias attention throughout (FlashReFocus). All other renderer components are identical. The reference is a real shallow-depth-of-field capture; enlarged crops appear below each result.
range, an edit should change pixels only where the requested blur changes, making its effect predictable.
Protocol. We place eight focal points at depth quantiles from far to near on three 3CReal and three RealBokeh test inputs, resized to a long side of 1024, and use two measures computed with our renderer’s depth map.
In-focus fidelity is the PSNR and LPIPS to the AiF input over pixels within 0.04 of the focal depth.
Edit consistency is the PSNR between consecutive results over pixels whose defocus is nearly unchanged, defined as a difference of less than 0.02 between their distances to the two focal depths of the edit pair.
Blur matching. We match the methods’ out-of-focus blur under two settings, measuring blur as the mean absolute Laplacian relative to the input over pixels more than 0.25 from the focal depth. In setting (i), GenRefocus uses its default blur parameter , and we match FlashReFocus’s strength per focal setting for fidelity and per
Table G.3. Bokeh ablation on 3CReal. (a) Training strategies: RealBokeh only, Hypersim only, Hypersim pre-training followed by uniform RealBokeh fine-tuning, and fine-tuning with a separate learning rate for the defocus-attention parameters (ours). (b) Attention designs with the same training data and schedule. All variants are evaluated zero-shot using the protocol of Table 3.
| Training strategy | PSNR | SSIM | MS-SSIM | LPIPS | LPIPS | DISTS | CLIP-I |
| RealBokeh only | 27.2844 | 0.8642 | 0.9173 | 0.2505 | 0.3301 | 0.1389 | 0.9734 |
| Hypersim only | 27.4598 | 0.8815 | 0.9324 | 0.2513 | 0.3362 | 0.1637 | 0.9759 |
| Uniform fine-tuning | 27.9383 | 0.8850 | 0.9363 | 0.2254 | 0.3075 | 0.1416 | 0.9802 |
| Diff. LR fine-tuning | 27.9815 | 0.8855 | 0.9375 | 0.2178 | 0.3004 | 0.1368 | 0.9807 |
| Attention design | PSNR | SSIM | MS-SSIM | LPIPS | LPIPS | DISTS | CLIP-I |
| Relative position | 27.8976 | 0.8838 | 0.9362 | 0.2232 | 0.3055 | 0.1386 | 0.9800 |
| Mixed attention | 27.9555 | 0.8845 | 0.9375 | 0.2221 | 0.3049 | 0.1390 | 0.9811 |
| Defocus bias (FlashReFocus) | 27.9815 | 0.8855 | 0.9375 | 0.2178 | 0.3004 | 0.1368 | 0.9807 |
Table G.3.

Figure G.4. EBB! Val176, foreground focus. A flower in front of foliage, rendered from the same all-in-focus input and shown alongside the EBB! reference. Methods that accept a focal point receive the same annotation. Crops below each result compare the in-focus flower’s edge and the blurred background.
scene for consistency. Stronger blur extrapolates strength up to 2 or applies the renderer twice. In setting (ii), FlashReFocus uses its default strength , and we match per scene (– on 3CReal and – on RealBokeh, below its default of 15).
Results. In both settings, FlashReFocus better preserves in-focus content (Table H.2), reaching 44.44 dB versus 28.96 dB on 3CReal in setting (i). Moreover, over regions whose requested blur barely changes, the consistency PSNR between consecutive edits is 4.6–9.1 dB lower for GenRefocus. Both results follow from the difference above: since every edit of FlashReFocus starts from the same reconstruction and alters it only as the map requests, the user can anticipate which regions an edit affects. GenRefocus, on the other hand, may change texture, color, or structure anywhere in the image even when only the focal plane moves. Furthermore, each edit takes 0.10 s for FlashReFocus and 77 s for GenRefocus, so focal settings can be explored interactively instead of waiting over a minute for each new focal setting.
Figures and video. Figure H.7 shows four of the eight focal settings on two scenes per dataset under setting (i); Fig. H.8 shows one scene per dataset under setting (ii). The supplementary video shows all eight focal settings for the six scenes side by side, with each method at its default strength ( and ), followed

Figure G.5. 3CReal, unseen optics. A street scene with bicycles, captured by a camera absent from all compared methods’ training data. All methods render the same input; those that accept a focal point receive the same annotation. The reference is a real capture, and insets enlarge the boxed regions.

Figure G.6. 3CReal, lens appearance. Leaves in front of a hedge illustrate lens-dependent blur at depth boundaries and out-of-focus highlights. Renderings are shown alongside the real shallow-depth-of-field capture; insets enlarge the boundary between the in-focus leaves and the background.
by a continuous rack focus and a strength sweep from FlashReFocus on each scene, all reusing one restoration.
Two focal planes. A conventional lens cannot keep two separated depth planes sharp while blurring the region between them. FlashReFocus produces this effect by editing its depth input without retraining.
Depth edit. Given focal depths and at two selected points, we supply the edited depth and focal depth . Defocus is then determined by distance to the nearer plane.
Results. Figure H.9 shows three examples, the third from 3CReal. Measured by mean absolute Laplacian relative to the input, sharpness at the two planes is retained at 84%/75%, 81%/82%, and 81%/66% with the edit. Focusing on only one plane leaves the other at 9–21%; regions far from both retain 8–11%.
Portraits. Figure H.14 applies it to two portraits from Fig. H.11, keeping the face and a far region sharp.
Controls on a portrait. Figure H.10 applies the controls of FlashReFocus to an Unsplash portrait with three depth layers: a can raised toward the camera, the face, and a lake

Figure G.7. RealBokeh validation, point lights. The focal point is on the flower (green marker). The yellow box marks an in-focus crop; the blue box marks the region where the reference differs most from the input. Bokehlicious, trained on the same cameras and lenses, reproduces the reference’s large highlight discs. FlashReFocus produces smaller, softer discs, while GenRefocus blurs the lights without forming discs.

Figure G.8. RealBokeh validation, receding surface. The focal point lies on a textured stone surface that recedes from the camera. The surface near the focal point should remain sharp, with increasing blur away from it, as in the reference. FlashReFocus and Bokehlicious reproduce this blur, whereas GenRefocus and MagicBokeh leave the far surface partly sharp. The renderer’s depth map appears beside the input; boxes are enlarged as in Fig. G.7.

Figure H.1. Complete refocusing on LFDOF. Input and target are different focal slices of the same light field. The focus moves to foreground leaves (top) or a flower stem (bottom); the red box is enlarged below each image. FlashReFocus restores detail that remains sharp in the new focal region, approaching the target’s appearance. DiffCamera, GenRefocus, and MagicBokeh leave this region soft, while AnyBokeh sharpens the stem with a rougher texture.
| Method | 3CReal Setting (i) In-focus PSNR↑ | 3CReal Setting (i) In-focus LPIPS↓ | 3CReal Setting (i) Consist. PSNR↑ | 3CReal Setting (ii) In-focus PSNR↑ | 3CReal Setting (ii) In-focus LPIPS↓ | 3CReal Setting (ii) Consist. PSNR↑ | RealBokeh test Setting (i) In-focus PSNR↑ | RealBokeh test Setting (i) In-focus LPIPS↓ | RealBokeh test Setting (i) Consist. PSNR↑ | RealBokeh test Setting (ii) In-focus PSNR↑ | RealBokeh test Setting (ii) In-focus LPIPS↓ | RealBokeh test Setting (ii) Consist. PSNR↑ |
| GenRefocus | 28.96 | 0.155 | 43.84 | 29.37 | 0.123 | 45.16 | 25.38 | 0.186 | 40.19 | 27.10 | 0.118 | 42.56 |
| FlashReFocus | 44.44 | 0.036 | 49.91 | 42.44 | 0.043 | 49.74 | 38.81 | 0.048 | 49.31 | 43.54 | 0.023 | 51.47 |
Table H.2. Consistency across focal edits. Three scenes per dataset, each with eight focal points. In-focus fidelity (PSNR, LPIPS) compares the in-focus region with the input; consistency (PSNR) compares consecutive edits over regions whose blur should remain unchanged. In setting (i), FlashReFocus is matched to GenRefocus at ; in setting (ii), GenRefocus is matched to FlashReFocus at .
behind. Each edit is one renderer pass over one restored image and depth map. Moving focus blurs layers away from the selected plane. Increasing strength with the face in focus gradually blurs the can, while the depth edit of Appendix § 12.0.1 keeps the can and face sharp and the lake blurred. FlashReFocus renders from a single restored image, so it can spread visible colors but cannot recover occluded background.
Limitations and Broader Impact
Depth. Errors in monocular relative depth can place blur incorrectly. Thin structures, glass surfaces, and reflections may therefore be blurred as if they lay at the wrong depth. Replacing DA-V2-L with Depth Pro or smaller DA-V2 models changes PSNR by at most 0.11 dB relative to DA-V2-L on the evaluated benchmarks (Table G.4); these averages do not bound errors on individual images.
Occlusion. A large aperture captures some background around foreground edges, allowing background content to appear through blurred boundaries.
Lens appearance. The renderer learns blur appearance from its training lenses. It has no aperture-shape input, as supported by GenRefocus [36], or explicit control over lens-specific effects such as cat-eye highlights. Strengths above 1 († in Fig. H.10) also require extrapolation.
Restoration. Stage I can introduce unsupported texture or leave heavily blurred regions soft (Fig. F.3). For example, when a face is strongly blurred in the input, FlashReFocus reconstructs it less sharply than generative refocusing methods that synthesize new facial detail (Fig. H.5, third row).
Cost. Restoration accounts for most of the 2.4 s initial refocus at (Table 6), measured on a server-class GPU. Each additional edit uses only the 1.3M-parameter renderer (0.46 s, 0.85 TFLOPs) at the same resolution.

Figure H.2. Tilt-shift on a portrait. At strength , the renderer receives a vertical depth ramp centered on a selected row. A horizontal band remains sharp regardless of scene depth. Centering it on the face (left) blurs the distant city and valley; centering it on the valley (right) keeps the buildings and road sharp while blurring the foreground subject, producing a miniature effect.

Figure H.3. Refocusing Unsplash images. The focus moves to the green marker in an initially blurred region: a cliff (top) or foreground rock (bottom). The red and green boxes enlarge the new and former focal regions, respectively. MagicBokeh leaves the new focal region blurred. AnyBokeh, which edits the input directly, blurs the former focal region but recovers less of the cliff’s structure.
Video. FlashReFocus is designed for single images. Applying it frame by frame estimates restoration and depth independently, without temporal constraints, so reconstructed detail and blur may flicker. Video refocusing requires temporally consistent restoration and depth, as addressed by video bokeh methods [71], which we leave to future work.
Broader impact. Refocusing after capture can rescue photographs with misplaced focus and provide depth-of-field control without specialized optics. Some restored detail comes from a diffusion prior, so the output should not be treated as an exact record of the captured scene, especially as evidence. The portraits in this appendix are Unsplash photographs used under the Unsplash License [60].

Figure H.4. Refocusing real captures. Canon EOS 750D (top) and iPhone 15 (bottom) photographs, shown as input, Stage I all-in-focus restoration, and rendering at the green focal point. Boxed regions are enlarged below or beside each image.

Figure H.5. Refocusing to the background. The focus moves from the foreground subject to the background in three Unsplash images (green marker). The red and green boxes mark the new and former focal regions, respectively, enlarged at right. Row 3 uses strength 0.8.

Figure H.6. Additional complete refocusing on LFDOF, using the layout of Fig. H.1. The focus moves to a cable behind a keyboard (top) or a glue bottle’s cap (bottom). FlashReFocus renders the cable and keyboard close to the target, whereas GenRefocus adds a pattern to the wall, AnyBokeh roughens the cable, and DiffCamera and MagicBokeh leave the region soft. On the glue bottle, DiffCamera adds texture absent from the target. The red box is enlarged below each image.

Figure H.7. Moving the focal point on two 3CReal and two RealBokeh test scenes. The strength of FlashReFocus is matched to GenRefocus at . Focus moves from far to near (green marker). For each scene, the first column shows the all-in-focus input and our renderer’s depth map (brighter is nearer). Both methods receive the same input and focal points. Values below each result are in-focus PSNR and LPIPS relative to the input, as in Table H.2.

Figure H.8. Moving the focal point with GenRefocus matched to FlashReFocus. The first 3CReal (top) and RealBokeh test (bottom) scenes of Fig. H.7, with FlashReFocus at its default strength 0.5 and GenRefocus at and 5.25, respectively. Layout and metrics follow Fig. H.7.

Figure H.9. Two focal planes. Points and mark the trunk and stump (row 1), left and right birches (row 2), and flower and bench (row 3). Focusing on either point blurs the other. Editing depth according to distance to the nearer plane keeps both regions sharp while blurring regions away from both. Rows 1–2 are RealBokeh test scenes; row 3 is from 3CReal. Strength 1.5 is beyond the trained range [0, 1].

Figure H.10. Controls on a portrait. All renderings use one restored all-in-focus image. Top: focus on the can, face, and background (green marker) at strength 0.8. Middle: varying strength with the face in focus. Bottom: two focal planes obtained by depth editing (Appendix § 12.0.1), the edited depth, and input. Boxes are enlarged below each result. †Beyond the trained range [0, 1].

Figure H.11. Refocusing portraits. Four shallow-depth-of-field Unsplash portraits. Stage I restores an all-in-focus image, including background detail, and the renderer places focus on the face or background (green marker) at . Background focus reveals reconstructed trees, aquarium rocks, distant buildings, and a wall, while the subject is blurred according to its distance from the new focal plane. All edits of each portrait reuse the same restored image.

Figure H.12. More portraits. Four further Unsplash portraits at , with focus on the face or elsewhere (green marker): the horse beside the rider, the car behind a subject at night, a dim background behind a lit face, and the trees behind a couple and their dog. In the first row, moving focus to the horse blurs the woman beside it as well as the barn and trees. The prism flares in the second row are part of the photograph and are kept as content. All edits of each portrait reuse the same restored image.

Figure H.13. Varying strength on portraits. The aquarium and city portraits from Fig. H.11, with the face in focus (green marker) and strength increasing from to . The face remains sharp while background blur increases with , resembling an opening lens aperture. Each result requires one renderer pass on the same restored image.

Figure H.14. Two focal planes on portraits. Focus on the face (, green marker), background (, yellow marker), or both through depth editing, at . The edit keeps the face and distant buildings or rocks sharp while blurring intermediate regions, an effect unavailable with a conventional single focal plane.

Figure H.15. Refocusing among flowers. An Unsplash portrait with flowers at depths in front of and behind the subject. Moving focus from the near buds (green marker) to flowers behind the subject (yellow marker) at shifts the sharp region through the flower bed. The subject’s dress and hands blur or sharpen according to their distance from each focal plane.
References
- [1]Abdullah Abuolaim and Michael S Brown. Defocus deblurring using dual-pixel data. In European conference on computer vision, pages 111–126. Springer, 2020. 2, 4, 5, 6, 14arxiv.org/abs/2005.00305
- [2]Abdullah Abuolaim, Mauricio Delbracio, Damien Kelly, Michael S Brown, and Peyman Milanfar. Learning to reduce defocus blur by realistically modeling dual-pixel data. In Proceedings of the IEEE/CVF international conference on computer vision, pages 2289–2298, 2021. 2
- [3]Eirikur Agustsson and Radu Timofte. NTIRE 2017 challenge on single image super-resolution: Dataset and study. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition Workshops, pages 126–135, 2017. 4, 14
- [4]Sumukh K. Aithal, Pratyush Maini, Zachary C. Lipton, and J. Zico Kolter. Understanding hallucinations in diffusion models through mode interpolation. In Advances in Neural Information Processing Systems, pages 134614–134644, 2024. 3arxiv.org/abs/2406.09358
- [5]Hadi Alzayer, Abdullah Abuolaim, Leung Chun Chan, Yang Yang, Ying Chen Lou, Jia-Bin Huang, and Abhishek Kar. DC²: Dual-camera defocus control by learning to refocus. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 21488–21497, 2023. 3arxiv.org/abs/2304.03285
- [6]Sajjad Amrollahi Byouki and Hoon Hwangbo. A comprehensive survey on deep neural image deblurring. arXiv preprint arXiv:2310.04719, 2023. 2
- [7]Yochai Blau and Tomer Michaeli. The perception-distortion tradeoff. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 6228–6237, 2018. 1, 2, 3DOI
- [8]Aleksei Bochkovskii, Amaël Delaunoy, Hugo Germain, Marcel Santos, Yichao Zhou, Stephan R. Richter, and Vladlen Koltun. Depth pro: Sharp monocular metric depth in less than a second. In International Conference on Learning Representations, 2025. 24arxiv.org/abs/2410.02073
- [9]Kang Chen and Yuanjie Liu. Efficient defocus deblurring networks based on diffusion models. In ICASSP 2025-2025 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), pages 1–5. IEEE, 2025. 3, 5, 19
- [10]Liangyu Chen, Xiaojie Chu, Xiangyu Zhang, and Jian Sun. Simple baselines for image restoration. In European conference on computer vision, pages 17–33. Springer, 2022. 2, 6, 15
- [11]Keyan Ding, Kede Ma, Shiqi Wang, and Eero P. Simoncelli. Image quality assessment: Unifying structure and texture similarity. IEEE Transactions on Pattern Analysis and Machine Intelligence, 44(5):2567–2581, 2022. 6, 20
- [12]Georgios D. Evangelidis and Emmanouil Z. Psarakis. Parametric image alignment using enhanced correlation coefficient maximization. IEEE Transactions on Pattern Analysis and Machine Intelligence, 30(10):1858–1865, 2008. 18DOI
- [13]Haoxuan Feng, Haohui Zhou, Tian Ye, Sixiang Chen, and Lei Zhu. Residual diffusion deblurring model for single image defocus deblurring. In Proceedings of the AAAI Conference on Artificial Intelligence, pages 2960–2968, 2025. 3DOI
- [14]Martin A Fischer and Robert C Bolles. Random sample consensus: a paradigm for model fitting with applications to image analysis and automated cartography. Communications of the ACM, 24(6):381–395, 1981. 18
- [15]Armando Fortes, Tianyi Wei, Shangchen Zhou, and Xingang Pan. Bokeh Diffusion: Defocus blur control in text-to-image diffusion models. In Proceedings of the SIGGRAPH Asia 2025 Conference Papers, pages 1–11, 2025. 3, 6, 20DOI
- [16]Martin Heusel, Hubert Ramsauer, Thomas Unterthiner, Bernhard Nessler, and Sepp Hochreiter. GANs trained by a two time-scale update rule converge to a local Nash equilibrium. In Advances in Neural Information Processing Systems, 2017. 6, 20
- [17]Jonathan Ho, Nal Kalchbrenner, Dirk Weissenborn, and Tim Salimans. Axial attention in multidimensional transformers. arXiv preprint arXiv:1912.12180, 2019. 16arxiv.org/abs/1912.12180
- [18]Jonathan Ho, Ajay Jain, and Pieter Abbeel. Denoising diffusion probabilistic models. In Advances in Neural Information Processing Systems, pages 6840–6851, 2020. 1, 3
- [19]Xinyu Hou, Xiaoming Li, Zongsheng Yue, and Chen Change Loy. AnyBokeh: Physics-guided any-to-any bokeh editing with optical fingerprint transfer. In Advances in Neural Information Processing Systems (NeurIPS), 2026. 1, 3, 7, 19, 25arxiv.org/abs/2606.31959
- [20]Edward J Hu, Yelong Shen, Phillip Wallis, Zeyuan Allen-Zhu, Yuanzhi Li, Shean Wang, Lu Wang, and Weizhu Chen. LoRA: Low-rank adaptation of large language models. In International Conference on Learning Representations, 2022. 3
- [21]Xinyu Huang, Yi-Jie Huang, Youcai Zhang, Weiwei Tian, Rui Feng, Yuejie Zhang, Yanchun Xie, Yaqian Li, and Lei Zhang. Open-set image tagging with multi-grained text supervision. In Proceedings of the 33rd ACM International Conference on Multimedia, pages 4117–4126, 2025. 3, 14
- [22]Andrey Ignatov, Jagruti Patel, and Radu Timofte. Rendering natural camera bokeh effect with deep learning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition Workshops, pages 418–419, 2020. 2, 3, 6, 7, 17, 18arxiv.org/abs/2006.05698
- [23]Junjie Ke, Qifei Wang, Yilin Wang, Peyman Milanfar, and Feng Yang. MUSIQ: Multi-scale image quality transformer. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 5148–5157, 2021. 6, 20
- [24]Craig Kolb, Don Mitchell, and Pat Hanrahan. A realistic camera model for computer graphics. In Proceedings of the 22nd Annual Conference on Computer Graphics and Interactive Techniques, pages 317–324, New York, NY, USA, 1995. Association for Computing Machinery. 3DOI
- [25]Junyoung Lee, Hyeongseok Son, Jaesung Rim, Sunghyun Cho, and Seungyong Lee. Iterative filter adaptive network for single image defocus deblurring. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pages 2034–2042, 2021. 1, 2, 5, 6DOI
- [26]Anat Levin, Rob Fergus, Frédo Durand, and William T Freeman. Image and depth from a conventional camera with a coded aperture. ACM transactions on graphics (TOG), 26 (3):70–es, 2007. 2
- [27]Xiaopan Li, Shiqian Wu, Qile Zhu, Shoulie Xie, and Sos Agaian. Single image defocus deblurring via multimodal-guided diffusion and depth-aware fusion. Pattern Recognition, 171:112133, 2026. 3
- [28]Yuhao Li, Haoran Fang, Xiang Lei, Qi Wang, Gang Hu, Ji-quang Dong, Zilong Li, Jiabin Lin, Qiegen Liu, and Xianlin Song. Real-world defocus deblurring via score-based diffusion models. Scientific Reports, 15(1):22942, 2025.
- [29]Hanyan Liang, Shuyao Chai, Xixuan Zhao, and Jiangming Kan. Swin-Diff: A single defocus image deblurring network based on diffusion model. Complex & Intelligent Systems, 11(3):170, 2025. 3
- [30]Jingyun Liang, Jiezhang Cao, Guolei Sun, Kai Zhang, Luc Van Gool, and Radu Timofte. SwinIR: Image restoration using Swin transformer. In Proceedings of the IEEE/CVF International Conference on Computer Vision Workshops, pages 1833–1844, 2021. 2
- [31]Pengwei Liang, Junjun Jiang, Xianming Liu, and Jiayi Ma. Decoupling image deblurring into twofold: A hierarchical model for defocus deblurring. IEEE Transactions on Computational Imaging, 10:1207–1220, 2024. 5DOI
- [32]David G Lowe. Distinctive image features from scale-invariant keypoints. International journal of computer vision, 60(2):91–110, 2004. 18
- [33]Ziwei Luo, Fredrik K. Gustafsson, Zheng Zhao, Jens Sjölund, and Thomas B. Schön. Refusion: Enabling large-size realistic image restoration with latent-space diffusion models. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition Workshops, pages 1680–1691, 2023. 3
- [34]Anish Mittal, Anush Krishna Moorthy, and Alan Conrad Bovik. No-reference image quality assessment in the spatial domain. IEEE Transactions on Image Processing, 21 (12):4695–4708, 2012. 6, 20
- [35]Anish Mittal, Rajiv Soundararajan, and Alan C. Bovik. Making a completely blind image quality analyzer. IEEE Signal Processing Letters, 20(3):209–212, 2013. 6, 20
- [36]Chun-Wei Tuan Mu, Cheng-De Fan, Jia-Bin Huang, and Yu-Lun Liu. Generative refocusing: Flexible defocus control from a single image. arXiv preprint arXiv:2512.16923, 2025. 1, 3, 5, 7, 19, 20, 24, 25, 27, 32arxiv.org/abs/2512.16923
- [37]Ren Ng, Marc Levoy, Mathieu Brédif, Gene Duval, Mark Horowitz, and Pat Hanrahan. Light field photography with a hand-held plenoptic camera. Technical Report CSTR 2005-02, Stanford University Computer Science, 2005. 3
- [38]Juewen Peng, Zhiguo Cao, Xianrui Luo, Hao Lu, Ke Xian, and Jianming Zhang. Bokeh meets classical rendering. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 16283–16292, 2022. 2, 3, 6, 7, 17, 24, 25, 27
- [39]Juewen Peng, Jianming Zhang, Xianrui Luo, Hao Lu, Ke Xian, and Zhiguo Cao. MPIB: An MPI-based bokeh rendering framework for realistic partial occlusion effects. In European Conference on Computer Vision, pages 590–607. Springer, 2022. 3, 7
- [40]Matt Pharr, Wenzel Jakob, and Greg Humphreys. Physically Based Rendering: From Theory to Implementation. Morgan Kaufmann Publishers Inc., San Francisco, CA, USA, 3rd edition, 2016. 3
- [41]Michael Potmesil and Indranil Chakravarty. A lens and aperture camera model for synthetic image generation. ACM SIGGRAPH Computer Graphics, 15(3):297–305, 1981. 1, 3
- [42]Yuhui Quan, Zicong Wu, and Hui Ji. Gaussian kernel mixture network for single image defocus deblurring. In Advances in Neural Information Processing Systems, pages 20812–20824, 2021. 2
- [43]Yuhui Quan, Xin Yao, and Hui Ji. Single image defocus deblurring via implicit neural inverse kernels. In Proceedings of the IEEE/CVF international conference on computer vision, pages 12600–12610, 2023. 5, 24, 25
- [44]Alec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh, Gabriel Goh, Sandhini Agarwal, Girish Sastry, Amanda Askell, Pamela Mishkin, Jack Clark, et al. Learning transferable visual models from natural language supervision. In International Conference on Machine Learning, pages 8748–8763, 2021. 6, 20
- [45]Mike Roberts, Jason Ramapuram, Anurag Ranjan, Atulit Kumar, Miguel Angel Bautista, Nathan Paczan, Russ Webb, and Joshua M Susskind. Hypersim: A photorealistic synthetic dataset for holistic indoor scene understanding. In Proceedings of the IEEE/CVF international conference on computer vision, pages 10912–10922, 2021. 6, 17, 22
- [46]Robin Rombach, Andreas Blattmann, Dominik Lorenz, Patrick Esser, and Björn Ommer. High-resolution image synthesis with latent diffusion models. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pages 10684–10695, 2022. 1, 3, 6, 14, 21
- [47]Lingyan Ruan, Bin Chen, Jizhou Li, and Miu-Ling Lam. AIFNet: All-in-focus image restoration network using a light field-based dataset. IEEE Transactions on Computational Imaging, 7:675–688, 2021. 4, 8, 14, 20, 24
- [48]Lingyan Ruan, Bin Chen, Jizhou Li, and Miuling Lam. Learning to deblur using light field generated and real defocus images. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pages 16304–16313, 2022. 2, 5
- [49]Parikshit Sakurikar, Ishit Mehta, Vineeth N. Balasubramanian, and P. J. Narayanan. RefocusGAN: Scene refocusing using a single image. In Proceedings of the European Conference on Computer Vision (ECCV), pages 519–535, 2018. 3
- [50]Tim Seizinger, Florin-Alexandru Vasluianu, Marcos V Conde, Zongwei Wu, and Radu Timofte. Bokhelicius: Photorealistic bokeh rendering with controllable apertures. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 8908–8917, 2025. 2, 3, 4, 5, 7, 14, 17, 18, 27
- [51]Tim Seizinger, Zhuyun Zhou, and Radu Timofte. The RealDefocus benchmark for defocus deblurring. In IEEE International Conference on Image Processing (ICIP), 2026. 4, 17
- [52]Yichen Sheng, Zixun Yu, Lu Ling, Zhiwen Cao, Xuaner Zhang, Xin Lu, Ke Xian, Haiting Lin, and Bedrich Benes. Dr.Bokeh: DefocusRentable occlusion-aware bokeh rendering. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 4515–4525, 2024. 3, 7
- [53]Linxiao Shi, Siming Zheng, Zerong Wang, Hao Zhang, Jinwei Chen, Bo Li, Shifeng Chen, and Peng-Tao Jiang. Towards photorealistic and efficient bokeh rendering via diffusion framework. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, 2026. 1, 3, 7, 25, 27
- [55]Hyeongseok Son, Junyong Lee, Sunghyun Cho, and Seungyong Lee. Single image defocus deblurring using kernel-sharing parallel atrous convolutions. In Proceedings of the IEEE/CVF international conference on computer vision, pages 2642–2650, 2021. 2
- [56]Lingchen Sun, Rongyuan Wu, Zhiyuan Ma, Shuaizheng Liu, Qiaosi Yi, and Lei Zhang. Pixel-level and semantic-level adjustable super-resolution: A dual-LoRA approach. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 2333–2343, 2025. 2, 3, 14
- [57]Yutao Sun, Li Dong, Shaohan Huang, Shuming Ma, Yuqing Xie, Jialong Wu, Jianyong Wang, and Furu Wei. Retentive network: A successor to Transformer for large language models. arXiv preprint arXiv:2307.08621, 2023. 5arxiv.org/abs/2307.08621
- [58]SaiKiran Tedla, Zhoutong Zhang, Xuaner Zhang, and Shumian Xin. Learning to refocus with video diffusion models. In Proceedings of the SIGGRAPH Asia 2025 Conference Papers, 2025. 3
- [59]Nisarg K. Trivedi, Vinayak A. Belludi, Li-Yun Wang, Pardis Taghavi, and Dante Lok. MODEST: Multi-optics depth-of-field stereo dataset, 2025. 19
- [60]Unsplash. Unsplash. https://unsplash.com, 2026. Photographs used under the Unsplash License, accessed 2026. 19, 33
- [61]Neal Wadhwa, Rahul Garg, David E Jacobs, Bryan E Feldman, Nori Kanazawa, Robert Carroll, Yair Movshovitz-Attias, Jonathan T Barron, Yael Pritch, and Marc Levoy. Synthetic depth-of-field with a single-camera mobile phone. ACM Transactions on Graphics (ToG), 37(4):1–13, 2018. 1, 3
- [62]Jianyi Wang, Kelvin C. K. Chan, and Chen Change Loy. Exploring CLIP for assessing the look and feel of images. In Proceedings of the AAAI Conference on Artificial Intelligence, pages 2555–2563, 2023. 6, 20
- [63]Lijun Wang, Xiaohui Shen, Jianming Zhang, Oliver Wang, Zhe Lin, Chih-Yao Hsieh, Sarah Kong, and Huchuan Lu. DeepLens: Shallow depth of field from a single image. ACM Transactions on Graphics, 37(6):1–11, 2018. 3, 7, 27
- [64]Yiyang Wang, Xi Chen, Xiaogang Xu, Yu Liu, and Heng-shuang Zhao. DiffCamera: Arbitrary refocusing on images. In Proceedings of the SIGGRAPH Asia 2025 Conference Papers, pages 1–10, 2025. 1, 3, 19, 25
- [65]Zhou Wang, Eero P Simoncelli, and Alan C Bovik. Multiscale structural similarity for image quality assessment. In The Thirty-Seventh Asilomar Conference on Signals, Systems & Computers, pages 1398–1402, 2003. 6, 20
- [66]Zhou Wang, Alan C. Bovik, Hamid R. Sheikh, and Eero P. Simoncelli. Image quality assessment: From error visibility to structural similarity. IEEE Transactions on Image Processing, 13(4):600–612, 2004. 6, 20
- [67]Lihe Yang, Bingyi Kang, Zilong Huang, Zhen Zhao, Xiaogang Xu, Jiashi Feng, and Hengshuang Zhao. Depth anything V2. In Advances in Neural Information Processing Systems, pages 21875–21911, 2024. 4, 22
- [68]Sidi Yang, Tianhe Wu, Shuwei Shi, Shanshan Lao, Yuan Gong, Mindeng Cao, Jiahao Wang, and Yujia Yang. MANIQA: Multi-dimension attention network for no-reference image quality assessment. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition Workshops, pages 1191–1200, 2022. 6, 20
- [69]Tao Yang, Rongyuan Wu, Peiran Ren, Xuansong Xie, and Lei Zhang. Pixel-aware stable diffusion for realistic image super-resolution and personalized stylization. In European conference on computer vision, pages 74–91. Springer, 2024. 3
- [70]Yang Yang, Haiting Lin, Zhan Yu, Sylvain Paris, and Jingyi Yu. Virtual DSLR: High quality dynamic depth-of-field synthesis on mobile platforms. Electronic Imaging, 28(18):1–9, 2016. 3
- [71]Yang Yang, Siming Zheng, Qirui Yang, Jinwei Chen, Boxi Wu, Xiaofei He, Deng Cai, Bo Li, and Peng-Tao Jiang. Any-to-Bokeh: Arbitrary-subject video refocusing with video diffusion model. In International Conference on Learning Representations, 2026. 3, 33
- [72]Xin Yu, Yuan-Chen Guo, Yangguang Li, Ding Liang, Song-Hai Zhang, and Xiaojun Qi. Text-to-3D with classifier score distillation. In International Conference on Learning Representations, 2024. 3, 14
- [73]Syed Waqas Zamir, Aditya Arora, Salman Khan, Munawar Hayat, Fahad Shahbaz Khan, and Ming-Hsuan Yang. Restormer: Efficient transformer for high-resolution image restoration. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 5728–5739, 2022. 1, 2, 5
- [74]Kaihao Zhang, Wenqi Ren, Wenhan Luo, Wei-Sheng Lai, Björn Stenger, Ming-Hsuan Yang, and Hongdong Li. Deep image deblurring: A survey. International Journal of Computer Vision, 130(9):2103–2130, 2022. 2
- [75]Richard Zhang, Phillip Isola, Alexei A. Efros, Eli Shechtman, and Oliver Wang. The unreasonable effectiveness of deep features as a perceptual metric. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 586–595, 2018. 3, 6, 20
- [76]Xinxin Zhang, Ronggang Wang, Xiubao Jiang, Wenmin Wang, and Wen Gao. Spatially variant defocus blur map estimation and deblurring from a single image. Journal of Visual Communication and Image Representation, 35:257–264, 2016. 2
- [77]Zhengbo Zhang, Lin Geng Foo, Hossein Rahmani, Jun Liu, and De Wen Soh. Performing defocus deblurring by modeling its formation process. In Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV), pages 5791–5801, 2025. 2
- [78]Chengxuan Zhu, Qingnan Fan, Qi Zhang, Jinwei Chen, Huaqi Zhang, Chao Xu, and Boxin Shi. BokehDiff: Neural lens blur with one-step diffusion. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 9508–9518, 2025. 3, 7, 27
- [79]Shaojie Zhuo and Terence Sim. Defocus map estimation from a single image. Pattern Recognition, 44(9):1852–1858, 2011. 2













