Update README.md
Browse files
README.md
CHANGED
|
@@ -1,3 +1,19 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
```
|
| 2 |
+
import torch
|
| 3 |
+
from diffusers import PixArtAlphaPipeline
|
| 4 |
+
pipe = PixArtAlphaPipeline.from_pretrained("PixArt-alpha/PixArt-XL-2-1024-MS", torch_dtype=torch.float16)
|
| 5 |
+
pipe = pipe.to('cuda')
|
| 6 |
+
|
| 7 |
+
|
| 8 |
+
line = line.strip() ## caption line from either `caption_2k.txt' or `caption_5k.txt'
|
| 9 |
+
|
| 10 |
+
offset = 0
|
| 11 |
+
for fold in range(7):
|
| 12 |
+
images =pipe(line, num_images_per_prompt=10, ).images
|
| 13 |
+
[img.save(f"{ROOT}/{offset + k}.png") for k,img in enumerate(images)]
|
| 14 |
+
offset += 10
|
| 15 |
+
```
|
| 16 |
+
|
| 17 |
+
---
|
| 18 |
+
license: cc
|
| 19 |
+
---
|