You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/distilled_sd.md
+50-37Lines changed: 50 additions & 37 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,40 +1,66 @@
1
-
# Running distilled models: SSD1B and SD1.x with tiny U-Nets
1
+
# Running distilled models: SSD1B and SDx.x with tiny U-Nets
2
2
3
-
## Preface
3
+
## Preface
4
4
5
-
This kind of models have a reduced U-Net part.
6
-
Unlike other SDXL models the U-Net of SSD1B has only one middle block and lesser attention layers in up and down blocks, resulting in relatively smaller files. Running these models saves more than 33% of the time. For more details, refer to Segmind's paper on https://arxiv.org/abs/2401.02677v1 .
7
-
Unlike other SD 1.x models Tiny-UNet models consist of only 6 U-Net blocks, resulting in relatively smaller files (approximately 1 GB). Running these models saves almost 50% of the time. For more details, refer to the paper: https://arxiv.org/pdf/2305.15798.pdf .
5
+
These models feature a reduced U-Net architecture. Unlike standard SDXL models, the SSD-1B U-Net contains only one middle block and fewer attention layers in its up- and down-blocks, resulting in significantly smaller file sizes. Using these models can reduce inference time by more than 33%. For more details, refer to Segmind's paper: https://arxiv.org/abs/2401.02677v1.
6
+
Similarly, SD1.x- and SD2.x-style models with a tiny U-Net consist of only 6 U-Net blocks, leading to very small files and time savings of up to 50%. For more information, see the paper: https://arxiv.org/pdf/2305.15798.pdf.
8
7
9
8
## SSD1B
10
9
11
-
Unfortunately not all of this models follow the standard model parameter naming mapping.
12
-
Anyway there are some very useful SSD1B models available online, such as:
10
+
Note that not all of these models follow the standard parameter naming conventions. However, several useful SSD-1B models are available online, such as:
These models need some conversion, for example because partially tensors are **non contiguous** stored. To create a usable checkpoint file, follow these **easy** steps:
60
+
These models also require conversion, partly because some tensors are stored in a non-contiguous manner. To create a usable checkpoint file, follow these simple steps:
61
+
Download and prepare the model using Python:
34
62
35
-
### Download model from Hugging Face
36
-
37
-
Download the model using Python on your computer, for example this way:
63
+
##### Download the model using Python on your computer, for example this way:
38
64
39
65
```python
40
66
import torch
@@ -46,35 +72,22 @@ for param in unet.parameters():
The file **segmind_tiny-sd.ckpt**will be generated and is now ready to use with sd.cpp
83
+
The file segmind_tiny-sd.ckptwill be generated and is now ready for use with sd.cpp. You can follow a similar process for the other models mentioned above.
67
84
68
-
You can follow a similar process for other models mentioned above from Hugging Face.
0 commit comments