Image-to-Image
Diffusers
image-editing
bokeh-editing
LoRA

AnyBokeh: Physics-Guided Any-to-Any Bokeh Editing with Optical Fingerprint Transfer

Paper | Project Page | Code

Input | Output

AnyBokeh transforms an image from an arbitrary source optical state to a desired target focus and aperture setting. It consists of two LoRAs on top of FLUX.1-Fill-dev:

  • stage1-pytorch_lora_weights.safetensors: estimates the circle-of-confusion (CoC) map and the disparity map of the input image.
  • stage2-pytorch_lora_weights.safetensors: re-renders the image with the target focus point and aperture.

stage1-prompt_embeds.pt, stage1-pooled_prompt_embeds.pt, stage2-prompt_embeds.pt, and stage2-pooled_prompt_embeds.pt are the precomputed text embeddings, so the text encoders are not needed at inference.

Usage

git clone https://github.com/itsmag11/AnyBokeh.git
cd AnyBokeh
python inference_full.py --image_path examples/127_f5.0.JPG --focus_x 904 --focus_y 613 --source_aperture 5.0 --target_aperture 2.8 --output_path outputs/127_f5.0_to_f2.8.jpg

The weights in this repo are downloaded automatically. See the GitHub repo for more details.

Citation

@inproceedings{hou2026anybokeh,
  title     = {AnyBokeh: Physics-Guided Any-to-Any Bokeh Editing with Optical Fingerprint Transfer},
  author    = {Hou, Xinyu and Li, Xiaoming and Yue, Zongsheng and Loy, Chen Change},
  booktitle = {Advances in Neural Information Processing Systems (NeurIPS)},
  year      = {2026}
}
Downloads last month
31
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Model tree for itsmag11/AnyBokeh

Finetuned
(35)
this model

Space using itsmag11/AnyBokeh 1

Paper for itsmag11/AnyBokeh