FlashReFocus: Interactive Image Refocusing in Seconds
Organizations: National Cheng Kung University · State University of New York at Albany · National Yang Ming Chiao Tung University
Abstract
Single-image refocusing changes the focal plane and depth of field of a photograph after capture. It is inherently interactive: users try many focal points and blur strengths on one image, so each edit should be fast and change only the blur. Recent generative methods, however, rerun large diffusion models for every edit. We observe that the two sub-problems differ in kind: recovering the all-in-focus image is ill-posed and needs 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 every edit with a lightweight network. To address the ill-posed restoration, a one-step diffusion deblurrer with a decoder refiner recovers fine detail efficiently while balancing fidelity and perceptual quality. For precise control, the renderer is conditioned on an explicit defocus map and uses defocus-bias attention, which lets pixels at similar defocus share information without interference from pixels at other depths; in-focus content stays unchanged, and editing the map yields tilt-shift and two focal planes. To further test generalization to unseen cameras, we collect 3CReal, a three-camera benchmark of 89 pairs. FlashReFocus achieves the best perceptual fidelity for zero-shot bokeh rendering on EBB! and 3CReal, refocuses 148.3x faster than GenRefocus, and takes about half a second per further edit, 462x faster.
Figures & tables
| 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 |
| Params | Time | TFLOPs | Mem. | |
| Method | (M) | (s) | (GB) | |
| IFAN | 10.48 | 0.09 | 1.85 | 4.37 |
| Restormer | 26.13 | 1.62 | 11.15 | 20.01 |
| DRBNet | 11.69 | 0.17 | 3.19 | 7.02 |
| INIKNet | 1.98 | 0.60 | 5.52 | 9.28 |
| ViTDeblur | 121.60 | 5.65 | 42.78 | 1.60 |
| Methods | Full-reference Metrics | No-reference IQA Metrics | Control | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| PSNR | SSIM | MS-SSIM | LPIPS | LPIPS | DISTS | CLIP-I | CLIP-IQA | 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 |
| Pix. | Ref. | DPDD | 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 |
| Variant | PSNR | SSIM | MS-SSIM | LPIPS | DISTS | CLIP-I |
|---|---|---|---|---|---|---|
| RealBokeh only | 27.284 | .864 | .917 | .251 | .139 | .973 |
| Hypersim only | 27.460 | .882 | .932 | .251 | .164 | .976 |
| Uniform fine-tuning | 27.938 | .885 | .936 | .225 | .142 | .980 |
| Differential LR | 27.982 | .885 | .937 | .218 | .137 | .981 |
| Relative-position attn. | 27.898 | .884 | .936 | .223 | .139 | .980 |
| Mixed attention | 27.956 | .885 | .937 | .222 | .139 | .981 |
| Params | Time (s) | TFLOPs | Mem. | |||
| Method | (B) | First | New focus | First | New focus | (GB) |
| DiffCamera | 12.33 | 136.35 | 136.35 | 19,363 | 19,363 | 28.37 |
| GenRefocus | 18.30 | 370.65 | 217.32 | 42,031 | 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 |
| Benchmark | Pairs | Systems | Registration | Seen |
|---|---|---|---|---|
| EBB! Val176 [ 22 ] | 176 | 1 | SIFT+RANSAC | No |
| RealBokeh [ 50 ] | 1,250 | 1 | Tripod | Yes |
| 3CReal (ours) | 89 | 3 | Tripod+ECC | No |
| System | Pairs | Deep / shallow DoF | Post-processed size |
|---|---|---|---|
| 750D / 18–55 mm | 31 | – / – | |
| X-E5 / 35 mm | 31 | / – | |
| X100VI / 23 mm | 27 | / | , |
| Total | 89 | – | – |
| 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 |
| Dataset | Setting | Pix. | Ref. | PSNR | SSIM | LPIPS | DISTS | FID | NIQE | MUSIQ | MANIQA | BRISQUE | CLIPIQA | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| DPDD | Official PiSA-SR | 24.57 | 0.730 | 0.177 | 0.097 | 39.70 | 4.87 | 60.08 | 0.374 | 20.60 | 0.525 | |||
| + our pixel phase | ✓ | 24.61 | 0.735 | 0.172 | 0.098 | 36.18 | 4.69 | 60.39 | 0.372 | 21.37 | 0.505 | |||
| + refiner | ✓ | ✓ | 25.51 | 0.790 | 0.167 | 0.093 | 34.74 | 4.70 | 59.07 | 0.353 | 23.26 | 0.477 | ||
| + | ✓ | ✓ | ✓ | 25.37 | 0.781 | 0.156 | 0.087 | 33.13 | 4.52 | 59.60 | 0.358 | 19.47 | 0.494 | |
| RealDOF | Official PiSA-SR | 23.77 | 0.710 | 0.260 | 0.122 | 32.94 | 5.01 | 37.94 | 0.237 | 38.02 | 0.320 | |||
| + our pixel phase | ✓ | 23.70 | 0.709 | 0.253 | 0.123 | 30.38 | 4.75 | 44.30 | 0.260 | 36.03 | 0.334 |
| 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 |
| Methods | Full-reference Metrics | No-reference IQA Metrics | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| PSNR | SSIM | MS-SSIM | LPIPS | LPIPS | DISTS | CLIP-I | CLIP-IQA | 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 |
| 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 |
| Full 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 |
| 3CReal | EBB! Val176 | ||||||
|---|---|---|---|---|---|---|---|
| Depth | Params | PSNR | LPIPS | DISTS | PSNR | LPIPS | 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 | .2181 | .1372 | 24.52 | .1780 | .1019 |
| Depth Pro | 952 | 28.08 | .2145 | .1331 | 24.53 | .1746 | .0983 |
| 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 [ 54 ] | 26.36 | .799 | .234 | .160 | .921 |
| AnyBokeh [ 19 ] | 24.82 | .802 | .213 | .129 | .932 |
| FlashReFocus w/o Stage I | 28.46 | .848 | .227 | .142 | .953 |
Neural Rendering
Neural rendering uses learned 3D scene and light representations to synthesize, edit, and relight images from new viewpoints.
See all 120 papers