### Installation commands for RestorerID environment Source: https://github.com/yingjiacheng/restorerid/blob/main/README.md Creates a conda environment, installs xformers and taming-transformers, and installs the package. Run these commands in order to set up the project. ```bash # Create a conda environment and activate it conda env create --file environments.yaml conda activate RestorerID # Install xformers conda install xformers -c xformers/label/dev # Install taming-transfomers pip install -e git+https://github.com/CompVis/taming-transformers.git@master#egg=taming-transformers pip install -e . ``` -------------------------------- ### Inference commands for RestorerID Source: https://github.com/yingjiacheng/restorerid/blob/main/README.md Shows how to run inference with a pretrained model. Download the model from Hugging Face and place it at ckpt/RestorerIDFull.ckpt, then run the provided commands. ```bash # You can download the pretrained model from hugging-face and put it in ckpt path: ckpt/RestorerIDFull.ckpt [RestorerID-huggingface](https://huggingface.co/YingJiacheng/RestorerID/) # run bash inference.sh or CUDA_VISIBLE_DEVICES=0 python scripts/Inference.py --LQpath TestSamples/1/lq1.png --Refpath TestSamples/1/ref1.png --Outputpath Results/1/ ``` -------------------------------- ### Training commands for RestorerID base model and full model Source: https://github.com/yingjiacheng/restorerid/blob/main/README.md Commands to train the base model and then the full RestorerID model. Includes steps to download pretrained models and prepare datasets. ```bash # First train base model # download sdv15 pretrained model (runwayml/v1-5-pruned.ckpt) from huggingface([RestorerID-huggingface](https://huggingface.co/YingJiacheng/RestorerID/)), put into the ckpt path as: ckpt/v1-5-pruned.ckpt # prepare your datasets CUDA_VISIBLE_DEVICES=0,1 python train_basemodel.py --train --base configs/v15/v15-BaseModel.yaml --name v15_basemodel --scale_lr False # Then train RestorerID # rename your trained base model and put to ckpt path as: ckpt/basemodel.ckpt # download ID model ip-adapter-faceid-plus_sd15.bin from [IPAdapter-huggingface](https://huggingface.co/h94/IP-Adapter-FaceID/tree/main)(or [RestorerID-huggingface](https://huggingface.co/YingJiacheng/RestorerID/)), put it into the ckpt path as: ckpt/ip-adapter-faceid-plus_sd15.bin # prepare your datasets # combine basemodel with ID model python Combineckpt.py CUDA_VISIBLE_DEVICES=0,1 python train_RestorerID.py --train --base configs/v15/v15-RestorerID.yaml --name RestorerID --scale_lr False ``` -------------------------------- ### Dataset names for RestorerID Source: https://github.com/yingjiacheng/restorerid/blob/main/README.md Lists the dataset names used for training and evaluation: FFHQ, VGGFace2, and Celeb-Ref. ```text FFHQ VGGFace2 Celeb-Ref ```