2511
Browse files
samples/sample_decoded_0.jpg
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
samples/sample_decoded_1.jpg
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
samples/sample_decoded_2.jpg
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
train_vae_fdl.py
CHANGED
|
@@ -53,20 +53,21 @@ clip_grad_norm = 1.0
|
|
| 53 |
mixed_precision = "no"
|
| 54 |
gradient_accumulation_steps = 2
|
| 55 |
generated_folder = "samples"
|
| 56 |
-
save_as = "
|
| 57 |
num_workers = 0
|
| 58 |
device = None
|
| 59 |
|
| 60 |
# --- Режимы обучения ---
|
| 61 |
# QWEN: учим только декодер
|
| 62 |
train_decoder_only = True
|
|
|
|
| 63 |
full_training = False # если True — учим весь VAE и добавляем KL (ниже)
|
| 64 |
kl_ratio = 0.00
|
| 65 |
|
| 66 |
# Доли лоссов
|
| 67 |
loss_ratios = {
|
| 68 |
-
"lpips": 0.50,
|
| 69 |
-
"fdl" : 0.25,
|
| 70 |
"edge": 0.05,
|
| 71 |
"mse": 0.10,
|
| 72 |
"mae": 0.10,
|
|
@@ -171,13 +172,13 @@ if full_training and not train_decoder_only:
|
|
| 171 |
else:
|
| 172 |
# учим только 0-й блок декодера + post_quant_conv
|
| 173 |
if hasattr(core, "decoder"):
|
| 174 |
-
if hasattr(core.decoder, "up_blocks") and len(core.decoder.up_blocks) > 0:
|
| 175 |
# --- только 0-й up_block ---
|
| 176 |
for name, p in core.decoder.up_blocks[0].named_parameters():
|
| 177 |
p.requires_grad = True
|
| 178 |
unfrozen_param_names.append(f"{name}")
|
| 179 |
else:
|
| 180 |
-
print("
|
| 181 |
for name, p in core.decoder.named_parameters():
|
| 182 |
p.requires_grad = True
|
| 183 |
unfrozen_param_names.append(f"decoder.{name}")
|
|
|
|
| 53 |
mixed_precision = "no"
|
| 54 |
gradient_accumulation_steps = 2
|
| 55 |
generated_folder = "samples"
|
| 56 |
+
save_as = "vae4"
|
| 57 |
num_workers = 0
|
| 58 |
device = None
|
| 59 |
|
| 60 |
# --- Режимы обучения ---
|
| 61 |
# QWEN: учим только декодер
|
| 62 |
train_decoder_only = True
|
| 63 |
+
train_up_only = False
|
| 64 |
full_training = False # если True — учим весь VAE и добавляем KL (ниже)
|
| 65 |
kl_ratio = 0.00
|
| 66 |
|
| 67 |
# Доли лоссов
|
| 68 |
loss_ratios = {
|
| 69 |
+
"lpips": 0.70,#0.50,
|
| 70 |
+
"fdl" : 0.05,#0.25,
|
| 71 |
"edge": 0.05,
|
| 72 |
"mse": 0.10,
|
| 73 |
"mae": 0.10,
|
|
|
|
| 172 |
else:
|
| 173 |
# учим только 0-й блок декодера + post_quant_conv
|
| 174 |
if hasattr(core, "decoder"):
|
| 175 |
+
if train_up_only:#hasattr(core.decoder, "up_blocks") and len(core.decoder.up_blocks) > 0:
|
| 176 |
# --- только 0-й up_block ---
|
| 177 |
for name, p in core.decoder.up_blocks[0].named_parameters():
|
| 178 |
p.requires_grad = True
|
| 179 |
unfrozen_param_names.append(f"{name}")
|
| 180 |
else:
|
| 181 |
+
print("Decoder — fallback to full decoder")
|
| 182 |
for name, p in core.decoder.named_parameters():
|
| 183 |
p.requires_grad = True
|
| 184 |
unfrozen_param_names.append(f"decoder.{name}")
|
vae/diffusion_pytorch_model.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 382598708
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:1a534956925d8f565c3f17704f955bc09ae316b6876d528b0b2e2cc3db723d32
|
| 3 |
size 382598708
|
vae3/diffusion_pytorch_model.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 382598708
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:1a534956925d8f565c3f17704f955bc09ae316b6876d528b0b2e2cc3db723d32
|
| 3 |
size 382598708
|
vae4/config.json
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_class_name": "AsymmetricAutoencoderKL",
|
| 3 |
+
"_diffusers_version": "0.35.2",
|
| 4 |
+
"_name_or_path": "vae",
|
| 5 |
+
"act_fn": "silu",
|
| 6 |
+
"block_out_channels": [
|
| 7 |
+
128,
|
| 8 |
+
128,
|
| 9 |
+
256,
|
| 10 |
+
512,
|
| 11 |
+
512
|
| 12 |
+
],
|
| 13 |
+
"down_block_out_channels": [
|
| 14 |
+
128,
|
| 15 |
+
256,
|
| 16 |
+
512,
|
| 17 |
+
512
|
| 18 |
+
],
|
| 19 |
+
"down_block_types": [
|
| 20 |
+
"DownEncoderBlock2D",
|
| 21 |
+
"DownEncoderBlock2D",
|
| 22 |
+
"DownEncoderBlock2D",
|
| 23 |
+
"DownEncoderBlock2D"
|
| 24 |
+
],
|
| 25 |
+
"force_upcast": false,
|
| 26 |
+
"in_channels": 3,
|
| 27 |
+
"latent_channels": 16,
|
| 28 |
+
"layers_per_down_block": 2,
|
| 29 |
+
"layers_per_up_block": 2,
|
| 30 |
+
"norm_num_groups": 32,
|
| 31 |
+
"out_channels": 3,
|
| 32 |
+
"sample_size": 1024,
|
| 33 |
+
"scaling_factor": 1.0,
|
| 34 |
+
"up_block_out_channels": [
|
| 35 |
+
128,
|
| 36 |
+
128,
|
| 37 |
+
256,
|
| 38 |
+
512,
|
| 39 |
+
512
|
| 40 |
+
],
|
| 41 |
+
"up_block_types": [
|
| 42 |
+
"UpDecoderBlock2D",
|
| 43 |
+
"UpDecoderBlock2D",
|
| 44 |
+
"UpDecoderBlock2D",
|
| 45 |
+
"UpDecoderBlock2D",
|
| 46 |
+
"UpDecoderBlock2D"
|
| 47 |
+
]
|
| 48 |
+
}
|
vae4/diffusion_pytorch_model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:98a644a03456c80a19c14b9dc792c6f65df4a1d82d24e18b2c8bf4a4e6a2c86d
|
| 3 |
+
size 382598708
|