Update README.md
Browse files
README.md
CHANGED
@@ -7,6 +7,29 @@ license: openrail++
|
|
7 |
|
8 |
## SDXL
|
9 |
### 単一ファイル
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
[sdxl_0.safetensors](sdxl_0.safetensors)はU-Netを0に置き換えています。作り方は以下のとおりです。
|
11 |
|
12 |
|
@@ -25,8 +48,6 @@ with safe_open("/path/to/sd_xl_base_1.0.safetensors", framework="pt", device=0)
|
|
25 |
save_file(tensors, "/path/to/sdxl_0.safetensors")
|
26 |
```
|
27 |
|
28 |
-
このファイルを[sd-scripts](https://github.com/kohya-ss/sd-scripts)でフルファインチューンをしてください。学習率は1e-4がおすすめです。(Stable Diffusion XL公式リポジトリより)
|
29 |
-
また、SDXLの場合、OpenCLIPの都合上、泣き顔などができないため、テキストエンコーダーの学習を行うこともおすすめします。
|
30 |
|
31 |
### diffusers
|
32 |
|
|
|
7 |
|
8 |
## SDXL
|
9 |
### 単一ファイル
|
10 |
+
|
11 |
+
[sdxl_0_n.safetensors](sdxl_0_n.safetensors)はU-Netをランダムな値に置き換えています。作り方は以下のとおりです。
|
12 |
+
|
13 |
+
```python
|
14 |
+
from safetensors import safe_open
|
15 |
+
from safetensors.torch import save_file
|
16 |
+
import torch
|
17 |
+
|
18 |
+
tensors = {}
|
19 |
+
with safe_open("/path/to/sd_xl_base_1.0.safetensors", framework="pt", device=0) as f:
|
20 |
+
for k in f.keys():
|
21 |
+
tensors[k] = f.get_tensor(k)
|
22 |
+
if("model.diffusion_model" in k):
|
23 |
+
tensors[k]=torch.randn_like(tensors[k])*1e-5
|
24 |
+
|
25 |
+
save_file(tensors, "/path/to/sdxl_0_n.safetensors")
|
26 |
+
|
27 |
+
```
|
28 |
+
|
29 |
+
このファイルを[sd-scripts](https://github.com/kohya-ss/sd-scripts)でフルファインチューンをしてください。学習率は1e-4がおすすめです。(Stable Diffusion XL公式リポジトリより)
|
30 |
+
また、SDXLの場合、OpenCLIPの都合上、泣き顔などができないため、テキストエンコーダーの学習を行うこともおすすめします。
|
31 |
+
|
32 |
+
|
33 |
[sdxl_0.safetensors](sdxl_0.safetensors)はU-Netを0に置き換えています。作り方は以下のとおりです。
|
34 |
|
35 |
|
|
|
48 |
save_file(tensors, "/path/to/sdxl_0.safetensors")
|
49 |
```
|
50 |
|
|
|
|
|
51 |
|
52 |
### diffusers
|
53 |
|