Enhance old or low-quality images in ComfyUI. Optional features include automatic scratch removal and face enhancement. Based on Microsoft's Bringing-Old-Photos-Back-to-Life. Requires installing models, so see instructions here: https://github.com/cdb-boop/ComfyUI-Bringing-Old-Photos-Back-to-Life.
Enhance old or low-quality images in ComfyUI. Optional features include automatic scratch removal and face enhancement. Requires installing a number of small checkpoints and VAEs.
Based on microsoft/Bringing-Old-Photos-Back-to-Life.
Before installing, make sure that any virtual environment is activated and if needed, prepend the target python executable before the pip command.
cd ./ComfyUI-Bringing-Old-Photos-Back-to-Life/
path\to\python.exe pip install -r requirements.txt --upgrade
PyTorch and TorchVision are also required, but should already be installed. (See the main ComfyUI repo for installation details.)
You may encounter issues while trying to install dlib on Windows. Here are some possible solutions:
You may need to have CMake already installed on your system and CMake\bin
added to your PATH to build Dlib.
path\to\python.exe -m pip install easydict matplotlib opencv-python scikit-image scipy
path\to\python.exe -m pip install cmake
path\to\python.exe -m pip install dlib==19.24.1
Alternatively, some people have pre-built wheels for Dlib, however, there may not be any built with your version of python.
path\to\python.exe -m pip install path\to\dlib.whl
Set device_ids
as a comma separated list of device ids (i.e. 0
or 1,2
). Use -1
for cpu.
Place in models/vae/
.
Extract the following models and place them inside models/vae/
.
Extract the following models and place them inside models/checkpoints/
.
Extract the following models and place them inside models/checkpoints/
.
Download - shape_predictor_68_face_landmarks.dat
Extract the following models and place them inside models/facedetection/
(custom directory).
Download - Face Enhancement Models
Extract the following models and place them inside models/checkpoints/
.
Set device_ids
as a comma separated list of device ids (i.e. 0
or 1,2
). Use -1
for cpu.
Running the models may fail if image dimensions are not multiples of 8 or 16 pixels (depends on the model used).
@inproceedings{wan2020bringing,
title={Bringing Old Photos Back to Life},
author={Wan, Ziyu and Zhang, Bo and Chen, Dongdong and Zhang, Pan and Chen, Dong and Liao, Jing and Wen, Fang},
booktitle={Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition},
pages={2747--2757},
year={2020}
}
@article{wan2020old,
title={Old Photo Restoration via Deep Latent Space Translation},
author={Wan, Ziyu and Zhang, Bo and Chen, Dongdong and Zhang, Pan and Chen, Dong and Liao, Jing and Wen, Fang},
journal={arXiv preprint arXiv:2009.07047},
year={2020}
}
The codes and the pretrained model in this repository are under the MIT license as specified by the LICENSE file. We use our labeled dataset to train the scratch detection model.
This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.