Upload folder using huggingface_hub
Browse files- samples/sample_0.jpg +2 -2
- samples/sample_1.jpg +0 -0
- samples/sample_2.jpg +0 -0
- samples/sample_decoded.jpg +2 -2
- test.ipynb +1 -1
- train_vae.py +19 -11
- vae/diffusion_pytorch_model.safetensors +1 -1
samples/sample_0.jpg
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
samples/sample_1.jpg
CHANGED
|
|
samples/sample_2.jpg
CHANGED
|
|
samples/sample_decoded.jpg
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
test.ipynb
CHANGED
|
@@ -2,7 +2,7 @@
|
|
| 2 |
"cells": [
|
| 3 |
{
|
| 4 |
"cell_type": "code",
|
| 5 |
-
"execution_count":
|
| 6 |
"id": "6ca10d55-03ed-4c8b-b32b-8d2f94d77162",
|
| 7 |
"metadata": {},
|
| 8 |
"outputs": [
|
|
|
|
| 2 |
"cells": [
|
| 3 |
{
|
| 4 |
"cell_type": "code",
|
| 5 |
+
"execution_count": 1,
|
| 6 |
"id": "6ca10d55-03ed-4c8b-b32b-8d2f94d77162",
|
| 7 |
"metadata": {},
|
| 8 |
"outputs": [
|
train_vae.py
CHANGED
|
@@ -29,9 +29,9 @@ from collections import deque
|
|
| 29 |
# --------------------------- Параметры ---------------------------
|
| 30 |
ds_path = "/workspace/d23"
|
| 31 |
project = "vae"
|
| 32 |
-
batch_size =
|
| 33 |
-
base_learning_rate =
|
| 34 |
-
min_learning_rate =
|
| 35 |
num_epochs = 25
|
| 36 |
sample_interval_share = 10
|
| 37 |
use_wandb = True
|
|
@@ -40,8 +40,8 @@ use_decay = True
|
|
| 40 |
optimizer_type = "adam8bit"
|
| 41 |
dtype = torch.float32
|
| 42 |
|
| 43 |
-
model_resolution =
|
| 44 |
-
high_resolution =
|
| 45 |
limit = 0
|
| 46 |
save_barrier = 1.3
|
| 47 |
warmup_percent = 0.01
|
|
@@ -50,7 +50,7 @@ beta2 = 0.997
|
|
| 50 |
eps = 1e-8
|
| 51 |
clip_grad_norm = 1.0
|
| 52 |
mixed_precision = "no"
|
| 53 |
-
gradient_accumulation_steps =
|
| 54 |
generated_folder = "samples"
|
| 55 |
save_as = "vae"
|
| 56 |
num_workers = 0
|
|
@@ -167,16 +167,24 @@ if full_training and not train_decoder_only:
|
|
| 167 |
loss_ratios["kl"] = float(kl_ratio)
|
| 168 |
trainable_module = core
|
| 169 |
else:
|
| 170 |
-
# учим только
|
| 171 |
if hasattr(core, "decoder"):
|
| 172 |
-
|
| 173 |
-
|
| 174 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 175 |
if hasattr(core, "post_quant_conv"):
|
| 176 |
for name, p in core.post_quant_conv.named_parameters():
|
| 177 |
p.requires_grad = True
|
| 178 |
unfrozen_param_names.append(f"post_quant_conv.{name}")
|
| 179 |
-
|
|
|
|
| 180 |
|
| 181 |
print(f"[INFO] Разморожено параметров: {len(unfrozen_param_names)}. Первые 200 имён:")
|
| 182 |
for nm in unfrozen_param_names[:200]:
|
|
|
|
| 29 |
# --------------------------- Параметры ---------------------------
|
| 30 |
ds_path = "/workspace/d23"
|
| 31 |
project = "vae"
|
| 32 |
+
batch_size = 2
|
| 33 |
+
base_learning_rate = 2e-6
|
| 34 |
+
min_learning_rate = 7e-7
|
| 35 |
num_epochs = 25
|
| 36 |
sample_interval_share = 10
|
| 37 |
use_wandb = True
|
|
|
|
| 40 |
optimizer_type = "adam8bit"
|
| 41 |
dtype = torch.float32
|
| 42 |
|
| 43 |
+
model_resolution = 384
|
| 44 |
+
high_resolution = 768
|
| 45 |
limit = 0
|
| 46 |
save_barrier = 1.3
|
| 47 |
warmup_percent = 0.01
|
|
|
|
| 50 |
eps = 1e-8
|
| 51 |
clip_grad_norm = 1.0
|
| 52 |
mixed_precision = "no"
|
| 53 |
+
gradient_accumulation_steps = 8
|
| 54 |
generated_folder = "samples"
|
| 55 |
save_as = "vae"
|
| 56 |
num_workers = 0
|
|
|
|
| 167 |
loss_ratios["kl"] = float(kl_ratio)
|
| 168 |
trainable_module = core
|
| 169 |
else:
|
| 170 |
+
# учим только 0-й блок декодера + post_quant_conv
|
| 171 |
if hasattr(core, "decoder"):
|
| 172 |
+
# --- только 0-й up_block ---
|
| 173 |
+
if hasattr(core.decoder, "up_blocks") and len(core.decoder.up_blocks) > 0:
|
| 174 |
+
for name, p in core.decoder.up_blocks[0].named_parameters():
|
| 175 |
+
p.requires_grad = True
|
| 176 |
+
unfrozen_param_names.append(f"decoder.up_blocks.0.{name}")
|
| 177 |
+
else:
|
| 178 |
+
print("[WARN] Decoder has no up_blocks — fallback to full decoder")
|
| 179 |
+
for name, p in core.decoder.named_parameters():
|
| 180 |
+
p.requires_grad = True
|
| 181 |
+
unfrozen_param_names.append(f"decoder.{name}")
|
| 182 |
if hasattr(core, "post_quant_conv"):
|
| 183 |
for name, p in core.post_quant_conv.named_parameters():
|
| 184 |
p.requires_grad = True
|
| 185 |
unfrozen_param_names.append(f"post_quant_conv.{name}")
|
| 186 |
+
trainable_module = core.decoder if hasattr(core, "decoder") else core
|
| 187 |
+
|
| 188 |
|
| 189 |
print(f"[INFO] Разморожено параметров: {len(unfrozen_param_names)}. Первые 200 имён:")
|
| 190 |
for nm in unfrozen_param_names[:200]:
|
vae/diffusion_pytorch_model.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 444559412
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:da1a8a728f24c5841cd0be986c90096d63800f8403bfba4b0e8c25c82c521bbf
|
| 3 |
size 444559412
|