arXiv:2610.23297cs.CVOct 2026

Manuscript Offprint

arXiv:2610.23297

FlashReFocus: Interactive Image Refocusing in Seconds

Ching-Heng Cheng, Chia-Ming Lee, Ming-Ching Chang, Xin Li, Yu-Lun Liu, Chih-Chung Hsu

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

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; infocus 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.3×148.3 \times faster than GenRefocus, and takes about half a second per further edit, 462×462 \times faster.

1. Introduction

Depth of field determines which parts of a photograph appear sharp and is fixed at capture. Smartphone portrait modes move the focus afterwards only by blurring an already sharp image with depth recorded at capture [61], so out-of-focus content stays blurred. Single-image refocusing lifts this limit by recovering an all-in-focus (AiF) image and re-rendering blur around a new focal plane [41].

Refocusing is interactive: a user tries several focal points and blur strengths on one photograph. Its two sub-problems differ in kind. Defocus is many-to-one: it discards high

(a) Single-stage diffusion (DiffCamera, MagicBokeh)

Figure

Diffusion per edit

No reusable AiF

6–136 s per edit

(b) Two-stage generative refocusing (GenRefocus, AnyBokeh)

Figure

Defocused input

Diffusion

stage 1

AiF or defocus maps

Diffusion

stage 2

Refocused

Reusable stage-1 output

12B diffusion per edit

183–217 s per edit

(c) FlashReFocus (ours)

Figure

Defocused input

Stage I

(one step)

AiF (reused)

Stage II

(1.3M)

Any focal point

and strength

One-step diffusion

Explicit focal control

Interactive (~0.5 s/edit)

(d) Deblur

GenRefocus

AnyBokeh

DiffCamera

MagicBokeh

FlashReFocus

153

n/a

n/a

n/a

1.94

100

First edit

371

191

136

6.13

2.50

100

Next edit

217

183

136

6.13

0.47

100

First + next

588

375

273

12.3

2.97

100

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×15361536 \times 1536 for deblurring, the first edit, each next edit, and both edits together.

frequencies, so recovering the AiF image is ill-posed and needs a learned prior; regression-based restorers [25, 73] over-smooth it [7], whereas diffusion priors [18, 46] synthesize realistic detail. In contrast, rendering blur is nearly well-posed: given depth and a focal plane, the circle of confusion (CoC) largely fixes the blur [41], so generation adds cost and error rather than information. Recent methods nevertheless use large diffusion models for both. DiffCamera [64] and MagicBokeh [54] map the input directly to the refocused image and leave no reusable AiF image; GenRefocus [36] and AnyBokeh [19] split the task but render with a second large diffusion model. Either way, every edit is a full generative pass that takes minutes at 1536×15361536 \times 1536 and regenerates regions meant to stay sharp (Fig. 1).

∗^{*}Equal contribution.

†^{\dagger}Corresponding author: chihchung@nycu.edu.tw

Figure

Figure 2. Overview of FlashReFocus. (A) Stage I restores an all-in-focus image I^AiF\hat{I}_{AiF} in one step with a frozen latent diffusion U-Net and an optional decoder refiner; (B) ω\omega 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.

This asymmetry suggests three principles for interactive refocusing, all followed by FlashReFocus (Fig. 2). (i) Generate once, render many. A session of N edits costs Crestore+NCrenderC_{restore} + N C_{render}, so the generative step belongs outside the editing loop: Stage I restores the AiF image once with one-step diffusion [57], and each edit runs only a 1.3M-parameter renderer. (ii) Edit only the blur. Changing the focus should leave in-focus content untouched, so Stage II adds a residual to the fixed AiF image; across edits, in-focus regions stay at 44.4 dB PSNR against 29.0 dB for GenRefocus. (iii) Control through optics. The renderer is conditioned on an explicit defocus map whose product with the strength mirrors the CoC, so the strength acts as an aperture and editing the map yields effects beyond a single lens, such as tilt-shift and two focal planes. Concretely, Stage I blends a pixel-fidelity and a detail LoRA with one weight ω\omega to trade fidelity for detail, learns from mixed real and synthetic blur, and adds a decoder refiner that keeps text and edges VAE decoding distorts; Stage II's defocus-bias attention lets pixels at similar defocus share information, so blur changes sharply at depth boundaries without interference from unrelated, possibly salient pixels at other depths. The costly prior thus runs once, where detail must be invented, and each edit runs a small network on a task that optics constrain, which makes FlashReFocus both fast and accurate.

Rendering also needs data with diverse focal settings: real pairs [22, 50] capture lens-specific bokeh at few focal planes, and synthetic pairs [38] any focal plane with simplified optics, so we pre-train on synthetic multi-focal scenes and adapt to real pairs. Both are single-camera datasets, so we introduce 3CReal, 89 pairs from three unseen cameras, to test cross-camera generalization. Our contributions are:

• For interactive refocusing, we propose a restore-once, render-many framework: diffusion runs once per photograph, and each edit runs only a lightweight renderer at interactive speed, leaving in-focus content unchanged.

• To address the ill-posedness of defocus deblurring, we adapt one-step diffusion with a VAE-decoder refiner, which recovers detail efficiently while balancing fidelity and perceptual quality in a simple, unified design.

• For precise control without complex designs, we craft the renderer’s defocus-bias attention and explicit defocus map, which set focus, strength, and depth edits directly.

• To further test generalization to unseen cameras, we collect 3CReal; on it and EBB!, FlashReFocus leads in perceptual fidelity, far faster than generative rivals.

References (76)