Update README.md
Browse files
README.md
CHANGED
@@ -1,3 +1,67 @@
|
|
1 |
---
|
2 |
-
license: openrail
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
---
|
2 |
+
license: creativeml-openrail-m
|
3 |
+
base_model: SG161222/Realistic_Vision_V4.0
|
4 |
+
datasets:
|
5 |
+
- recastai/LAION-art-EN-improved-captions
|
6 |
+
tags:
|
7 |
+
- stable-diffusion
|
8 |
+
- stable-diffusion-diffusers
|
9 |
+
- text-to-image
|
10 |
+
- diffusers
|
11 |
+
inference: true
|
12 |
---
|
13 |
+
|
14 |
+
# Text-to-image Distillation
|
15 |
+
|
16 |
+
This pipeline was distilled from **SG161222/Realistic_Vision_V4.0** on a Subset of **recastai/LAION-art-EN-improved-captions** dataset. Below are some example images generated with the tiny-sd model.
|
17 |
+
|
18 |
+
![val_imgs_grid](./grid_tiny.png)
|
19 |
+
|
20 |
+
|
21 |
+
This Pipeline is based upon [the paper](https://arxiv.org/pdf/2305.15798.pdf). Training Code can be found [here](https://github.com/segmind/BKSDM).
|
22 |
+
|
23 |
+
## Pipeline usage
|
24 |
+
|
25 |
+
You can use the pipeline like so:
|
26 |
+
|
27 |
+
```python
|
28 |
+
from diffusers import DiffusionPipeline
|
29 |
+
import torch
|
30 |
+
|
31 |
+
pipeline = DiffusionPipeline.from_pretrained("segmind/tiny-sd-mxtune", torch_dtype=torch.float16)
|
32 |
+
prompt = "Portrait of a pretty girl"
|
33 |
+
image = pipeline(prompt).images[0]
|
34 |
+
image.save("my_image.png")
|
35 |
+
```
|
36 |
+
|
37 |
+
## Training info
|
38 |
+
|
39 |
+
These are the key hyperparameters used during training:
|
40 |
+
|
41 |
+
* Steps: 125000
|
42 |
+
* Learning rate: 1e-4
|
43 |
+
* Batch size: 32
|
44 |
+
* Gradient accumulation steps: 4
|
45 |
+
* Image resolution: 512
|
46 |
+
* Mixed-precision: fp16
|
47 |
+
|
48 |
+
## Finetune info
|
49 |
+
|
50 |
+
These are the key hyperparameters used during training:
|
51 |
+
|
52 |
+
* Steps: 8000 / 100000
|
53 |
+
* Learning rate: 1e-5
|
54 |
+
* Batch size: 24
|
55 |
+
* Gradient accumulation steps: 1
|
56 |
+
* Image resolution: 768
|
57 |
+
* Mixed-precision: fp16
|
58 |
+
|
59 |
+
## Speed Comparision
|
60 |
+
|
61 |
+
We have observed that the distilled models are upto 80% faster than the Base SD1.5 Models. Below is a comparision on an A100 80GB.
|
62 |
+
|
63 |
+
![graph](./graph.png)
|
64 |
+
![comparision](./comparision1.png)
|
65 |
+
|
66 |
+
Below is the code for benchmarking the speeds
|
67 |
+
|