General Introduction
Kolors is a large-scale text-to-image generation model developed by the Racer team, based on potential diffusion techniques. The model is trained on billions of text-image pairs of data, supports bilingualism in English and Chinese, and is capable of generating high-quality, complex semantically-accurate images.Kolors has significant advantages in visual quality, complex semantic accuracy, and text rendering, and is suitable for both academic research and commercial use.
Online Experience:
https://huggingface.co/spaces/Kwai-Kolors/Kolors-Virtual-Try-On
https://modelscope.cn/studios/Kwai-Kolors/Kolors-Virtual-Try-On
https://virtual-try-on.online/zh/playground
Function List
- Text-to-Image Generation: Input text descriptions to generate corresponding high-quality images.
- Virtual Try-On: Upload portraits and clothing pictures to generate realistic virtual try-on effects.
- Multiple model support: including ControlNet, IP-Adapter, LoRA, etc.
- Open source code: complete training and inference code is provided to support academic research and commercial applications.
- Multi-Platform Compatibility: Supports Diffusers, ComfyUI and other platforms.
Using Help
Installation process
- environmental preparation: Ensure that Python 3.8 and above is installed and that the necessary dependency libraries are installed.
pip install -r requirements.txt
- Download model: fromGitHubmaybeHugging FaceDownload Kolors model weights.
- Configuration environment: Configure environment variables and paths according to the guidelines in the README file.
Guidelines for use
- Text-to-Image Generation::
- Run the following command and enter a text description to generate an image:
python generate.py --text "A dog running on grass."
- The generated image will be saved in the specified directory.
- Run the following command and enter a text description to generate an image:
- virtual try-on::
- Upload portrait pictures and costume pictures:
python virtual_try_on.py --person_image "person.jpg" --clothing_image "clothing.jpg"
- The generated virtual fitting results will be saved in the specified directory.
- Upload portrait pictures and costume pictures:
- model training::
- Use the following command to start training:
python train.py --config "config.yaml"
- Adjust the parameters in the configuration file, such as learning rate, batch size, etc., as required.
- Use the following command to start training:
- Multi-Platform Compatibility::
- Use Kolors in Diffusers:
from diffusers import DiffusionPipeline pipeline = DiffusionPipeline.from_pretrained("Kwai-Kolors/Kolors") image = pipeline("A dog running on grass.").images[0] image.save("output.png")
- Using Kolors in ComfyUI:
from comfyui import ComfyUI ui = ComfyUI(model="Kwai-Kolors/Kolors") ui.generate("A dog running on grass.", output="output.png")
- Use Kolors in Diffusers:
common problems
- How to improve the quality of generated images?
- Adjusting model parameters such as increasing the amount of training data, optimizing the learning rate, etc.
- What if the virtual fitting doesn't work?
- Ensure that the uploaded images are clear and well lit, and adjust the angles and proportions of the clothing images.
- Model training taking too long?
- Train with high-performance GPUs or choose a cloud computing platform to accelerate the training process.