YouLiXiya commited on
Commit
c614e07
1 Parent(s): aaba5b3

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +24 -0
README.md CHANGED
@@ -1,3 +1,27 @@
1
  ---
2
  license: apache-2.0
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
  license: apache-2.0
3
  ---
4
+ ## Quickstart
5
+ ```python
6
+ !pip install diffusers
7
+ from diffusers import DiffusionPipeline
8
+ pipeline = DiffusionPipeline.from_pretrained(
9
+ "YouLiXiya/yl-consistency",
10
+ custom_pipeline="YouLiXiya/yl-consistency",
11
+ )
12
+
13
+ from PIL import Image
14
+ def make_grid(images, rows, cols):
15
+ w, h = images[0].size
16
+ grid = Image.new('RGB', size=(cols * w, rows * h))
17
+ for i, image in enumerate(images):
18
+ grid.paste(image, box=(i % cols * w, i // cols * h))
19
+ return grid
20
+
21
+ import matplotlib.pyplot as plt
22
+ images = pipeline(batch_size=64, num_inference_steps=10).images
23
+ grid = make_grid(images, 8, 8)
24
+ plt.imshow(grid)
25
+ plt.axis('off')
26
+ plt.show()
27
+ ```