Zheng-Hui Huang1,2, Zhixiang Wang1*, Yu-Lun Liu3, Yung-Yu Chuang2
1Shanda AI Research Tokyo 2National Taiwan University 3National Yang Ming Chiao Tung University
*Corresponding author
Separate a single photo taken through glass into a transmission layer (the reflection-free image) and a reflection layer, using a Stable Diffusion 2 model fine-tuned to generate both at once. See the project page for the method.
conda create -y -n diffrs python=3.10 && conda activate diffrs
pip install torch==2.5.1 torchvision==0.20.1 --index-url https://download.pytorch.org/whl/cu121
pip install -r requirements.txtDownload the pre-trained weights into ./checkpoints:
huggingface-cli download Brian9999/diff-reflection-separation --repo-type model --local-dir ./checkpointsThe SD-2 base model is fetched automatically on first run (default
sd2-community/stable-diffusion-2-1; override with --base_model).
python infer_layersep.py --input_dir ./samples --save_to_dir ./outputsThe defaults match the paper setting (960×960, w = 0.8, disjoint sampling
k = 0.2, latent optimization on). Point --input_dir at any folder of images.
Each input yields three files: *_transmission.png (the result),
*_reflection.png, and *_ori_transmission.png (transmission before CFW
refinement). Run with -h for all options.
All are on by default; disable individually to study their effect.
| Flag | Effect |
|---|---|
--no-optimization |
Turn off latent optimization (learned composition module, LRM). |
--no-s_sampling |
Turn off disjoint sampling (strength k = 0.2). |
--w <float> |
FGFM/CFW refiner strength on the transmission (default 0.8; 0 = off). |
Latent optimization is used in the paper and is on by default. For faster
inference, turn it off with --no-optimization (at a small quality trade-off).
We use the same training and test data as DSRNet. Please refer to their repository for dataset preparation and download links.
@inproceedings{huang2026reflection,
title = {Reflection Separation from a Single Image via Joint Latent Diffusion},
author = {Huang, Zheng-Hui and Wang, Zhixiang and Liu, Yu-Lun and Chuang, Yung-Yu},
booktitle = {CVPR},
year = {2026}
}