Bokeh Diffusion: Defocus Blur Control in Text-to-Image Diffusion Models

Armando Fortes, Tianyi Wei, Shangchen Zhou, Xingang Pan
3/11/2025
19 citations
cs.GRcs.CV
diffusion-flow

No official code found. Best implementation: atfortes/BokehDiffusion (129 stars, Python, last commit 2025-11-12).

Abstract

Recent advances in large-scale text-to-image models have revolutionized creative fields by generating visually captivating outputs from textual prompts; however, while traditional photography offers precise control over camera settings to shape visual aesthetics - such as depth-of-field via aperture - current diffusion models typically rely on prompt engineering to mimic such effects. This approach often results in crude approximations and inadvertently alters the scene content.

Show full abstract

In this work, we propose Bokeh Diffusion, a scene-consistent bokeh control framework that explicitly conditions a diffusion model on a physical defocus blur parameter. To overcome the scarcity of paired real-world images captured under different camera settings, we introduce a hybrid training pipeline that aligns in-the-wild images with synthetic blur augmentations, providing diverse scenes and subjects as well as supervision to learn the separation of image content from lens blur. Central to our framework is our grounded self-attention mechanism, trained on image pairs with different bokeh levels of the same scene, which enables blur strength to be adjusted in both directions while preserving the underlying scene. Extensive experiments demonstrate that our approach enables flexible, lens-like blur control, supports downstream applications such as real image editing via inversion, and generalizes effectively across both Stable Diffusion and FLUX architectures.

View on arXivView PDF

Code Implementations(1)

[SIGGRAPH Asia 2025] Official code for "Bokeh Diffusion: Defocus Blur Control in Text-to-Image Diffusion Models."

1298PythonMar 10, 20251 years agoNOASSERTION
bokehdiffusion-modelstext-to-image

Similar Papers

Cite this paper

@article{fortes2025bokeh,
  title  = {Bokeh Diffusion: Defocus Blur Control in Text-to-Image Diffusion Models},
  author = {Armando Fortes and Tianyi Wei and Shangchen Zhou and Xingang Pan},
  year   = {2025},
  eprint = {2503.08434},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2503.08434v5}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2503.08434.svg)](https://codeofpaper.com/paper/2503.08434)

Discussion