This is a fork of the official StyleShot Implementation, used to support my other project where I compare the results of the unofficial StyleDrop implementation to the results of StyleShot.
This project was tested to run under a v100 and L4 GPU using CUDA Version: 13.0
- The requirements have been updated
- some more logging was added to the text driven inference demo code
Please check out the results in my StyleDrop Project if you are interested.
# install styleshot
git clone https://github.com/pinkfloat/StyleShot
cd StyleShot
# create env
python3 -m venv venv_styleshot
source venv_styleshot/bin/activate
pip install -r requirements.txt
# download the models
git lfs install
git clone https://huggingface.co/Gaojunyao/StyleShot
git clone https://huggingface.co/Gaojunyao/StyleShot_lineart
you can download the pretrained weight from here. To run the demo, you should also download the following models:
For inference, you should download the pretrained weight and prepare your own reference style image or content image.
# run text-driven style transfer demo
python styleshot_text_driven_demo.py --style "{style_image_path}" --prompt "{prompt}" --output "{save_path}"
# run image-driven style transfer demo
python styleshot_image_driven_demo.py --style "{style_image_path}" --content "{content_image_path}" --preprocessor "Contour" --prompt "{prompt}" --output "{save_path}"
# integrate styleshot with controlnet and t2i-adapter
python styleshot_t2i-adapter_demo.py --style "{style_image_path}" --condition "{condtion_image_path}" --prompt "{prompt}" --output "{save_path}"
python styleshot_controlnet_demo.py --style "{style_image_path}" --condition "{condtion_image_path}" --prompt "{prompt}" --output "{save_path}"
- styleshot_text_driven_demo: text-driven style transfer with reference style image and text prompt.
- styleshot_image_driven_demo: image-driven style transfer with reference style image and content image.
To address the lack of a benchmark in reference-based stylized generation, the StyleShot authors established a style evaluation benchmark containing 40 content images and 73 distinct styles across 490 reference images.
If you find StyleShot useful for your research and applications, please cite using this BibTeX:
@article{gao2024styleshot,
title={Styleshot: A snapshot on any style},
author={Gao, Junyao and Liu, Yanchen and Sun, Yanan and Tang, Yinhao and Zeng, Yanhong and Chen, Kai and Zhao, Cairong},
journal={arXiv preprint arXiv:2407.01414},
year={2024}
}The StyleShot code is built upon IP-Adapter.

