This repository contains the unofficial PyTorch implementation of the paper The Chosen One: Consistent Characters in Text-to-Image Diffusion Models, using the Diffuser framework.
Shout out to the authors for their great work, also please consider giving a star🌟 if you find this implementation helpful.😻😻😻
(Note that I didn't carefully adjust the hyperparameters for generating the results above and they are still good enough.)
- Code release.
- Training instructions.
- Inference instructions.
- ControlNet support.
- Local image editing.
- Some visualization results.
This will only work on Windows
Clone the repository and install the required packages:
git clone https://github.com/paratechnical/TheChosenOne.git
cd TheChosenOne
pip install -r requirements.txt
You also need to modify your configuration file in config/theChosenOne.yaml
to fit your local environment.
Update torch to use CUDA
pip install torch==2.0.1 torchvision==0.15.2 --index-url https://download.pytorch.org/whl/cu118 --upgrade
Go to this address and download a proper driver for your graphics card and then install it
https://www.nvidia.com/Download/index.aspx
You need to create a backup data folder to store the initial images generated in the first loop for faster training start up next time if you want to train on the same character again. This is set up in the configuration file as follows:
backup_data_dir_root: Your absolute path to the data folder
python main.py
Simply run:
python inference.py
The script will load the model you designated in the inference.py
and your config file.
Please always remember to respect the authors and cite their work properly. 🫡
@article{avrahami2023chosen,
title={The Chosen One: Consistent Characters in Text-to-Image Diffusion Models},
author={Avrahami, Omri and Hertz, Amir and Vinker, Yael and Arar, Moab and Fruchter, Shlomi and Fried, Ohad and Cohen-Or, Daniel and Lischinski, Dani},
journal={arXiv preprint arXiv:2311.10093},
year={2023}
}