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
Figure 1: 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 1.3M-parameter network. (d) Seconds at 1536×1536 for deblurring, the first edit, each next edit, and both edits together.
Figure 2: Overview of FlashReFocus. (A) Stage I restores an all-in-focus image I^AiF in one step with a frozen latent diffusion U-Net and an optional decoder refiner; (B) ω mixes the pixel and detail LoRA passes to trade fidelity for detail. (C) Stage II computes a defocus map from monocular depth and the selected focal point, and (D) renders bokeh in a single feed-forward pass with (E) defocus-bias attention, which focuses attention on tokens of similar defocus, more sharply for a larger strength K . The bottom row shows the training phases.
Figure 3: Stage I deblurs in one step with separate fidelity and detail LoRAs. (A) A frozen U-Net with both LoRAs restores the input latent. (B) The pixel LoRA, a VAE-encoder LoRA, and the input convolution are trained with Lpixel and then frozen while the detail LoRA is trained with LPIPS and CSD. (C) At inference, ω weights the detail branch and the refiner decodes I^AiF .
Figure 4: Stage II renders bokeh from explicit defocus with a lightweight network. (A) Depth, focal point, and strength form the condition stack MC . (B) A NAF encoder–decoder predicts a residual from I^AiF and MC ; its bottleneck stacks defocus residual groups (DRGs) of N defocus-aware attention blocks (DAABs). (C) Each DAAB biases attention by strength-scaled defocus differences.
Figure 5: What the VAE decoder loses. Encoding and decoding with the original VAE weaken text and texture-rich regions, as the error maps and enlarged crops show, motivating our refiner.
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
Table 1: Defocus deblurring on DPDD and RealDOF. Darker green: top three per dataset. Regression restorers lead PSNR and GenRefocus leads DISTS and FID, while FlashReFocus with the refiner has the best LPIPS and BRISQUE on both datasets.
Figure 6: Qualitative deblurring on (a) DPDD and (b) RealDOF, two crops each; GenRefocus alters the face and newspaper in (a).
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
Table 2: Deblurring inference cost at 1536×1536 .
Methods
Full-reference Metrics
No-reference IQA Metrics
Control
PSNR ↑
SSIM ↑
MS-SSIM ↑
LPIPS ↓
LPIPS VGG↓
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
Table 3: Zero-shot bokeh rendering on EBB! Val176 and 3CReal. LVCorr measures strength control as the correlation between the blur strength and the rendered blur (negative Laplacian variance), on LFDOF (top) and 3CReal (bottom). # Selects its own focal region.
Figure 7: Bokeh rendering on EBB! Val176. Insets: the background railing (red) and foreground leaves (green), both out of focus in the f/1.8 reference, should blur.
Figure 8: Focal control. One all-in-focus input is rendered with the focal point (green marker) moving from the nearest stones to the distant trees; the rightmost panel shows the estimated depth. The sharp region moves with the selected depth while the rest blurs.
Figure 9: Refocusing to the background. FlashReFocus restores the cliff (red box) most cleanly while blurring the horse (green box).
Figure 10: Controls beyond the focal point. (a) With the focal point fixed (green marker), raising the strength from 1× to 3× enlarges the background blur (green box) like a wider aperture, while the subject stays sharp (red box). (b) A vertical-ramp depth keeps the face-height band and receding wall (red box) sharp and blurs the shirt (green box).
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
Table 4: Deblurring ablation on DPDD and RealDOF. Starting from the official PiSA-SR recipe, our pixel phase (Pix.), the decoder refiner (Ref.), and ω=1.25 are added in turn ( × : ω=1 ).
Figure 11: Detail weight control. RealDOF crops as ω grows from 0 to 1.25: the LED grid and plate holes gain detail.
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
Table 5: Bokeh ablation on 3CReal. The upper block compares training strategies for the renderer, and the lower block compares attention biases under the same training data and schedule.
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
Table 6: Refocusing inference cost at 1536×1536 . First : restoration and first edit; New focus : each further edit. † No restoration.
Figure B.1 : Mixed deblurring data. (A) DPDD provides real lens blur from a single camera. (B) RealBokeh pairs, reversed into deblurring pairs and filtered to the 1,000 scenes with the sharpest f/22 targets, add strong real blur. (C) LFDOF adds pixel-aligned pairs refocused from light fields. (D) Synthetic DIV2K pairs blend disk, Gaussian, or motion kernels along a random gradient map Ms , giving exact alignment and spatially varying blur. (E) One source is drawn per sample with the listed probability, (F) giving a pair (Iblur,IAiF) .
Figure B.2 : Input-guided decoder refiner. (A) Multi-scale encoder features, each matched to the decoder block of the same resolution, (B) a high-frequency map, and (C) structure features of Iblur are (D) fused into each block of the decoder, which decodes the Stage-I latent z^ . The fusion modules and the decoder are trained with Lref while Stage I stays frozen. H is contrast-enhanced for display.
Figure C.1 : Effect of the defocus bias on attention. Ratio of the effective attention weights of each query (circle) with and without the bias, on a log scale from 0.1× (blue) to 10× (red), averaged over all attention blocks; white cross: focal point. With the bias, attention concentrates at the query’s defocus level: background queries leave the in-focus subject, and subject queries leave the background.
Figure C.2 : Preservation of in-focus regions. How much the renderer changes each pixel of the restored image, ∣ΔI∣=∣I^bokeh−I^AiF∣ , when focusing at the white cross with strength K=0.25 , 0.5, and 1; M is the defocus magnitude given to the renderer. Pixels on the in-focus subject are left unchanged at every strength, and the change elsewhere grows with M and K .
Figure C.3 : Depth source. DA-V2 on a shallow-depth-of-field photograph of 3CReal, on its restoration by Stage I, and on the deep-depth-of-field capture of the same view (near is bright).
Figure C.4 : Two-phase renderer training. (A) Pre-training on synthetic multi-focal Hypersim scenes, where each sampled focal depth Df(i) and strength K(j) gives a new aligned target rendered by BokehMe. (B) Fine-tuning on RealBokeh pairs, with a 10× larger learning rate for the defocus-attention parameters than for the rest of the renderer.
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
Table D.1 : Real bokeh benchmarks. Each pair is a small- and large-aperture photograph of one scene. EBB! uses a Canon 7D with a 50 mm lens, RealBokeh a Canon EOS R6 II with a 28–70 mm lens (statistics from [ 51 ] ). EBB! Val176 is our filtered validation split (Appendix D.2 ), Registration is how pairs are aligned, and Seen marks optics present in the renderer’s training data.
Figure D.1 : 3CReal collection. Campus scenes are photographed with three camera and lens systems from a fixed tripod (top), each at a small and a large aperture with automatic exposure (bottom). The pairs are aligned with ECC, cropped, and inspected (middle), giving 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.
System
Pairs
Deep / shallow DoF
Post-processed size
750D / 18–55 mm
31
f/22 – 36 / f/3.5 – 5.6
2966×1974
X-E5 / 35 mm
31
f/16 / f/1.7 – 5.6
1900×1256
X100VI / 23 mm
27
f/16 / f/2.0∗
1916×1272 , 2032×1135
Total
89
–
–
Table D.2 : 3CReal composition. Pairs, EXIF apertures of the deep-/shallow-DoF exposures, and post-processed size (width × height; the three portrait pairs are transposed) per camera and lens system. ∗ Eight 16:9 X100VI pairs lack EXIF metadata, so their apertures are unknown.
Figure D.2 : More 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), deep-depth-of-field input above shallow-depth-of-field target. Each pair differs only in aperture; the target shows that lens’s blur on thin structures, depth boundaries, and the background.
Method
Strength
Search
DeepLens
aperture ∈[0,1]
interval shrinking, 8 iterations
MPIB
K∈[1,180]
ternary, 10 iterations
BokehMe
K∈{1,…,100}
binary
Dr.Bokeh
K∈[1,60]
interval halving, 6 steps
Bokehlicious
K∈{1,…,100}
binary
BokehDiff
K∈[1,80]
binary
Table E.1 : Strength search per method (Table 3). Searches assume SSIM is unimodal in the strength and keep the best value evaluated.
Figure F.1 : DPDD, texture-rich scene. Deblurring of a DPDD test scene with grass, leaves, and tree bark by the compared methods, next to the reference; two crops (red and blue boxes) are enlarged below each result. The deterministic baselines leave the blades and the bark soft, while FlashReFocus recovers edges and texture closer to the reference.
Figure F.2 : RealDOF, dense structure. A RealDOF outdoor scene with shop signs, window frames, and foliage, as in Fig. F.1 . Most methods recover large letters and frames; crops show where they differ on fine text and repeated structures, the scene’s hardest parts.
Figure F.3 : Failure cases. (a) Grid-like texture and a color shift in a low-texture region, where the diffusion prior adds unsupported high-frequency content. (b) Over-smoothing and ghosting of a severely blurred foreground subject, whose structure the input lacks.
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
+ ω=1.25
✓
✓
✓
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
Table F.1 : Deblurring ablation with all metrics. Starting from the official PiSA-SR recipe trained on our data, our pixel phase (Pix.), the decoder refiner (Ref.), and ω=1.25 are added in turn ( × under ω means ω=1 ); bold marks the best value per dataset.
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
Table F.2 : Detail weight ω on the validation sets. Stage I with the refiner; bold marks the best value per column. The rank sum over PSNR, LPIPS, DISTS, and FID on all three sets selects ω=1.25 .
Figure F.4 : Detail branch of Stage I. Outputs on DPDD of the pixel branch alone ( ω=0 ) and with the detail branch ( ω=1.25 ) in the red box, the reference, and the absolute difference between the two outputs over the whole image, from 0 (dark) to 20/255 or more (bright).
Figure F.5 : Decoder refiner on text. Crops of printed text in the blurred input and in the outputs of FlashReFocus decoded without and with the refiner. Letters that are legible in the input are distorted by plain VAE decoding and recovered by the refiner, which reinjects the input’s high-frequency structure; severely blurred characters stay hard to recover.
Figure F.6 : Deblurring real lens blur. Shallow-depth-of-field photographs of 3CReal from three unseen cameras and lenses, restored by Stage I, next to the deep-depth-of-field capture of the same view; the red box is enlarged on the right.
Methods
Full-reference Metrics
No-reference IQA Metrics
PSNR ↑
SSIM ↑
MS-SSIM ↑
LPIPS ↓
LPIPS VGG↓
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
Table G.1 : Bokeh rendering on RealBokeh validation. 219 pairs from f/22 to f/2.0 at the original 2000×1500 resolution, with the annotated focal points and the protocol of Table 3. Darker green marks the best, second, and third results. GenRefocus is evaluated on the first 10 pairs (bottom) because of its cost at this resolution. # Selects its own focal region. † Trained on RealBokeh pairs (Bokehlicious and FlashReFocus: the training split; GenRefocus does not state the split).
Figure 38
Figure G.2 : MODEST aperture series. For two series, real captures of the same view (top) and FlashReFocus renders of the f/22 input (bottom) at the strength K selected for each aperture; the first column of each bottom row shows the depth of our renderer (near bright) and the focal point (green marker). The selected strength grows with the aperture; at f/2.8 the real lens still blurs the near foreground of the first series more strongly than FlashReFocus.
Figure G.3 : Attention design. One 3CReal scene rendered by renderers that differ only in the attention: relative-position attention as in Bokehlicious, relative position modulated by defocus, and the defocus bias of FlashReFocus, next to the real shallow-depth-of-field capture. Enlarged crops are shown below each result.
Training strategy
PSNR ↑
SSIM ↑
MS-SSIM ↑
LPIPS ↓
LPIPS VGG↓
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
Table G.3 : Bokeh ablation on 3CReal. (a) Training strategy: renderers trained on RealBokeh only, on Hypersim only, pre-trained on Hypersim and fine-tuned on RealBokeh, and fine-tuned with a separate learning rate for the defocus parameters (ours). (b) Attention design under the same training. All variants are evaluated zero-shot on 3CReal with the protocol of Table 3.
Figure G.4 : EBB! Val176, foreground focus. A flower in front of foliage, rendered by each method from the same all-in-focus input and focal point, next to the EBB! reference. Crops below each result compare the edge of the in-focus flower and the blurred background.
Figure G.5 : 3CReal, unseen optics. A street scene with bicycles from a 3CReal camera that no compared method has seen in training. All methods render the same input at the annotated focal point; the reference is the real capture, and insets enlarge the boxed regions.
Figure G.6 : 3CReal, lens appearance. Leaves in front of a hedge, where the blur at depth boundaries and the shape of out-of-focus highlights depend on the lens. Each rendering is compared with the real shallow-depth-of-field capture; the insets enlarge the boundary between the in-focus leaves and the background.
Figure G.7 : RealBokeh validation, point lights. Focus on the flower (green marker); yellow box: in-focus crop, blue box: where the f/2.0 reference differs most from the input. Bokehlicious, trained on the same cameras and lenses, reproduces the large highlight discs of the reference; FlashReFocus renders smaller, softer discs, and GenRefocus blurs the lights away without forming discs.
Figure G.8 : RealBokeh validation, receding surface. Focus on a textured stone surface that recedes from the camera: the surface at the focal point should stay sharp while the rest blurs with distance as in the f/2.0 reference. FlashReFocus and Bokehlicious match the reference blur, whereas GenRefocus and MagicBokeh leave the far surface partly sharp. The depth of our renderer is shown next to the input; boxes are enlarged as in Fig. G.7 .
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
Table G.4 : Depth source for the same renderer, without retraining. Parameters in millions; the renderer was trained with DA-V2-L.
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
Table H.1 : Complete refocusing on LFDOF (50 test scenes, input and target are two focal slices of one light field). Strength searched per image for the highest SSIM.
Figure H.1 : Complete refocusing on LFDOF. Each input is one focal slice of a light field and the target another slice of the same light field, with the focus moved onto the foreground leaves (top) or the flower stem (bottom); the red box is enlarged below each image. Only FlashReFocus brings the new focal region to the sharpness of the target, as the restored all-in-focus image keeps the detail that the renderer then leaves in focus; DiffCamera, GenRefocus, and MagicBokeh keep it soft, and AnyBokeh sharpens the stem with a rougher texture.
Figure H.2 : Tilt-shift on a portrait. The depth given to the renderer is replaced by a vertical ramp around a chosen row, at strength K=1 . A horizontal band stays sharp regardless of scene depth: at the face (left) the distant city and the valley blur, and at the valley (right) the buildings and the road are sharp while the subject in front blurs, giving the miniature look of a tilted lens.
Figure H.3 : Refocusing on Unsplash images. The focus moves to the green marker, onto a region that is out of focus in the input: the cliff in the first image and the foreground rock in the second. The red box enlarges the new focal region and the green box the former one; MagicBokeh does not restore the input, so its new focal region stays blurred; AnyBokeh, which edits the input directly, blurs the former focus but recovers less of the cliff’s rock structure.
Figure H.4 : Refocusing real captures. Canon EOS 750D (top) and iPhone 15 (bottom) photographs, each shown as input, the Stage I all-in-focus restoration, and the result rendered at the green focal point; the 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 of three Unsplash images (green marker); red box: new focal region, green box: former foreground, enlarged at right. Row 3 uses strength 0.8.
Figure H.6 : More complete refocusing on LFDOF , as in Fig. H.1 . The focus moves onto the cable behind a keyboard (top) and the cap of the glue bottle (bottom); the red box is enlarged below each image. FlashReFocus renders the cable and the keyboard as in the target, whereas GenRefocus adds a pattern to the wall behind them, AnyBokeh roughens the cable, and DiffCamera and MagicBokeh leave them soft; on the glue bottle, DiffCamera adds a texture that is not in the target.
Figure H.7 : Moving the focal point on two 3CReal and two RealBokeh test scenes , with the strength of FlashReFocus matched to GenRefocus ( K=15 ). The focal point (green marker) moves from far to near; for each scene the first column shows the all-in-focus input and the depth of our renderer (near bright). Both methods receive the same input and focal points. Below each result: PSNR and LPIPS of the in-focus region against 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 default strength 0.5 and GenRefocus at K=8.5 and 5.25; layout and metrics as in Fig. H.7 .
Figure H.9 : Two focal planes. Focus points are marked A and B (row 1: trunk, stump; row 2: left, right birch; row 3: flower, bench). Focusing on A or on B blurs the other one; editing the depth to the distance from the nearer of the two planes keeps both sharp while the rest stays blurred. Rows 1–2: RealBokeh test; row 3: 3CReal. Strength 1.5.
Figure H.10 : Controls on a portrait. All results are rendered from one restored all-in-focus image. Top: the focal point (green marker) on the can, the face, and the background at strength 0.8. Middle: strength with the focus on the face. Bottom: two focal planes by depth editing (Appendix H ), the edited depth, and the input. Boxes are enlarged below each result. † Beyond the trained range [0,1] .
Figure H.11 : Refocusing portraits. Four Unsplash portraits with a shallow depth of field. Stage I restores an all-in-focus image from each input, including its out-of-focus background, and the renderer then places the focus on the face or on the background (green marker) at strength K=0.8 . Focusing on the background brings back the trees, the aquarium rocks, the distant buildings, and the wall, while the subject is blurred according to its distance from the new focal plane; all edits of a portrait reuse one restored image.
Figure H.12 : Strength on portraits. The aquarium and city portraits of Fig. H.11 with the focus on the face (green marker) at strengths from K=0.25 to K=1 . The face stays sharp at every strength while the background blur grows with K , as when the aperture of a lens is opened; each result is one forward pass of the renderer on the same restored image.
Figure H.13 : Two focal planes on portraits. Focus on the face ( A , green marker), on the background ( B , yellow marker), and on both planes with the edited depth, at strength K=1 . With two planes, the face and the distant buildings or rocks are sharp at once while the space between them stays blurred, which a single lens cannot produce.
Figure H.14 : Refocusing within the foreground. An Unsplash portrait whose flowers span a range of depths in front of and behind the subject. Moving the focal point from the near buds (green marker) to the flowers behind the subject (yellow marker), at K=0.8 , shifts the sharp region through the flower bed while the subject’s dress and hands blur and sharpen with their distance to each plane.
Depth-of-field control is a fundamental tool in photography, yet post-capture bokeh editing from a single image remains challenging. A practical editor should handle images captured under arbitrary focus and aperture settings. Existing methods typically assume an all-in-focus input, or first recover an all-in-focus image before rendering new bokeh. Such pipelines can discard useful blur cues from the source image and propagate reconstruction artifacts into the final edit. We introduce AnyBokeh, a physics-guided framework for any-to-any bokeh editing. Instead of treating source blur merely as a degradation to be removed, AnyBokeh estimates the source blur state with a signed circle-of-confusion map and a disparity map. By modeling the linear relation between signed circle of confusion and disparity difference, AnyBokeh estimates a source-specific optical fingerprint and transfers the source optical characteristics to the desired focus and aperture setting. A generative editor conditioned on both source and target circle-of-confusion maps then performs relative blur synthesis, enabling spatially adaptive deblurring, preservation, and defocus rendering. To support physically supervised learning, we further construct a high-fidelity synthetic dataset with accurate depth, focus distance, and full EXIF metadata. Experiments on real-world benchmarks show that AnyBokeh achieves faithful and controllable editing across any-to-any bokeh editing, all-in-focus-to-bokeh rendering, and defocus deblurring, while avoiding all-in-focus reconstruction and test-time bokeh-level calibration commonly required by existing approaches. The code and dataset will be available at https://github.com/itsmag11/AnyBokeh.
Xinyu Hou, Xiaoming Li, Zongsheng Yue +1
S-Lab, College of Computing & Data Science, Nanyang Technological University, Singapore, 639798
Single-Image Defocus Deblurring (SIDD) aims to recover an all-in-focus image from a single defocused observation, but rigorous and reproducible evaluation remains challenging due to the scarcity of realistic, high-resolution datasets with well-aligned defocused/sharp pairs and standardized protocols. We build on RealDefocus, a benchmark derived from the real-world RealBokeh dataset originally proposed for Bokeh Rendering. RealDefocus provides paired defocused inputs and sharp ground truth images, predefined training/validation/test splits, and a unified evaluation framework for comparing image restoration and neural rendering approaches. We further outline a benchmarking protocol with cross-dataset validation to assess reconstruction quality and generalization. The project page is publicly available at: www.github.com/TimSeizinger/RealDefocus-Benchmark.
Tim Seizinger, Zhuyun Zhou, Radu Timofte
Computer Vision Lab, CAIDAS & IFI, University of Würzburg, Germany
Though there exists a reasonable forward model for blur based on optical physics, recovering depth from a collection of defocused images remains a computationally challenging optimization problem. In this paper, we show that with contemporary optimization methods and reasonable computing resources, a global optimization approach to depth from defocus is feasible. Our approach rests on alternating minimization. When holding the depth map fixed, the forward model is linear with respect to the all-in-focus image. When holding the all-in-focus image fixed, the depth at each pixel can be computed independently, enabling embarrassingly parallel computation. We show that alternating between convex optimization and parallel grid search can effectively solve the depth-from-defocus problem at higher resolutions than current deep learning methods. We demonstrate our approach on benchmark datasets with synthetic and real defocus blur and show promising results compared to prior approaches. Our code is available at github.com/hollyjackson/dfd.