alfredplpl
commited on
Commit
•
527f912
1
Parent(s):
0321ad8
Update README.md
Browse files
README.md
CHANGED
@@ -1,3 +1,23 @@
|
|
1 |
---
|
2 |
license: openrail++
|
3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
---
|
2 |
license: openrail++
|
3 |
---
|
4 |
+
|
5 |
+
# はじめに
|
6 |
+
このモデルはSDXLを0から作りたい人のモデルです。どこから作るかは個々人にお任せします。
|
7 |
+
|
8 |
+
sdxl_0.safetensorsはU-Netを0に置き換えています。プログラムは次のとおりです。
|
9 |
+
|
10 |
+
```python
|
11 |
+
from safetensors import safe_open
|
12 |
+
from safetensors.torch import save_file
|
13 |
+
import torch
|
14 |
+
|
15 |
+
tensors = {}
|
16 |
+
with safe_open("/path/to/sd_xl_base_1.0.safetensors", framework="pt", device=0) as f:
|
17 |
+
for k in f.keys():
|
18 |
+
tensors[k] = f.get_tensor(k)
|
19 |
+
if("model.diffusion_model" in k):
|
20 |
+
tensors[k]=torch.zeros_like(tensors[k])
|
21 |
+
|
22 |
+
save_file(tensors, "/path/to/sdxl_0.safetensors")
|
23 |
+
```
|