thanks to ❤
Browse filesThis view is limited to 50 files because it contains too many changes.
See raw diff
- class_data_dir/0-dc6ed8b8fca29b437c39135e9491d373694a8d72.jpg +0 -0
- class_data_dir/1-c336a7b439e3f39b86dc9ab09cd5d1e5e9dc86f3.jpg +0 -0
- class_data_dir/10-cd4988749222a52bc6d879c6962a10018b6f3080.jpg +0 -0
- class_data_dir/11-54683def17aac089d04586e0e86ddcd6574ca677.jpg +0 -0
- class_data_dir/2-8ebe69ef4cfc0490a9a2eb1f373787b8df335030.jpg +0 -0
- class_data_dir/3-202ae73c76af1316556bd594695e3c5669f1f673.jpg +0 -0
- class_data_dir/4-0045be9ab9688f91ca2e9cd1687470f1fdc9bfba.jpg +0 -0
- class_data_dir/5-db52f4c1f0524f0cbe6fad4c622e7e691c4703cb.jpg +0 -0
- class_data_dir/6-719648ef08f348a92fa718f169e7c07cee020967.jpg +0 -0
- class_data_dir/7-f5e60769a5ab267a0e176dd0469eac56db3d01fb.jpg +0 -0
- class_data_dir/8-bf281db301980def6ed165b724f18a14f4ec5f3a.jpg +0 -0
- class_data_dir/9-87eb2bc35a447c1db7672ff03388387bfbfd4512.jpg +0 -0
- convert_diffusers_to_original_stable_diffusion.py +335 -0
- output_dir_1250/checkpoint-1000/optimizer.bin +3 -0
- output_dir_1250/checkpoint-1000/random_states_0.pkl +3 -0
- output_dir_1250/checkpoint-1000/scaler.pt +3 -0
- output_dir_1250/checkpoint-1000/unet/config.json +65 -0
- output_dir_1250/checkpoint-1000/unet/diffusion_pytorch_model.bin +3 -0
- output_dir_1250/checkpoint-500/optimizer.bin +3 -0
- output_dir_1250/checkpoint-500/random_states_0.pkl +3 -0
- output_dir_1250/checkpoint-500/scaler.pt +3 -0
- output_dir_1250/checkpoint-500/unet/config.json +65 -0
- output_dir_1250/checkpoint-500/unet/diffusion_pytorch_model.bin +3 -0
- output_dir_1250/feature_extractor/preprocessor_config.json +28 -0
- output_dir_1250/logs/dreambooth/1690398859.3297706/events.out.tfevents.1690398859.ed33e5c0f894.22944.1 +3 -0
- output_dir_1250/logs/dreambooth/1690398859.332669/hparams.yml +58 -0
- output_dir_1250/logs/dreambooth/1690399021.825432/events.out.tfevents.1690399021.ed33e5c0f894.23690.1 +3 -0
- output_dir_1250/logs/dreambooth/1690399021.8275466/hparams.yml +58 -0
- output_dir_1250/logs/dreambooth/1690399656.5005732/events.out.tfevents.1690399656.ed33e5c0f894.26425.1 +3 -0
- output_dir_1250/logs/dreambooth/1690399656.5028813/hparams.yml +58 -0
- output_dir_1250/logs/dreambooth/events.out.tfevents.1690398859.ed33e5c0f894.22944.0 +3 -0
- output_dir_1250/logs/dreambooth/events.out.tfevents.1690399021.ed33e5c0f894.23690.0 +3 -0
- output_dir_1250/logs/dreambooth/events.out.tfevents.1690399656.ed33e5c0f894.26425.0 +3 -0
- output_dir_1250/model_index.json +34 -0
- output_dir_1250/safety_checker/config.json +168 -0
- output_dir_1250/safety_checker/pytorch_model.bin +3 -0
- output_dir_1250/scheduler/scheduler_config.json +20 -0
- output_dir_1250/text_encoder/config.json +25 -0
- output_dir_1250/text_encoder/pytorch_model.bin +3 -0
- output_dir_1250/tokenizer/merges.txt +0 -0
- output_dir_1250/tokenizer/special_tokens_map.json +24 -0
- output_dir_1250/tokenizer/tokenizer_config.json +35 -0
- output_dir_1250/tokenizer/vocab.json +0 -0
- output_dir_1250/unet/config.json +65 -0
- output_dir_1250/unet/diffusion_pytorch_model.bin +3 -0
- output_dir_1250/vae/config.json +32 -0
- output_dir_1250/vae/diffusion_pytorch_model.bin +3 -0
- output_dir_650/checkpoint-500/optimizer.bin +3 -0
- output_dir_650/checkpoint-500/random_states_0.pkl +3 -0
- output_dir_650/checkpoint-500/scaler.pt +3 -0
class_data_dir/0-dc6ed8b8fca29b437c39135e9491d373694a8d72.jpg
ADDED
class_data_dir/1-c336a7b439e3f39b86dc9ab09cd5d1e5e9dc86f3.jpg
ADDED
class_data_dir/10-cd4988749222a52bc6d879c6962a10018b6f3080.jpg
ADDED
class_data_dir/11-54683def17aac089d04586e0e86ddcd6574ca677.jpg
ADDED
class_data_dir/2-8ebe69ef4cfc0490a9a2eb1f373787b8df335030.jpg
ADDED
class_data_dir/3-202ae73c76af1316556bd594695e3c5669f1f673.jpg
ADDED
class_data_dir/4-0045be9ab9688f91ca2e9cd1687470f1fdc9bfba.jpg
ADDED
class_data_dir/5-db52f4c1f0524f0cbe6fad4c622e7e691c4703cb.jpg
ADDED
class_data_dir/6-719648ef08f348a92fa718f169e7c07cee020967.jpg
ADDED
class_data_dir/7-f5e60769a5ab267a0e176dd0469eac56db3d01fb.jpg
ADDED
class_data_dir/8-bf281db301980def6ed165b724f18a14f4ec5f3a.jpg
ADDED
class_data_dir/9-87eb2bc35a447c1db7672ff03388387bfbfd4512.jpg
ADDED
convert_diffusers_to_original_stable_diffusion.py
ADDED
@@ -0,0 +1,335 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#from https://raw.githubusercontent.com/huggingface/diffusers/v0.18.2/scripts/convert_diffusers_to_original_stable_diffusion.py
|
2 |
+
|
3 |
+
# Script for converting a HF Diffusers saved pipeline to a Stable Diffusion checkpoint.
|
4 |
+
# *Only* converts the UNet, VAE, and Text Encoder.
|
5 |
+
# Does not convert optimizer state or any other thing.
|
6 |
+
|
7 |
+
import argparse
|
8 |
+
import os.path as osp
|
9 |
+
import re
|
10 |
+
|
11 |
+
import torch
|
12 |
+
from safetensors.torch import load_file, save_file
|
13 |
+
|
14 |
+
|
15 |
+
# =================#
|
16 |
+
# UNet Conversion #
|
17 |
+
# =================#
|
18 |
+
|
19 |
+
unet_conversion_map = [
|
20 |
+
# (stable-diffusion, HF Diffusers)
|
21 |
+
("time_embed.0.weight", "time_embedding.linear_1.weight"),
|
22 |
+
("time_embed.0.bias", "time_embedding.linear_1.bias"),
|
23 |
+
("time_embed.2.weight", "time_embedding.linear_2.weight"),
|
24 |
+
("time_embed.2.bias", "time_embedding.linear_2.bias"),
|
25 |
+
("input_blocks.0.0.weight", "conv_in.weight"),
|
26 |
+
("input_blocks.0.0.bias", "conv_in.bias"),
|
27 |
+
("out.0.weight", "conv_norm_out.weight"),
|
28 |
+
("out.0.bias", "conv_norm_out.bias"),
|
29 |
+
("out.2.weight", "conv_out.weight"),
|
30 |
+
("out.2.bias", "conv_out.bias"),
|
31 |
+
]
|
32 |
+
|
33 |
+
unet_conversion_map_resnet = [
|
34 |
+
# (stable-diffusion, HF Diffusers)
|
35 |
+
("in_layers.0", "norm1"),
|
36 |
+
("in_layers.2", "conv1"),
|
37 |
+
("out_layers.0", "norm2"),
|
38 |
+
("out_layers.3", "conv2"),
|
39 |
+
("emb_layers.1", "time_emb_proj"),
|
40 |
+
("skip_connection", "conv_shortcut"),
|
41 |
+
]
|
42 |
+
|
43 |
+
unet_conversion_map_layer = []
|
44 |
+
# hardcoded number of downblocks and resnets/attentions...
|
45 |
+
# would need smarter logic for other networks.
|
46 |
+
for i in range(4):
|
47 |
+
# loop over downblocks/upblocks
|
48 |
+
|
49 |
+
for j in range(2):
|
50 |
+
# loop over resnets/attentions for downblocks
|
51 |
+
hf_down_res_prefix = f"down_blocks.{i}.resnets.{j}."
|
52 |
+
sd_down_res_prefix = f"input_blocks.{3*i + j + 1}.0."
|
53 |
+
unet_conversion_map_layer.append((sd_down_res_prefix, hf_down_res_prefix))
|
54 |
+
|
55 |
+
if i < 3:
|
56 |
+
# no attention layers in down_blocks.3
|
57 |
+
hf_down_atn_prefix = f"down_blocks.{i}.attentions.{j}."
|
58 |
+
sd_down_atn_prefix = f"input_blocks.{3*i + j + 1}.1."
|
59 |
+
unet_conversion_map_layer.append((sd_down_atn_prefix, hf_down_atn_prefix))
|
60 |
+
|
61 |
+
for j in range(3):
|
62 |
+
# loop over resnets/attentions for upblocks
|
63 |
+
hf_up_res_prefix = f"up_blocks.{i}.resnets.{j}."
|
64 |
+
sd_up_res_prefix = f"output_blocks.{3*i + j}.0."
|
65 |
+
unet_conversion_map_layer.append((sd_up_res_prefix, hf_up_res_prefix))
|
66 |
+
|
67 |
+
if i > 0:
|
68 |
+
# no attention layers in up_blocks.0
|
69 |
+
hf_up_atn_prefix = f"up_blocks.{i}.attentions.{j}."
|
70 |
+
sd_up_atn_prefix = f"output_blocks.{3*i + j}.1."
|
71 |
+
unet_conversion_map_layer.append((sd_up_atn_prefix, hf_up_atn_prefix))
|
72 |
+
|
73 |
+
if i < 3:
|
74 |
+
# no downsample in down_blocks.3
|
75 |
+
hf_downsample_prefix = f"down_blocks.{i}.downsamplers.0.conv."
|
76 |
+
sd_downsample_prefix = f"input_blocks.{3*(i+1)}.0.op."
|
77 |
+
unet_conversion_map_layer.append((sd_downsample_prefix, hf_downsample_prefix))
|
78 |
+
|
79 |
+
# no upsample in up_blocks.3
|
80 |
+
hf_upsample_prefix = f"up_blocks.{i}.upsamplers.0."
|
81 |
+
sd_upsample_prefix = f"output_blocks.{3*i + 2}.{1 if i == 0 else 2}."
|
82 |
+
unet_conversion_map_layer.append((sd_upsample_prefix, hf_upsample_prefix))
|
83 |
+
|
84 |
+
hf_mid_atn_prefix = "mid_block.attentions.0."
|
85 |
+
sd_mid_atn_prefix = "middle_block.1."
|
86 |
+
unet_conversion_map_layer.append((sd_mid_atn_prefix, hf_mid_atn_prefix))
|
87 |
+
|
88 |
+
for j in range(2):
|
89 |
+
hf_mid_res_prefix = f"mid_block.resnets.{j}."
|
90 |
+
sd_mid_res_prefix = f"middle_block.{2*j}."
|
91 |
+
unet_conversion_map_layer.append((sd_mid_res_prefix, hf_mid_res_prefix))
|
92 |
+
|
93 |
+
|
94 |
+
def convert_unet_state_dict(unet_state_dict):
|
95 |
+
# buyer beware: this is a *brittle* function,
|
96 |
+
# and correct output requires that all of these pieces interact in
|
97 |
+
# the exact order in which I have arranged them.
|
98 |
+
mapping = {k: k for k in unet_state_dict.keys()}
|
99 |
+
for sd_name, hf_name in unet_conversion_map:
|
100 |
+
mapping[hf_name] = sd_name
|
101 |
+
for k, v in mapping.items():
|
102 |
+
if "resnets" in k:
|
103 |
+
for sd_part, hf_part in unet_conversion_map_resnet:
|
104 |
+
v = v.replace(hf_part, sd_part)
|
105 |
+
mapping[k] = v
|
106 |
+
for k, v in mapping.items():
|
107 |
+
for sd_part, hf_part in unet_conversion_map_layer:
|
108 |
+
v = v.replace(hf_part, sd_part)
|
109 |
+
mapping[k] = v
|
110 |
+
new_state_dict = {v: unet_state_dict[k] for k, v in mapping.items()}
|
111 |
+
return new_state_dict
|
112 |
+
|
113 |
+
|
114 |
+
# ================#
|
115 |
+
# VAE Conversion #
|
116 |
+
# ================#
|
117 |
+
|
118 |
+
vae_conversion_map = [
|
119 |
+
# (stable-diffusion, HF Diffusers)
|
120 |
+
("nin_shortcut", "conv_shortcut"),
|
121 |
+
("norm_out", "conv_norm_out"),
|
122 |
+
("mid.attn_1.", "mid_block.attentions.0."),
|
123 |
+
]
|
124 |
+
|
125 |
+
for i in range(4):
|
126 |
+
# down_blocks have two resnets
|
127 |
+
for j in range(2):
|
128 |
+
hf_down_prefix = f"encoder.down_blocks.{i}.resnets.{j}."
|
129 |
+
sd_down_prefix = f"encoder.down.{i}.block.{j}."
|
130 |
+
vae_conversion_map.append((sd_down_prefix, hf_down_prefix))
|
131 |
+
|
132 |
+
if i < 3:
|
133 |
+
hf_downsample_prefix = f"down_blocks.{i}.downsamplers.0."
|
134 |
+
sd_downsample_prefix = f"down.{i}.downsample."
|
135 |
+
vae_conversion_map.append((sd_downsample_prefix, hf_downsample_prefix))
|
136 |
+
|
137 |
+
hf_upsample_prefix = f"up_blocks.{i}.upsamplers.0."
|
138 |
+
sd_upsample_prefix = f"up.{3-i}.upsample."
|
139 |
+
vae_conversion_map.append((sd_upsample_prefix, hf_upsample_prefix))
|
140 |
+
|
141 |
+
# up_blocks have three resnets
|
142 |
+
# also, up blocks in hf are numbered in reverse from sd
|
143 |
+
for j in range(3):
|
144 |
+
hf_up_prefix = f"decoder.up_blocks.{i}.resnets.{j}."
|
145 |
+
sd_up_prefix = f"decoder.up.{3-i}.block.{j}."
|
146 |
+
vae_conversion_map.append((sd_up_prefix, hf_up_prefix))
|
147 |
+
|
148 |
+
# this part accounts for mid blocks in both the encoder and the decoder
|
149 |
+
for i in range(2):
|
150 |
+
hf_mid_res_prefix = f"mid_block.resnets.{i}."
|
151 |
+
sd_mid_res_prefix = f"mid.block_{i+1}."
|
152 |
+
vae_conversion_map.append((sd_mid_res_prefix, hf_mid_res_prefix))
|
153 |
+
|
154 |
+
|
155 |
+
vae_conversion_map_attn = [
|
156 |
+
# (stable-diffusion, HF Diffusers)
|
157 |
+
("norm.", "group_norm."),
|
158 |
+
("q.", "query."),
|
159 |
+
("k.", "key."),
|
160 |
+
("v.", "value."),
|
161 |
+
("proj_out.", "proj_attn."),
|
162 |
+
]
|
163 |
+
|
164 |
+
|
165 |
+
def reshape_weight_for_sd(w):
|
166 |
+
# convert HF linear weights to SD conv2d weights
|
167 |
+
return w.reshape(*w.shape, 1, 1)
|
168 |
+
|
169 |
+
|
170 |
+
def convert_vae_state_dict(vae_state_dict):
|
171 |
+
mapping = {k: k for k in vae_state_dict.keys()}
|
172 |
+
for k, v in mapping.items():
|
173 |
+
for sd_part, hf_part in vae_conversion_map:
|
174 |
+
v = v.replace(hf_part, sd_part)
|
175 |
+
mapping[k] = v
|
176 |
+
for k, v in mapping.items():
|
177 |
+
if "attentions" in k:
|
178 |
+
for sd_part, hf_part in vae_conversion_map_attn:
|
179 |
+
v = v.replace(hf_part, sd_part)
|
180 |
+
mapping[k] = v
|
181 |
+
new_state_dict = {v: vae_state_dict[k] for k, v in mapping.items()}
|
182 |
+
weights_to_convert = ["q", "k", "v", "proj_out"]
|
183 |
+
for k, v in new_state_dict.items():
|
184 |
+
for weight_name in weights_to_convert:
|
185 |
+
if f"mid.attn_1.{weight_name}.weight" in k:
|
186 |
+
print(f"Reshaping {k} for SD format")
|
187 |
+
new_state_dict[k] = reshape_weight_for_sd(v)
|
188 |
+
return new_state_dict
|
189 |
+
|
190 |
+
|
191 |
+
# =========================#
|
192 |
+
# Text Encoder Conversion #
|
193 |
+
# =========================#
|
194 |
+
|
195 |
+
|
196 |
+
textenc_conversion_lst = [
|
197 |
+
# (stable-diffusion, HF Diffusers)
|
198 |
+
("resblocks.", "text_model.encoder.layers."),
|
199 |
+
("ln_1", "layer_norm1"),
|
200 |
+
("ln_2", "layer_norm2"),
|
201 |
+
(".c_fc.", ".fc1."),
|
202 |
+
(".c_proj.", ".fc2."),
|
203 |
+
(".attn", ".self_attn"),
|
204 |
+
("ln_final.", "transformer.text_model.final_layer_norm."),
|
205 |
+
("token_embedding.weight", "transformer.text_model.embeddings.token_embedding.weight"),
|
206 |
+
("positional_embedding", "transformer.text_model.embeddings.position_embedding.weight"),
|
207 |
+
]
|
208 |
+
protected = {re.escape(x[1]): x[0] for x in textenc_conversion_lst}
|
209 |
+
textenc_pattern = re.compile("|".join(protected.keys()))
|
210 |
+
|
211 |
+
# Ordering is from https://github.com/pytorch/pytorch/blob/master/test/cpp/api/modules.cpp
|
212 |
+
code2idx = {"q": 0, "k": 1, "v": 2}
|
213 |
+
|
214 |
+
|
215 |
+
def convert_text_enc_state_dict_v20(text_enc_dict):
|
216 |
+
new_state_dict = {}
|
217 |
+
capture_qkv_weight = {}
|
218 |
+
capture_qkv_bias = {}
|
219 |
+
for k, v in text_enc_dict.items():
|
220 |
+
if (
|
221 |
+
k.endswith(".self_attn.q_proj.weight")
|
222 |
+
or k.endswith(".self_attn.k_proj.weight")
|
223 |
+
or k.endswith(".self_attn.v_proj.weight")
|
224 |
+
):
|
225 |
+
k_pre = k[: -len(".q_proj.weight")]
|
226 |
+
k_code = k[-len("q_proj.weight")]
|
227 |
+
if k_pre not in capture_qkv_weight:
|
228 |
+
capture_qkv_weight[k_pre] = [None, None, None]
|
229 |
+
capture_qkv_weight[k_pre][code2idx[k_code]] = v
|
230 |
+
continue
|
231 |
+
|
232 |
+
if (
|
233 |
+
k.endswith(".self_attn.q_proj.bias")
|
234 |
+
or k.endswith(".self_attn.k_proj.bias")
|
235 |
+
or k.endswith(".self_attn.v_proj.bias")
|
236 |
+
):
|
237 |
+
k_pre = k[: -len(".q_proj.bias")]
|
238 |
+
k_code = k[-len("q_proj.bias")]
|
239 |
+
if k_pre not in capture_qkv_bias:
|
240 |
+
capture_qkv_bias[k_pre] = [None, None, None]
|
241 |
+
capture_qkv_bias[k_pre][code2idx[k_code]] = v
|
242 |
+
continue
|
243 |
+
|
244 |
+
relabelled_key = textenc_pattern.sub(lambda m: protected[re.escape(m.group(0))], k)
|
245 |
+
new_state_dict[relabelled_key] = v
|
246 |
+
|
247 |
+
for k_pre, tensors in capture_qkv_weight.items():
|
248 |
+
if None in tensors:
|
249 |
+
raise Exception("CORRUPTED MODEL: one of the q-k-v values for the text encoder was missing")
|
250 |
+
relabelled_key = textenc_pattern.sub(lambda m: protected[re.escape(m.group(0))], k_pre)
|
251 |
+
new_state_dict[relabelled_key + ".in_proj_weight"] = torch.cat(tensors)
|
252 |
+
|
253 |
+
for k_pre, tensors in capture_qkv_bias.items():
|
254 |
+
if None in tensors:
|
255 |
+
raise Exception("CORRUPTED MODEL: one of the q-k-v values for the text encoder was missing")
|
256 |
+
relabelled_key = textenc_pattern.sub(lambda m: protected[re.escape(m.group(0))], k_pre)
|
257 |
+
new_state_dict[relabelled_key + ".in_proj_bias"] = torch.cat(tensors)
|
258 |
+
|
259 |
+
return new_state_dict
|
260 |
+
|
261 |
+
|
262 |
+
def convert_text_enc_state_dict(text_enc_dict):
|
263 |
+
return text_enc_dict
|
264 |
+
|
265 |
+
|
266 |
+
if __name__ == "__main__":
|
267 |
+
parser = argparse.ArgumentParser()
|
268 |
+
|
269 |
+
parser.add_argument("--model_path", default=None, type=str, required=True, help="Path to the model to convert.")
|
270 |
+
parser.add_argument("--checkpoint_path", default=None, type=str, required=True, help="Path to the output model.")
|
271 |
+
parser.add_argument("--half", action="store_true", help="Save weights in half precision.")
|
272 |
+
parser.add_argument(
|
273 |
+
"--use_safetensors", action="store_true", help="Save weights use safetensors, default is ckpt."
|
274 |
+
)
|
275 |
+
|
276 |
+
args = parser.parse_args()
|
277 |
+
|
278 |
+
assert args.model_path is not None, "Must provide a model path!"
|
279 |
+
|
280 |
+
assert args.checkpoint_path is not None, "Must provide a checkpoint path!"
|
281 |
+
|
282 |
+
# Path for safetensors
|
283 |
+
unet_path = osp.join(args.model_path, "unet", "diffusion_pytorch_model.safetensors")
|
284 |
+
vae_path = osp.join(args.model_path, "vae", "diffusion_pytorch_model.safetensors")
|
285 |
+
text_enc_path = osp.join(args.model_path, "text_encoder", "model.safetensors")
|
286 |
+
|
287 |
+
# Load models from safetensors if it exists, if it doesn't pytorch
|
288 |
+
if osp.exists(unet_path):
|
289 |
+
unet_state_dict = load_file(unet_path, device="cpu")
|
290 |
+
else:
|
291 |
+
unet_path = osp.join(args.model_path, "unet", "diffusion_pytorch_model.bin")
|
292 |
+
unet_state_dict = torch.load(unet_path, map_location="cpu")
|
293 |
+
|
294 |
+
if osp.exists(vae_path):
|
295 |
+
vae_state_dict = load_file(vae_path, device="cpu")
|
296 |
+
else:
|
297 |
+
vae_path = osp.join(args.model_path, "vae", "diffusion_pytorch_model.bin")
|
298 |
+
vae_state_dict = torch.load(vae_path, map_location="cpu")
|
299 |
+
|
300 |
+
if osp.exists(text_enc_path):
|
301 |
+
text_enc_dict = load_file(text_enc_path, device="cpu")
|
302 |
+
else:
|
303 |
+
text_enc_path = osp.join(args.model_path, "text_encoder", "pytorch_model.bin")
|
304 |
+
text_enc_dict = torch.load(text_enc_path, map_location="cpu")
|
305 |
+
|
306 |
+
# Convert the UNet model
|
307 |
+
unet_state_dict = convert_unet_state_dict(unet_state_dict)
|
308 |
+
unet_state_dict = {"model.diffusion_model." + k: v for k, v in unet_state_dict.items()}
|
309 |
+
|
310 |
+
# Convert the VAE model
|
311 |
+
vae_state_dict = convert_vae_state_dict(vae_state_dict)
|
312 |
+
vae_state_dict = {"first_stage_model." + k: v for k, v in vae_state_dict.items()}
|
313 |
+
|
314 |
+
# Easiest way to identify v2.0 model seems to be that the text encoder (OpenCLIP) is deeper
|
315 |
+
is_v20_model = "text_model.encoder.layers.22.layer_norm2.bias" in text_enc_dict
|
316 |
+
|
317 |
+
if is_v20_model:
|
318 |
+
# Need to add the tag 'transformer' in advance so we can knock it out from the final layer-norm
|
319 |
+
text_enc_dict = {"transformer." + k: v for k, v in text_enc_dict.items()}
|
320 |
+
text_enc_dict = convert_text_enc_state_dict_v20(text_enc_dict)
|
321 |
+
text_enc_dict = {"cond_stage_model.model." + k: v for k, v in text_enc_dict.items()}
|
322 |
+
else:
|
323 |
+
text_enc_dict = convert_text_enc_state_dict(text_enc_dict)
|
324 |
+
text_enc_dict = {"cond_stage_model.transformer." + k: v for k, v in text_enc_dict.items()}
|
325 |
+
|
326 |
+
# Put together new checkpoint
|
327 |
+
state_dict = {**unet_state_dict, **vae_state_dict, **text_enc_dict}
|
328 |
+
if args.half:
|
329 |
+
state_dict = {k: v.half() for k, v in state_dict.items()}
|
330 |
+
|
331 |
+
if args.use_safetensors:
|
332 |
+
save_file(state_dict, args.checkpoint_path)
|
333 |
+
else:
|
334 |
+
state_dict = {"state_dict": state_dict}
|
335 |
+
torch.save(state_dict, args.checkpoint_path)
|
output_dir_1250/checkpoint-1000/optimizer.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:e32a65c1b32fbb8da64a41f284d72e0fbdc093597eedaf767b2418f4eea5aecd
|
3 |
+
size 1725109957
|
output_dir_1250/checkpoint-1000/random_states_0.pkl
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:7d2517910b6772a4ccc20a472964438ee0a6e06bdde9c2ce6920c8fc9b9c2a8b
|
3 |
+
size 14663
|
output_dir_1250/checkpoint-1000/scaler.pt
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:68cff80b680ddf6e7abbef98b5f336b97f9b5963e2209307f639383870e8cc71
|
3 |
+
size 557
|
output_dir_1250/checkpoint-1000/unet/config.json
ADDED
@@ -0,0 +1,65 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_class_name": "UNet2DConditionModel",
|
3 |
+
"_diffusers_version": "0.19.0.dev0",
|
4 |
+
"_name_or_path": "/content/model",
|
5 |
+
"act_fn": "silu",
|
6 |
+
"addition_embed_type": null,
|
7 |
+
"addition_embed_type_num_heads": 64,
|
8 |
+
"addition_time_embed_dim": null,
|
9 |
+
"attention_head_dim": 8,
|
10 |
+
"block_out_channels": [
|
11 |
+
320,
|
12 |
+
640,
|
13 |
+
1280,
|
14 |
+
1280
|
15 |
+
],
|
16 |
+
"center_input_sample": false,
|
17 |
+
"class_embed_type": null,
|
18 |
+
"class_embeddings_concat": false,
|
19 |
+
"conv_in_kernel": 3,
|
20 |
+
"conv_out_kernel": 3,
|
21 |
+
"cross_attention_dim": 768,
|
22 |
+
"cross_attention_norm": null,
|
23 |
+
"down_block_types": [
|
24 |
+
"CrossAttnDownBlock2D",
|
25 |
+
"CrossAttnDownBlock2D",
|
26 |
+
"CrossAttnDownBlock2D",
|
27 |
+
"DownBlock2D"
|
28 |
+
],
|
29 |
+
"downsample_padding": 1,
|
30 |
+
"dual_cross_attention": false,
|
31 |
+
"encoder_hid_dim": null,
|
32 |
+
"encoder_hid_dim_type": null,
|
33 |
+
"flip_sin_to_cos": true,
|
34 |
+
"freq_shift": 0,
|
35 |
+
"in_channels": 4,
|
36 |
+
"layers_per_block": 2,
|
37 |
+
"mid_block_only_cross_attention": null,
|
38 |
+
"mid_block_scale_factor": 1,
|
39 |
+
"mid_block_type": "UNetMidBlock2DCrossAttn",
|
40 |
+
"norm_eps": 1e-05,
|
41 |
+
"norm_num_groups": 32,
|
42 |
+
"num_attention_heads": null,
|
43 |
+
"num_class_embeds": null,
|
44 |
+
"only_cross_attention": false,
|
45 |
+
"out_channels": 4,
|
46 |
+
"projection_class_embeddings_input_dim": null,
|
47 |
+
"resnet_out_scale_factor": 1.0,
|
48 |
+
"resnet_skip_time_act": false,
|
49 |
+
"resnet_time_scale_shift": "default",
|
50 |
+
"sample_size": 64,
|
51 |
+
"time_cond_proj_dim": null,
|
52 |
+
"time_embedding_act_fn": null,
|
53 |
+
"time_embedding_dim": null,
|
54 |
+
"time_embedding_type": "positional",
|
55 |
+
"timestep_post_act": null,
|
56 |
+
"transformer_layers_per_block": 1,
|
57 |
+
"up_block_types": [
|
58 |
+
"UpBlock2D",
|
59 |
+
"CrossAttnUpBlock2D",
|
60 |
+
"CrossAttnUpBlock2D",
|
61 |
+
"CrossAttnUpBlock2D"
|
62 |
+
],
|
63 |
+
"upcast_attention": false,
|
64 |
+
"use_linear_projection": false
|
65 |
+
}
|
output_dir_1250/checkpoint-1000/unet/diffusion_pytorch_model.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:943d95ecaacaa571d7e559062e4fe98d3e7c407866bdd3470f48959eeff0c1e6
|
3 |
+
size 3438375973
|
output_dir_1250/checkpoint-500/optimizer.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:dc79115794a577713200747212309e7f810079c912e79845e64d3dbd3b98e4ed
|
3 |
+
size 1725109957
|
output_dir_1250/checkpoint-500/random_states_0.pkl
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:925ddf27b7ed399efa6b3e05cb6d28b05f066617d0d32d783eb1116d0068df55
|
3 |
+
size 14663
|
output_dir_1250/checkpoint-500/scaler.pt
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:a3f196a54202bb4ba1220e8c59f42f9cda0702d68ea83147d814c2fb2f36b8f2
|
3 |
+
size 557
|
output_dir_1250/checkpoint-500/unet/config.json
ADDED
@@ -0,0 +1,65 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_class_name": "UNet2DConditionModel",
|
3 |
+
"_diffusers_version": "0.19.0.dev0",
|
4 |
+
"_name_or_path": "/content/model",
|
5 |
+
"act_fn": "silu",
|
6 |
+
"addition_embed_type": null,
|
7 |
+
"addition_embed_type_num_heads": 64,
|
8 |
+
"addition_time_embed_dim": null,
|
9 |
+
"attention_head_dim": 8,
|
10 |
+
"block_out_channels": [
|
11 |
+
320,
|
12 |
+
640,
|
13 |
+
1280,
|
14 |
+
1280
|
15 |
+
],
|
16 |
+
"center_input_sample": false,
|
17 |
+
"class_embed_type": null,
|
18 |
+
"class_embeddings_concat": false,
|
19 |
+
"conv_in_kernel": 3,
|
20 |
+
"conv_out_kernel": 3,
|
21 |
+
"cross_attention_dim": 768,
|
22 |
+
"cross_attention_norm": null,
|
23 |
+
"down_block_types": [
|
24 |
+
"CrossAttnDownBlock2D",
|
25 |
+
"CrossAttnDownBlock2D",
|
26 |
+
"CrossAttnDownBlock2D",
|
27 |
+
"DownBlock2D"
|
28 |
+
],
|
29 |
+
"downsample_padding": 1,
|
30 |
+
"dual_cross_attention": false,
|
31 |
+
"encoder_hid_dim": null,
|
32 |
+
"encoder_hid_dim_type": null,
|
33 |
+
"flip_sin_to_cos": true,
|
34 |
+
"freq_shift": 0,
|
35 |
+
"in_channels": 4,
|
36 |
+
"layers_per_block": 2,
|
37 |
+
"mid_block_only_cross_attention": null,
|
38 |
+
"mid_block_scale_factor": 1,
|
39 |
+
"mid_block_type": "UNetMidBlock2DCrossAttn",
|
40 |
+
"norm_eps": 1e-05,
|
41 |
+
"norm_num_groups": 32,
|
42 |
+
"num_attention_heads": null,
|
43 |
+
"num_class_embeds": null,
|
44 |
+
"only_cross_attention": false,
|
45 |
+
"out_channels": 4,
|
46 |
+
"projection_class_embeddings_input_dim": null,
|
47 |
+
"resnet_out_scale_factor": 1.0,
|
48 |
+
"resnet_skip_time_act": false,
|
49 |
+
"resnet_time_scale_shift": "default",
|
50 |
+
"sample_size": 64,
|
51 |
+
"time_cond_proj_dim": null,
|
52 |
+
"time_embedding_act_fn": null,
|
53 |
+
"time_embedding_dim": null,
|
54 |
+
"time_embedding_type": "positional",
|
55 |
+
"timestep_post_act": null,
|
56 |
+
"transformer_layers_per_block": 1,
|
57 |
+
"up_block_types": [
|
58 |
+
"UpBlock2D",
|
59 |
+
"CrossAttnUpBlock2D",
|
60 |
+
"CrossAttnUpBlock2D",
|
61 |
+
"CrossAttnUpBlock2D"
|
62 |
+
],
|
63 |
+
"upcast_attention": false,
|
64 |
+
"use_linear_projection": false
|
65 |
+
}
|
output_dir_1250/checkpoint-500/unet/diffusion_pytorch_model.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:83e1ece9e3744a18684e133fc9b362e513b70fa4f08bcad5e670f4ff4c36c690
|
3 |
+
size 3438375973
|
output_dir_1250/feature_extractor/preprocessor_config.json
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"crop_size": {
|
3 |
+
"height": 224,
|
4 |
+
"width": 224
|
5 |
+
},
|
6 |
+
"do_center_crop": true,
|
7 |
+
"do_convert_rgb": true,
|
8 |
+
"do_normalize": true,
|
9 |
+
"do_rescale": true,
|
10 |
+
"do_resize": true,
|
11 |
+
"feature_extractor_type": "CLIPFeatureExtractor",
|
12 |
+
"image_mean": [
|
13 |
+
0.48145466,
|
14 |
+
0.4578275,
|
15 |
+
0.40821073
|
16 |
+
],
|
17 |
+
"image_processor_type": "CLIPFeatureExtractor",
|
18 |
+
"image_std": [
|
19 |
+
0.26862954,
|
20 |
+
0.26130258,
|
21 |
+
0.27577711
|
22 |
+
],
|
23 |
+
"resample": 3,
|
24 |
+
"rescale_factor": 0.00392156862745098,
|
25 |
+
"size": {
|
26 |
+
"shortest_edge": 224
|
27 |
+
}
|
28 |
+
}
|
output_dir_1250/logs/dreambooth/1690398859.3297706/events.out.tfevents.1690398859.ed33e5c0f894.22944.1
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:5082e60d089db750455c511fd91e823665bd691e7dead6d3fcda5215fa9a19d1
|
3 |
+
size 2869
|
output_dir_1250/logs/dreambooth/1690398859.332669/hparams.yml
ADDED
@@ -0,0 +1,58 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
adam_beta1: 0.9
|
2 |
+
adam_beta2: 0.999
|
3 |
+
adam_epsilon: 1.0e-08
|
4 |
+
adam_weight_decay: 0.01
|
5 |
+
allow_tf32: false
|
6 |
+
center_crop: true
|
7 |
+
checkpointing_steps: 500
|
8 |
+
checkpoints_total_limit: null
|
9 |
+
class_data_dir: /content/trainer/diffusers/dreambooth/class_data_dir
|
10 |
+
class_labels_conditioning: null
|
11 |
+
class_prompt: person
|
12 |
+
dataloader_num_workers: 0
|
13 |
+
enable_xformers_memory_efficient_attention: true
|
14 |
+
gradient_accumulation_steps: 1
|
15 |
+
gradient_checkpointing: true
|
16 |
+
hub_model_id: null
|
17 |
+
hub_token: null
|
18 |
+
instance_data_dir: /content/drive/MyDrive/alinity
|
19 |
+
instance_prompt: alinity
|
20 |
+
learning_rate: 5.0e-06
|
21 |
+
local_rank: -1
|
22 |
+
logging_dir: logs
|
23 |
+
lr_num_cycles: 1
|
24 |
+
lr_power: 1.0
|
25 |
+
lr_scheduler: constant
|
26 |
+
lr_warmup_steps: 500
|
27 |
+
max_grad_norm: 1.0
|
28 |
+
max_train_steps: 1250
|
29 |
+
mixed_precision: fp16
|
30 |
+
num_class_images: 12
|
31 |
+
num_train_epochs: 10
|
32 |
+
num_validation_images: 4
|
33 |
+
offset_noise: false
|
34 |
+
output_dir: /content/trainer/diffusers/dreambooth/output_dir
|
35 |
+
pre_compute_text_embeddings: false
|
36 |
+
pretrained_model_name_or_path: /content/model
|
37 |
+
prior_generation_precision: null
|
38 |
+
prior_loss_weight: 1.0
|
39 |
+
push_to_hub: false
|
40 |
+
report_to: tensorboard
|
41 |
+
resolution: 512
|
42 |
+
resume_from_checkpoint: null
|
43 |
+
revision: null
|
44 |
+
sample_batch_size: 2
|
45 |
+
scale_lr: false
|
46 |
+
seed: 69
|
47 |
+
set_grads_to_none: false
|
48 |
+
skip_save_text_encoder: false
|
49 |
+
text_encoder_use_attention_mask: false
|
50 |
+
tokenizer_max_length: null
|
51 |
+
tokenizer_name: null
|
52 |
+
train_batch_size: 1
|
53 |
+
train_text_encoder: false
|
54 |
+
use_8bit_adam: true
|
55 |
+
validation_images: null
|
56 |
+
validation_prompt: null
|
57 |
+
validation_steps: 100
|
58 |
+
with_prior_preservation: true
|
output_dir_1250/logs/dreambooth/1690399021.825432/events.out.tfevents.1690399021.ed33e5c0f894.23690.1
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:c82b00310e7a735fcbc4a8b2fa6295a6ab2c715716bc65c5f05ae70378302ab5
|
3 |
+
size 2869
|
output_dir_1250/logs/dreambooth/1690399021.8275466/hparams.yml
ADDED
@@ -0,0 +1,58 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
adam_beta1: 0.9
|
2 |
+
adam_beta2: 0.999
|
3 |
+
adam_epsilon: 1.0e-08
|
4 |
+
adam_weight_decay: 0.01
|
5 |
+
allow_tf32: false
|
6 |
+
center_crop: true
|
7 |
+
checkpointing_steps: 500
|
8 |
+
checkpoints_total_limit: null
|
9 |
+
class_data_dir: /content/trainer/diffusers/dreambooth/class_data_dir
|
10 |
+
class_labels_conditioning: null
|
11 |
+
class_prompt: person
|
12 |
+
dataloader_num_workers: 0
|
13 |
+
enable_xformers_memory_efficient_attention: true
|
14 |
+
gradient_accumulation_steps: 1
|
15 |
+
gradient_checkpointing: true
|
16 |
+
hub_model_id: null
|
17 |
+
hub_token: null
|
18 |
+
instance_data_dir: /content/drive/MyDrive/alinity
|
19 |
+
instance_prompt: alinity
|
20 |
+
learning_rate: 5.0e-06
|
21 |
+
local_rank: -1
|
22 |
+
logging_dir: logs
|
23 |
+
lr_num_cycles: 1
|
24 |
+
lr_power: 1.0
|
25 |
+
lr_scheduler: constant
|
26 |
+
lr_warmup_steps: 500
|
27 |
+
max_grad_norm: 1.0
|
28 |
+
max_train_steps: 1250
|
29 |
+
mixed_precision: fp16
|
30 |
+
num_class_images: 12
|
31 |
+
num_train_epochs: 10
|
32 |
+
num_validation_images: 4
|
33 |
+
offset_noise: false
|
34 |
+
output_dir: /content/trainer/diffusers/dreambooth/output_dir
|
35 |
+
pre_compute_text_embeddings: false
|
36 |
+
pretrained_model_name_or_path: /content/model
|
37 |
+
prior_generation_precision: null
|
38 |
+
prior_loss_weight: 1.0
|
39 |
+
push_to_hub: false
|
40 |
+
report_to: tensorboard
|
41 |
+
resolution: 512
|
42 |
+
resume_from_checkpoint: null
|
43 |
+
revision: null
|
44 |
+
sample_batch_size: 2
|
45 |
+
scale_lr: false
|
46 |
+
seed: 69
|
47 |
+
set_grads_to_none: false
|
48 |
+
skip_save_text_encoder: false
|
49 |
+
text_encoder_use_attention_mask: false
|
50 |
+
tokenizer_max_length: null
|
51 |
+
tokenizer_name: null
|
52 |
+
train_batch_size: 1
|
53 |
+
train_text_encoder: false
|
54 |
+
use_8bit_adam: true
|
55 |
+
validation_images: null
|
56 |
+
validation_prompt: null
|
57 |
+
validation_steps: 100
|
58 |
+
with_prior_preservation: true
|
output_dir_1250/logs/dreambooth/1690399656.5005732/events.out.tfevents.1690399656.ed33e5c0f894.26425.1
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:196e9d8e22cd4dca1b9ea24f8ba45bdc55ee7ab8c7742fa82c01dcf589b4139b
|
3 |
+
size 2869
|
output_dir_1250/logs/dreambooth/1690399656.5028813/hparams.yml
ADDED
@@ -0,0 +1,58 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
adam_beta1: 0.9
|
2 |
+
adam_beta2: 0.999
|
3 |
+
adam_epsilon: 1.0e-08
|
4 |
+
adam_weight_decay: 0.01
|
5 |
+
allow_tf32: false
|
6 |
+
center_crop: true
|
7 |
+
checkpointing_steps: 500
|
8 |
+
checkpoints_total_limit: null
|
9 |
+
class_data_dir: /content/trainer/diffusers/dreambooth/class_data_dir
|
10 |
+
class_labels_conditioning: null
|
11 |
+
class_prompt: person
|
12 |
+
dataloader_num_workers: 0
|
13 |
+
enable_xformers_memory_efficient_attention: true
|
14 |
+
gradient_accumulation_steps: 1
|
15 |
+
gradient_checkpointing: true
|
16 |
+
hub_model_id: null
|
17 |
+
hub_token: null
|
18 |
+
instance_data_dir: /content/drive/MyDrive/alinity
|
19 |
+
instance_prompt: alinity
|
20 |
+
learning_rate: 5.0e-06
|
21 |
+
local_rank: -1
|
22 |
+
logging_dir: logs
|
23 |
+
lr_num_cycles: 1
|
24 |
+
lr_power: 1.0
|
25 |
+
lr_scheduler: constant
|
26 |
+
lr_warmup_steps: 500
|
27 |
+
max_grad_norm: 1.0
|
28 |
+
max_train_steps: 1250
|
29 |
+
mixed_precision: fp16
|
30 |
+
num_class_images: 12
|
31 |
+
num_train_epochs: 10
|
32 |
+
num_validation_images: 4
|
33 |
+
offset_noise: true
|
34 |
+
output_dir: /content/trainer/diffusers/dreambooth/output_dir
|
35 |
+
pre_compute_text_embeddings: false
|
36 |
+
pretrained_model_name_or_path: /content/model
|
37 |
+
prior_generation_precision: null
|
38 |
+
prior_loss_weight: 1.0
|
39 |
+
push_to_hub: false
|
40 |
+
report_to: tensorboard
|
41 |
+
resolution: 512
|
42 |
+
resume_from_checkpoint: null
|
43 |
+
revision: null
|
44 |
+
sample_batch_size: 2
|
45 |
+
scale_lr: false
|
46 |
+
seed: 69
|
47 |
+
set_grads_to_none: false
|
48 |
+
skip_save_text_encoder: false
|
49 |
+
text_encoder_use_attention_mask: false
|
50 |
+
tokenizer_max_length: null
|
51 |
+
tokenizer_name: null
|
52 |
+
train_batch_size: 1
|
53 |
+
train_text_encoder: false
|
54 |
+
use_8bit_adam: true
|
55 |
+
validation_images: null
|
56 |
+
validation_prompt: null
|
57 |
+
validation_steps: 100
|
58 |
+
with_prior_preservation: true
|
output_dir_1250/logs/dreambooth/events.out.tfevents.1690398859.ed33e5c0f894.22944.0
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:ca18895cf60deca0140250af39c75dbd1bb793ec352428734347e3ec2a2aafa9
|
3 |
+
size 40
|
output_dir_1250/logs/dreambooth/events.out.tfevents.1690399021.ed33e5c0f894.23690.0
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:67144dc92d685bbdf1338bee5c43f08e4b87aa060382e9fcaa7153e21d1bed73
|
3 |
+
size 6518
|
output_dir_1250/logs/dreambooth/events.out.tfevents.1690399656.ed33e5c0f894.26425.0
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:76e118dfdd88fb6fbd565588dfa5ded921a244285db4007881fe280ca7491c1f
|
3 |
+
size 104786
|
output_dir_1250/model_index.json
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_class_name": "StableDiffusionPipeline",
|
3 |
+
"_diffusers_version": "0.19.0.dev0",
|
4 |
+
"_name_or_path": "/content/model",
|
5 |
+
"feature_extractor": [
|
6 |
+
"transformers",
|
7 |
+
"CLIPFeatureExtractor"
|
8 |
+
],
|
9 |
+
"requires_safety_checker": true,
|
10 |
+
"safety_checker": [
|
11 |
+
"stable_diffusion",
|
12 |
+
"StableDiffusionSafetyChecker"
|
13 |
+
],
|
14 |
+
"scheduler": [
|
15 |
+
"diffusers",
|
16 |
+
"PNDMScheduler"
|
17 |
+
],
|
18 |
+
"text_encoder": [
|
19 |
+
"transformers",
|
20 |
+
"CLIPTextModel"
|
21 |
+
],
|
22 |
+
"tokenizer": [
|
23 |
+
"transformers",
|
24 |
+
"CLIPTokenizer"
|
25 |
+
],
|
26 |
+
"unet": [
|
27 |
+
"diffusers",
|
28 |
+
"UNet2DConditionModel"
|
29 |
+
],
|
30 |
+
"vae": [
|
31 |
+
"diffusers",
|
32 |
+
"AutoencoderKL"
|
33 |
+
]
|
34 |
+
}
|
output_dir_1250/safety_checker/config.json
ADDED
@@ -0,0 +1,168 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_commit_hash": null,
|
3 |
+
"_name_or_path": "/content/model/safety_checker",
|
4 |
+
"architectures": [
|
5 |
+
"StableDiffusionSafetyChecker"
|
6 |
+
],
|
7 |
+
"initializer_factor": 1.0,
|
8 |
+
"logit_scale_init_value": 2.6592,
|
9 |
+
"model_type": "clip",
|
10 |
+
"projection_dim": 768,
|
11 |
+
"text_config": {
|
12 |
+
"_name_or_path": "",
|
13 |
+
"add_cross_attention": false,
|
14 |
+
"architectures": null,
|
15 |
+
"attention_dropout": 0.0,
|
16 |
+
"bad_words_ids": null,
|
17 |
+
"begin_suppress_tokens": null,
|
18 |
+
"bos_token_id": 0,
|
19 |
+
"chunk_size_feed_forward": 0,
|
20 |
+
"cross_attention_hidden_size": null,
|
21 |
+
"decoder_start_token_id": null,
|
22 |
+
"diversity_penalty": 0.0,
|
23 |
+
"do_sample": false,
|
24 |
+
"dropout": 0.0,
|
25 |
+
"early_stopping": false,
|
26 |
+
"encoder_no_repeat_ngram_size": 0,
|
27 |
+
"eos_token_id": 2,
|
28 |
+
"exponential_decay_length_penalty": null,
|
29 |
+
"finetuning_task": null,
|
30 |
+
"forced_bos_token_id": null,
|
31 |
+
"forced_eos_token_id": null,
|
32 |
+
"hidden_act": "quick_gelu",
|
33 |
+
"hidden_size": 768,
|
34 |
+
"id2label": {
|
35 |
+
"0": "LABEL_0",
|
36 |
+
"1": "LABEL_1"
|
37 |
+
},
|
38 |
+
"initializer_factor": 1.0,
|
39 |
+
"initializer_range": 0.02,
|
40 |
+
"intermediate_size": 3072,
|
41 |
+
"is_decoder": false,
|
42 |
+
"is_encoder_decoder": false,
|
43 |
+
"label2id": {
|
44 |
+
"LABEL_0": 0,
|
45 |
+
"LABEL_1": 1
|
46 |
+
},
|
47 |
+
"layer_norm_eps": 1e-05,
|
48 |
+
"length_penalty": 1.0,
|
49 |
+
"max_length": 20,
|
50 |
+
"max_position_embeddings": 77,
|
51 |
+
"min_length": 0,
|
52 |
+
"model_type": "clip_text_model",
|
53 |
+
"no_repeat_ngram_size": 0,
|
54 |
+
"num_attention_heads": 12,
|
55 |
+
"num_beam_groups": 1,
|
56 |
+
"num_beams": 1,
|
57 |
+
"num_hidden_layers": 12,
|
58 |
+
"num_return_sequences": 1,
|
59 |
+
"output_attentions": false,
|
60 |
+
"output_hidden_states": false,
|
61 |
+
"output_scores": false,
|
62 |
+
"pad_token_id": 1,
|
63 |
+
"prefix": null,
|
64 |
+
"problem_type": null,
|
65 |
+
"projection_dim": 512,
|
66 |
+
"pruned_heads": {},
|
67 |
+
"remove_invalid_values": false,
|
68 |
+
"repetition_penalty": 1.0,
|
69 |
+
"return_dict": true,
|
70 |
+
"return_dict_in_generate": false,
|
71 |
+
"sep_token_id": null,
|
72 |
+
"suppress_tokens": null,
|
73 |
+
"task_specific_params": null,
|
74 |
+
"temperature": 1.0,
|
75 |
+
"tf_legacy_loss": false,
|
76 |
+
"tie_encoder_decoder": false,
|
77 |
+
"tie_word_embeddings": true,
|
78 |
+
"tokenizer_class": null,
|
79 |
+
"top_k": 50,
|
80 |
+
"top_p": 1.0,
|
81 |
+
"torch_dtype": null,
|
82 |
+
"torchscript": false,
|
83 |
+
"transformers_version": "4.26.0",
|
84 |
+
"typical_p": 1.0,
|
85 |
+
"use_bfloat16": false,
|
86 |
+
"vocab_size": 49408
|
87 |
+
},
|
88 |
+
"torch_dtype": "float32",
|
89 |
+
"transformers_version": null,
|
90 |
+
"vision_config": {
|
91 |
+
"_name_or_path": "",
|
92 |
+
"add_cross_attention": false,
|
93 |
+
"architectures": null,
|
94 |
+
"attention_dropout": 0.0,
|
95 |
+
"bad_words_ids": null,
|
96 |
+
"begin_suppress_tokens": null,
|
97 |
+
"bos_token_id": null,
|
98 |
+
"chunk_size_feed_forward": 0,
|
99 |
+
"cross_attention_hidden_size": null,
|
100 |
+
"decoder_start_token_id": null,
|
101 |
+
"diversity_penalty": 0.0,
|
102 |
+
"do_sample": false,
|
103 |
+
"dropout": 0.0,
|
104 |
+
"early_stopping": false,
|
105 |
+
"encoder_no_repeat_ngram_size": 0,
|
106 |
+
"eos_token_id": null,
|
107 |
+
"exponential_decay_length_penalty": null,
|
108 |
+
"finetuning_task": null,
|
109 |
+
"forced_bos_token_id": null,
|
110 |
+
"forced_eos_token_id": null,
|
111 |
+
"hidden_act": "quick_gelu",
|
112 |
+
"hidden_size": 1024,
|
113 |
+
"id2label": {
|
114 |
+
"0": "LABEL_0",
|
115 |
+
"1": "LABEL_1"
|
116 |
+
},
|
117 |
+
"image_size": 224,
|
118 |
+
"initializer_factor": 1.0,
|
119 |
+
"initializer_range": 0.02,
|
120 |
+
"intermediate_size": 4096,
|
121 |
+
"is_decoder": false,
|
122 |
+
"is_encoder_decoder": false,
|
123 |
+
"label2id": {
|
124 |
+
"LABEL_0": 0,
|
125 |
+
"LABEL_1": 1
|
126 |
+
},
|
127 |
+
"layer_norm_eps": 1e-05,
|
128 |
+
"length_penalty": 1.0,
|
129 |
+
"max_length": 20,
|
130 |
+
"min_length": 0,
|
131 |
+
"model_type": "clip_vision_model",
|
132 |
+
"no_repeat_ngram_size": 0,
|
133 |
+
"num_attention_heads": 16,
|
134 |
+
"num_beam_groups": 1,
|
135 |
+
"num_beams": 1,
|
136 |
+
"num_channels": 3,
|
137 |
+
"num_hidden_layers": 24,
|
138 |
+
"num_return_sequences": 1,
|
139 |
+
"output_attentions": false,
|
140 |
+
"output_hidden_states": false,
|
141 |
+
"output_scores": false,
|
142 |
+
"pad_token_id": null,
|
143 |
+
"patch_size": 14,
|
144 |
+
"prefix": null,
|
145 |
+
"problem_type": null,
|
146 |
+
"projection_dim": 512,
|
147 |
+
"pruned_heads": {},
|
148 |
+
"remove_invalid_values": false,
|
149 |
+
"repetition_penalty": 1.0,
|
150 |
+
"return_dict": true,
|
151 |
+
"return_dict_in_generate": false,
|
152 |
+
"sep_token_id": null,
|
153 |
+
"suppress_tokens": null,
|
154 |
+
"task_specific_params": null,
|
155 |
+
"temperature": 1.0,
|
156 |
+
"tf_legacy_loss": false,
|
157 |
+
"tie_encoder_decoder": false,
|
158 |
+
"tie_word_embeddings": true,
|
159 |
+
"tokenizer_class": null,
|
160 |
+
"top_k": 50,
|
161 |
+
"top_p": 1.0,
|
162 |
+
"torch_dtype": null,
|
163 |
+
"torchscript": false,
|
164 |
+
"transformers_version": "4.26.0",
|
165 |
+
"typical_p": 1.0,
|
166 |
+
"use_bfloat16": false
|
167 |
+
}
|
168 |
+
}
|
output_dir_1250/safety_checker/pytorch_model.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:736ce241588c434601b4656a14498e8da3113e31ae5e5d401fabb342f7c7a52a
|
3 |
+
size 1216064769
|
output_dir_1250/scheduler/scheduler_config.json
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_class_name": "PNDMScheduler",
|
3 |
+
"_diffusers_version": "0.19.0.dev0",
|
4 |
+
"beta_end": 0.012,
|
5 |
+
"beta_schedule": "scaled_linear",
|
6 |
+
"beta_start": 0.00085,
|
7 |
+
"clip_sample": false,
|
8 |
+
"clip_sample_range": 1.0,
|
9 |
+
"dynamic_thresholding_ratio": 0.995,
|
10 |
+
"num_train_timesteps": 1000,
|
11 |
+
"prediction_type": "epsilon",
|
12 |
+
"rescale_betas_zero_snr": false,
|
13 |
+
"sample_max_value": 1.0,
|
14 |
+
"set_alpha_to_one": false,
|
15 |
+
"skip_prk_steps": true,
|
16 |
+
"steps_offset": 1,
|
17 |
+
"thresholding": false,
|
18 |
+
"timestep_spacing": "leading",
|
19 |
+
"trained_betas": null
|
20 |
+
}
|
output_dir_1250/text_encoder/config.json
ADDED
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_name_or_path": "/content/model",
|
3 |
+
"architectures": [
|
4 |
+
"CLIPTextModel"
|
5 |
+
],
|
6 |
+
"attention_dropout": 0.0,
|
7 |
+
"bos_token_id": 0,
|
8 |
+
"dropout": 0.0,
|
9 |
+
"eos_token_id": 2,
|
10 |
+
"hidden_act": "quick_gelu",
|
11 |
+
"hidden_size": 768,
|
12 |
+
"initializer_factor": 1.0,
|
13 |
+
"initializer_range": 0.02,
|
14 |
+
"intermediate_size": 3072,
|
15 |
+
"layer_norm_eps": 1e-05,
|
16 |
+
"max_position_embeddings": 77,
|
17 |
+
"model_type": "clip_text_model",
|
18 |
+
"num_attention_heads": 12,
|
19 |
+
"num_hidden_layers": 12,
|
20 |
+
"pad_token_id": 1,
|
21 |
+
"projection_dim": 768,
|
22 |
+
"torch_dtype": "float16",
|
23 |
+
"transformers_version": "4.26.0",
|
24 |
+
"vocab_size": 49408
|
25 |
+
}
|
output_dir_1250/text_encoder/pytorch_model.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:353aa189c6da3dbd16433b0a7271a82eb14a6ab142c0381aa0dcaab648aad2ba
|
3 |
+
size 246188833
|
output_dir_1250/tokenizer/merges.txt
ADDED
The diff for this file is too large to render.
See raw diff
|
|
output_dir_1250/tokenizer/special_tokens_map.json
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"bos_token": {
|
3 |
+
"content": "<|startoftext|>",
|
4 |
+
"lstrip": false,
|
5 |
+
"normalized": true,
|
6 |
+
"rstrip": false,
|
7 |
+
"single_word": false
|
8 |
+
},
|
9 |
+
"eos_token": {
|
10 |
+
"content": "<|endoftext|>",
|
11 |
+
"lstrip": false,
|
12 |
+
"normalized": true,
|
13 |
+
"rstrip": false,
|
14 |
+
"single_word": false
|
15 |
+
},
|
16 |
+
"pad_token": "<|endoftext|>",
|
17 |
+
"unk_token": {
|
18 |
+
"content": "<|endoftext|>",
|
19 |
+
"lstrip": false,
|
20 |
+
"normalized": true,
|
21 |
+
"rstrip": false,
|
22 |
+
"single_word": false
|
23 |
+
}
|
24 |
+
}
|
output_dir_1250/tokenizer/tokenizer_config.json
ADDED
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"add_prefix_space": false,
|
3 |
+
"bos_token": {
|
4 |
+
"__type": "AddedToken",
|
5 |
+
"content": "<|startoftext|>",
|
6 |
+
"lstrip": false,
|
7 |
+
"normalized": true,
|
8 |
+
"rstrip": false,
|
9 |
+
"single_word": false
|
10 |
+
},
|
11 |
+
"clean_up_tokenization_spaces": true,
|
12 |
+
"do_lower_case": true,
|
13 |
+
"eos_token": {
|
14 |
+
"__type": "AddedToken",
|
15 |
+
"content": "<|endoftext|>",
|
16 |
+
"lstrip": false,
|
17 |
+
"normalized": true,
|
18 |
+
"rstrip": false,
|
19 |
+
"single_word": false
|
20 |
+
},
|
21 |
+
"errors": "replace",
|
22 |
+
"model_max_length": 77,
|
23 |
+
"name_or_path": "/content/model/tokenizer",
|
24 |
+
"pad_token": "<|endoftext|>",
|
25 |
+
"special_tokens_map_file": "/content/model/tokenizer/special_tokens_map.json",
|
26 |
+
"tokenizer_class": "CLIPTokenizer",
|
27 |
+
"unk_token": {
|
28 |
+
"__type": "AddedToken",
|
29 |
+
"content": "<|endoftext|>",
|
30 |
+
"lstrip": false,
|
31 |
+
"normalized": true,
|
32 |
+
"rstrip": false,
|
33 |
+
"single_word": false
|
34 |
+
}
|
35 |
+
}
|
output_dir_1250/tokenizer/vocab.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|
output_dir_1250/unet/config.json
ADDED
@@ -0,0 +1,65 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_class_name": "UNet2DConditionModel",
|
3 |
+
"_diffusers_version": "0.19.0.dev0",
|
4 |
+
"_name_or_path": "/content/model",
|
5 |
+
"act_fn": "silu",
|
6 |
+
"addition_embed_type": null,
|
7 |
+
"addition_embed_type_num_heads": 64,
|
8 |
+
"addition_time_embed_dim": null,
|
9 |
+
"attention_head_dim": 8,
|
10 |
+
"block_out_channels": [
|
11 |
+
320,
|
12 |
+
640,
|
13 |
+
1280,
|
14 |
+
1280
|
15 |
+
],
|
16 |
+
"center_input_sample": false,
|
17 |
+
"class_embed_type": null,
|
18 |
+
"class_embeddings_concat": false,
|
19 |
+
"conv_in_kernel": 3,
|
20 |
+
"conv_out_kernel": 3,
|
21 |
+
"cross_attention_dim": 768,
|
22 |
+
"cross_attention_norm": null,
|
23 |
+
"down_block_types": [
|
24 |
+
"CrossAttnDownBlock2D",
|
25 |
+
"CrossAttnDownBlock2D",
|
26 |
+
"CrossAttnDownBlock2D",
|
27 |
+
"DownBlock2D"
|
28 |
+
],
|
29 |
+
"downsample_padding": 1,
|
30 |
+
"dual_cross_attention": false,
|
31 |
+
"encoder_hid_dim": null,
|
32 |
+
"encoder_hid_dim_type": null,
|
33 |
+
"flip_sin_to_cos": true,
|
34 |
+
"freq_shift": 0,
|
35 |
+
"in_channels": 4,
|
36 |
+
"layers_per_block": 2,
|
37 |
+
"mid_block_only_cross_attention": null,
|
38 |
+
"mid_block_scale_factor": 1,
|
39 |
+
"mid_block_type": "UNetMidBlock2DCrossAttn",
|
40 |
+
"norm_eps": 1e-05,
|
41 |
+
"norm_num_groups": 32,
|
42 |
+
"num_attention_heads": null,
|
43 |
+
"num_class_embeds": null,
|
44 |
+
"only_cross_attention": false,
|
45 |
+
"out_channels": 4,
|
46 |
+
"projection_class_embeddings_input_dim": null,
|
47 |
+
"resnet_out_scale_factor": 1.0,
|
48 |
+
"resnet_skip_time_act": false,
|
49 |
+
"resnet_time_scale_shift": "default",
|
50 |
+
"sample_size": 64,
|
51 |
+
"time_cond_proj_dim": null,
|
52 |
+
"time_embedding_act_fn": null,
|
53 |
+
"time_embedding_dim": null,
|
54 |
+
"time_embedding_type": "positional",
|
55 |
+
"timestep_post_act": null,
|
56 |
+
"transformer_layers_per_block": 1,
|
57 |
+
"up_block_types": [
|
58 |
+
"UpBlock2D",
|
59 |
+
"CrossAttnUpBlock2D",
|
60 |
+
"CrossAttnUpBlock2D",
|
61 |
+
"CrossAttnUpBlock2D"
|
62 |
+
],
|
63 |
+
"upcast_attention": false,
|
64 |
+
"use_linear_projection": false
|
65 |
+
}
|
output_dir_1250/unet/diffusion_pytorch_model.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:dc7c846e7ad1a650aba224df9c5221e6f4a781bf1ec12eeef44e0a928ccd0d7c
|
3 |
+
size 3438375973
|
output_dir_1250/vae/config.json
ADDED
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_class_name": "AutoencoderKL",
|
3 |
+
"_diffusers_version": "0.19.0.dev0",
|
4 |
+
"_name_or_path": "/content/model/vae",
|
5 |
+
"act_fn": "silu",
|
6 |
+
"block_out_channels": [
|
7 |
+
128,
|
8 |
+
256,
|
9 |
+
512,
|
10 |
+
512
|
11 |
+
],
|
12 |
+
"down_block_types": [
|
13 |
+
"DownEncoderBlock2D",
|
14 |
+
"DownEncoderBlock2D",
|
15 |
+
"DownEncoderBlock2D",
|
16 |
+
"DownEncoderBlock2D"
|
17 |
+
],
|
18 |
+
"force_upcast": true,
|
19 |
+
"in_channels": 3,
|
20 |
+
"latent_channels": 4,
|
21 |
+
"layers_per_block": 2,
|
22 |
+
"norm_num_groups": 32,
|
23 |
+
"out_channels": 3,
|
24 |
+
"sample_size": 512,
|
25 |
+
"scaling_factor": 0.18215,
|
26 |
+
"up_block_types": [
|
27 |
+
"UpDecoderBlock2D",
|
28 |
+
"UpDecoderBlock2D",
|
29 |
+
"UpDecoderBlock2D",
|
30 |
+
"UpDecoderBlock2D"
|
31 |
+
]
|
32 |
+
}
|
output_dir_1250/vae/diffusion_pytorch_model.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:67cc45e9b0bf8ab90f2e3a4ef8f5c5ce5589098bae089b7295ac559de238398e
|
3 |
+
size 334712113
|
output_dir_650/checkpoint-500/optimizer.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:f99b35828af01ecb7065031230d94002c50d0318d251e1bdac871432d819a947
|
3 |
+
size 1725109957
|
output_dir_650/checkpoint-500/random_states_0.pkl
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:31e5633722adf843d8ea0e259618e48c113b7804e8688fca7e4d4c2a77441106
|
3 |
+
size 14663
|
output_dir_650/checkpoint-500/scaler.pt
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:a3f196a54202bb4ba1220e8c59f42f9cda0702d68ea83147d814c2fb2f36b8f2
|
3 |
+
size 557
|