Update README.md
Browse files
README.md
CHANGED
|
@@ -22,25 +22,35 @@ Kolors is a large-scale text-to-image generation model based on latent diffusion
|
|
| 22 |
|
| 23 |
## 🚀 Quick Start
|
| 24 |
### Using with Diffusers
|
| 25 |
-
Make sure you upgrade to the latest version of diffusers:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 26 |
```python
|
| 27 |
import torch
|
|
|
|
| 28 |
from diffusers import KolorsPipeline
|
| 29 |
|
| 30 |
pipe = KolorsPipeline.from_pretrained(
|
| 31 |
-
"Kwai-Kolors/Kolors-diffusers",
|
| 32 |
-
torch_dtype=torch.float16,
|
| 33 |
-
variant=
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
|
| 38 |
image = pipe(
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
width=1024,
|
| 42 |
-
num_inference_steps=50,
|
| 43 |
guidance_scale=5.0,
|
|
|
|
| 44 |
generator=torch.Generator(pipe.device).manual_seed(66),
|
| 45 |
).images[0]
|
| 46 |
image.show()
|
|
|
|
| 22 |
|
| 23 |
## 🚀 Quick Start
|
| 24 |
### Using with Diffusers
|
| 25 |
+
Make sure you upgrade to the latest version of diffusers==0.30.0.dev0:
|
| 26 |
+
```
|
| 27 |
+
git clone https://github.com/huggingface/diffusers
|
| 28 |
+
cd diffusers
|
| 29 |
+
python3 setup.py install
|
| 30 |
+
```
|
| 31 |
+
**Notes:**
|
| 32 |
+
- The pipeline uses the `EulerDiscreteScheduler` by default. We recommend using this scheduler with `guidance scale=5.0` and `num_inference_steps=50`.
|
| 33 |
+
- The pipeline also supports the `EDMDPMSolverMultistepScheduler`. `guidance scale=5.0` and `num_inference_steps=25` is a good default for this scheduler.
|
| 34 |
+
|
| 35 |
+
And then you can run:
|
| 36 |
```python
|
| 37 |
import torch
|
| 38 |
+
|
| 39 |
from diffusers import KolorsPipeline
|
| 40 |
|
| 41 |
pipe = KolorsPipeline.from_pretrained(
|
| 42 |
+
"Kwai-Kolors/Kolors-diffusers",
|
| 43 |
+
torch_dtype=torch.float16,
|
| 44 |
+
variant="fp16"
|
| 45 |
+
).to("cuda")
|
| 46 |
+
|
| 47 |
+
prompt = '一张瓢虫的照片,微距,变焦,高质量,电影,拿着一个牌子,写着"可图"'
|
| 48 |
|
| 49 |
image = pipe(
|
| 50 |
+
prompt=prompt,
|
| 51 |
+
negative_prompt="",
|
|
|
|
|
|
|
| 52 |
guidance_scale=5.0,
|
| 53 |
+
num_inference_steps=50,
|
| 54 |
generator=torch.Generator(pipe.device).manual_seed(66),
|
| 55 |
).images[0]
|
| 56 |
image.show()
|