DJCan commited on
Commit
09b06f1
1 Parent(s): f44c90a

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +21 -29
README.md CHANGED
@@ -23,37 +23,29 @@ Kolors is a large-scale text-to-image generation model based on latent diffusion
23
 
24
 
25
  ## 🚀 Quick Start
26
- ### Requirements
 
 
 
 
27
 
28
- * Python 3.8 or later
29
- * PyTorch 1.13.1 or later
30
- * Transformers 4.26.1 or later
31
- * Recommended: CUDA 11.7 or later
32
- <br>
33
-
34
- 1. Repository cloning and dependency installation
35
 
36
- ```bash
37
- apt-get install git-lfs
38
- git clone https://github.com/Kwai-Kolors/Kolors
39
- cd Kolors
40
- conda create --name kolors python=3.8
41
- conda activate kolors
42
- pip install -r requirements.txt
43
- python3 setup.py install
44
- ```
45
- 2. Weights download([link](https://huggingface.co/Kwai-Kolors/Kolors)):
46
- ```bash
47
- huggingface-cli download --resume-download Kwai-Kolors/Kolors --local-dir weights/Kolors
48
- ```
49
- or
50
- ```bash
51
- git lfs clone https://huggingface.co/Kwai-Kolors/Kolors weights/Kolors
52
- ```
53
- 3. Inference:
54
- ```bash
55
- python3 scripts/sample.py "一张瓢虫的照片,微距,变焦,高质量,电影,拿着一个牌子,写着“可图”"
56
- # The image will be saved to "scripts/outputs/sample_test.jpg"
57
  ```
58
 
59
 
 
23
 
24
 
25
  ## 🚀 Quick Start
26
+ ### Using with Diffusers
27
+ Make sure you upgrade to the latest version of diffusers: pip install -U diffusers. And then you can run:
28
+ ```python
29
+ import torch
30
+ from diffusers import KolorsPipeline
31
 
32
+ pipe = KolorsPipeline.from_pretrained(
33
+ "Kwai-Kolors/Kolors-diffusers",
34
+ torch_dtype=torch.float16,
35
+ variant='fp16',
36
+ trust_remote_code=True,
37
+ force_zeros_for_empty_prompt=False,)
38
+ pipe = pipe.to("cuda")
39
 
40
+ image = pipe(
41
+ "一张瓢虫的照片,微距,变焦,高质量,电影,拿着一个牌子,写着“可图”",
42
+ height=1024,
43
+ width=1024,
44
+ num_inference_steps=50,
45
+ guidance_scale=5.0,
46
+ generator= torch.Generator(pipe.device).manual_seed(66),
47
+ ).images[0]
48
+ image.show()
 
 
 
 
 
 
 
 
 
 
 
 
49
  ```
50
 
51