libcom is an image composition toolbox covering various related tasks, including naive image composition, image blending, color transfer, image harmonization, painterly harmonization, object placement, etc. Detailed technical details and api descriptions can be found in the official [documents].
git clone https://github.com/bcmi/libcom.git
cd libcom/requirements
conda env create -f libcom.yaml
conda activate Libcom
pip install -r runtime.txt # -i https://pypi.tuna.tsinghua.edu.cn/simple
# install a specific version of taming-transformers from source code
cd ../libcom/controllable_composition/source/ControlCom/src/taming-transformers
python setup.py install
pip install libcom
or
python setup.py install
After that, you can verify the installation by running:
cd tests
sh run_all_tests.sh
The visualization results can be found in results
folder.
During using the toolbox, the pretrained models and related files will be automatically downloaded to the installation directory. Note downloading the pretrained models may take some time when you first call some models, especially ControlComModel
and PainterlyHarmonizationModel
.
Alternatively, you can download these files from [Modelscope] or [Huggingface] in advance, and move them to the installation directory.