Skip to content

Latest commit

 

History

History
 
 

ipadapter

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

📖 Introduction

We provide IP-Adapter-Plus weights and inference code based on Kolors-Basemodel. Examples of Kolors-IP-Adapter-Plus results are as follows:

Example Result
Reference Image Prompt Result Image
穿着黑色T恤衫,上面中文绿色大字写着“可图”。

Wearing a black T-shirt with the Chinese characters "Ketu" written in large green letters on it.
一只可爱的小狗在奔跑。

A cute dog is running.

Our improvements

  • A stronger image feature extractor. We employ the Openai-CLIP-336 model as the image encoder, which allows us to preserve more details in the reference images
  • More diverse and high-quality training data: We construct a large-scale and high-quality training dataset inspired by the data strategies of other works. We believe that paired training data can effectively improve performance.

📊 Evaluation

For evaluation, we create a test set consisting of over 200 reference images and text prompts. We invite several image experts to provide fair ratings for the generated results of different models. The experts rate the generated images based on four criteria: visual appeal, text faithfulness, image faithfulness, and overall satisfaction. Image faithfulness measures the semantic preservation ability of IP-Adapter on reference images, while the other criteria follow the evaluation standards of BaseModel. The specific results are summarized in the table below, where Kolors-IP-Adapter-Plus achieves the highest overall satisfaction score.

Model Average Overall Satisfaction Average Image Faithfulness Average Visual Appeal Average Text Faithfulness
SDXL-IP-Adapter-Plus 2.29 2.64 3.22 4.02
Midjourney-v6-CW 2.79 3.0 3.92 4.35
Kolors-IP-Adapter-Plus 3.04 3.25 4.45 4.30

The ip_scale parameter is set to 0.3 in SDXL-IP-Adapter-Plus, while Midjourney-v6-CW utilizes the default cw scale.



Compare Result
Reference Image Prompt Kolors-IP-Adapter-Plus Result SDXL-IP-Adapter-Plus Result Midjourney-v6-CW Result
一个看向远山的少女形象,雪山背景,采用日本浮世绘风格,混合蓝色和红色柔和调色板,高分辨率

Image of a girl looking towards distant mountains, snowy mountains background, in Japanese ukiyo-e style, mixed blue and red pastel color palette, high resolution.
一个漂亮的美女,看向远方

A beautiful lady looking into the distance.
可爱的猫咪,在花丛中,看镜头

Cute cat among flowers, looking at the camera.
站在丛林前,戴着太阳帽,高画质,高细节,高清,疯狂的细节,超高清

Standing in front of the jungle, wearing a sun hat, high quality, high detail, high definition, crazy details, ultra high definition.
做个头像,新海诚动漫风格,丰富的色彩,唯美风景,清新明亮,斑驳的光影,最好的质量,超细节,8K画质

Create an avatar, Shinkai Makoto anime style, rich colors, beautiful scenery, fresh and bright, mottled light and shadow, best quality, ultra-detailed, 8K quality.

Kolors-IP-Adapter-Plus employs chinese prompts, while other methods use english prompts.

🛠️ Usage

Requirements

The dependencies and installation are basically the same as the Kolors-BaseModel.


  1. Repository Cloning and Dependency Installation
apt-get install git-lfs
git clone https://github.com/Kwai-Kolors/Kolors
cd Kolors
conda create --name kolors python=3.8
conda activate kolors
pip install -r requirements.txt
python3 setup.py install
  1. Weights download link
huggingface-cli download --resume-download Kwai-Kolors/Kolors-IP-Adapter-Plus --local-dir weights/Kolors-IP-Adapter-Plus

or

git lfs clone https://huggingface.co/Kwai-Kolors/Kolors-IP-Adapter-Plus weights/Kolors-IP-Adapter-Plus
  1. Inference:
python ipadapter/sample_ipadapter_plus.py ./ipadapter/asset/test_ip.jpg "穿着黑色T恤衫,上面中文绿色大字写着“可图”"

python ipadapter/sample_ipadapter_plus.py ./ipadapter/asset/test_ip2.png "一只可爱的小狗在奔跑"

# The image will be saved to "scripts/outputs/"

Note

The IP-Adapter-FaceID model based on Kolors will also be released soon!


Acknowledgments

  • Thanks to IP-Adapter for providing the codebase.