https://arxiv.org/abs/2502.03500
Recent advances in generative image restoration (IR) have demonstrated impressive results. However, these methods are hindered by their substantial size and computational demands, rendering them unsuitable for deployment on edge devices. This work introduces ELIR, an Efficient Latent Image Restoration method. ELIR addresses the distortion-perception trade-off within the latent space and produces high-quality images using a latent consistency flow-based model. In addition, ELIR introduces an efficient and lightweight architecture. Consequently, ELIR is 4x smaller and faster than stateof- the-art diffusion and flow-based approaches for blind face restoration, enabling a deployment on resource-constrained devices. Comprehensive evaluations of various image restoration tasks and datasets show that ELIR achieves competitive performance compared to state-of-the-art methods, effectively balancing distortion and perceptual quality metrics while significantly reducing model size and computational cost.
π Blind Face Restoration $~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~$ π Blind Super Resolution (x4)
To install the necessary dependencies, run the following commands:
git clone https://github.com/yourusername/ELIR.git
cd ELIR
pip install -r requirements.txtFFHQ contains 70k high-quality PNG face images at 1024x1024 resolution, diverse in age, ethnicity, and background.
- Download: https://github.com/NVlabs/ffhq-dataset
ImageNet-1K contains 1.2M general-contnet images at different shapes.
- Download: https://image-net.org/index.php
Synthesised and in-the-wild face images.
- Download: https://xinntao.github.io/projects/gfpgan
- Put 'celeba_512_validation_lq' and 'celeba_512_validation' folders in the same 'celeba' folder
Synthesised and real-world imges.
- Download: https://github.com/zsyOAOA/ResShift
Evaluation is done by Image Quality Assessment (IQA) toolbox for pytorch taken from https://github.com/chaofengc/IQA-PyTorch
- Configuration: Edit the yml configuration file:
- Set
out_dirto your desired output directory. - Set
train_datasetto your training dataset path. - Set
val_datasetto your validation dataset path.
- Set
- Training: Execute the training script for the specific task:
- Blind Face Restoration:
python train.py -y configs/elir_train_bfr.yml
- Super Resolution (x8):
python train.py -y configs/elir_train_sr.yml
- Denoising:
python train.py -y configs/elir_train_denoising.yml
- Inpainting:
python train.py -y configs/elir_train_inpainting.yml
- Blind Super Resolution (x4):
python train.py -y configs/elir_train_bsr.yml
| Task | Model Weight |
|---|---|
| blind face restoration | elir_bfr.pth |
| super resolution | elir_sr.pth |
| denoising | elir_denoising.pth |
| inpainting | elir_inpainting.pth |
| blind super resolution | elir_bsr.pth |
- Configuration: Edit the yml configuration file:
- Set
pathto the path of the trained model. - Set
val_datasetto your validation dataset path.
- Set
- Evaluation: Execute the evaluation script for the specific task:
- Blind Face Restoration:
python eval.py -y configs/elir_infer_bfr.yml
- Super Resolution (x8):
python eval.py -y configs/elir_infer_sr.yml
- Denoising:
python eval.py -y configs/elir_infer_denoising.yml
- Inpainting:
python eval.py -y configs/elir_infer_inpainting.yml
- Blind Super Resolution (x4):
python eval.py -y configs/elir_infer_bsr.yml
- Configuration: Edit the yml configuration file:
- Set
pathto the path of the trained model. - Set
in_folderandout_folderto the directory containing your low-quality images and for output.
- Set
- Inference: Execute the inference script for the specific task:
- Blind Face Restoration:
python infer.py -y configs/elir_infer_bfr.yml
- Super Resolution (x8):
python infer.py -y configs/elir_infer_sr.yml
- Denoising:
python infer.py -y configs/elir_infer_denoising.yml
- Inpainting:
python infer.py -y configs/elir_infer_inpainting.yml
- Blind Super Resolution (x4):
python infer.py -y configs/elir_infer_bsr.yml
If you find this project useful, please consider cite:
@article{cohen2025efficient,
title={Efficient Image Restoration via Latent Consistency Flow Matching},
author={Cohen, Elad and Achituve, Idan and Diamant, Idit and Netzer, Arnon and Habi, Hai Victor},
journal={arXiv preprint arXiv:2502.03500},
year={2025}
}Tiny AutoEncoder for Stable Diffusion: https://github.com/madebyollin/taesd





