This repository contains a script to generate grayscale mask images suitable for use in diffusion model fine-tuning for human subjects.
It supports specifying different weights for face, hair, body and background. It also supports automatic selection of the correct subject when multiple persons exist in the same input image, using face recognition.
- Clone this repository
- Create a python virtual environment
- Install PyTorch
- Install dependencies from
requirements.txt
Example:
python main.py --input-dir /path/to/image/folder --output-dir /path/to/destination/folder --target-ref /path/to/subject/face
For documentation on all the script parameters please take a look inside the script file, at the bottom.