2512
Browse files- media/result_grid.jpg +2 -2
- samples/unet_384x768_0.jpg +2 -2
- samples/unet_416x768_0.jpg +2 -2
- samples/unet_448x768_0.jpg +2 -2
- samples/unet_480x768_0.jpg +2 -2
- samples/unet_512x768_0.jpg +2 -2
- samples/unet_544x768_0.jpg +2 -2
- samples/unet_576x768_0.jpg +2 -2
- samples/unet_608x768_0.jpg +2 -2
- samples/unet_640x768_0.jpg +2 -2
- samples/unet_672x768_0.jpg +2 -2
- samples/unet_704x768_0.jpg +2 -2
- samples/unet_736x768_0.jpg +2 -2
- samples/unet_768x384_0.jpg +2 -2
- samples/unet_768x416_0.jpg +2 -2
- samples/unet_768x448_0.jpg +2 -2
- samples/unet_768x480_0.jpg +2 -2
- samples/unet_768x512_0.jpg +2 -2
- samples/unet_768x544_0.jpg +2 -2
- samples/unet_768x576_0.jpg +2 -2
- samples/unet_768x608_0.jpg +2 -2
- samples/unet_768x640_0.jpg +2 -2
- samples/unet_768x672_0.jpg +2 -2
- samples/unet_768x704_0.jpg +2 -2
- samples/unet_768x736_0.jpg +2 -2
- samples/unet_768x768_0.jpg +2 -2
- src/dataset_sample.ipynb +2 -2
- src/sdxs_create.ipynb +2 -2
- src/sdxs_create_07.ipynb +2 -2
- test.ipynb +2 -2
- train.py +16 -5
- unet/config.json +2 -2
- unet/diffusion_pytorch_model.safetensors +2 -2
media/result_grid.jpg
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
samples/unet_384x768_0.jpg
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
samples/unet_416x768_0.jpg
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
samples/unet_448x768_0.jpg
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
samples/unet_480x768_0.jpg
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
samples/unet_512x768_0.jpg
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
samples/unet_544x768_0.jpg
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
samples/unet_576x768_0.jpg
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
samples/unet_608x768_0.jpg
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
samples/unet_640x768_0.jpg
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
samples/unet_672x768_0.jpg
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
samples/unet_704x768_0.jpg
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
samples/unet_736x768_0.jpg
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
samples/unet_768x384_0.jpg
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
samples/unet_768x416_0.jpg
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
samples/unet_768x448_0.jpg
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
samples/unet_768x480_0.jpg
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
samples/unet_768x512_0.jpg
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
samples/unet_768x544_0.jpg
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
samples/unet_768x576_0.jpg
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
samples/unet_768x608_0.jpg
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
samples/unet_768x640_0.jpg
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
samples/unet_768x672_0.jpg
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
samples/unet_768x704_0.jpg
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
samples/unet_768x736_0.jpg
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
samples/unet_768x768_0.jpg
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
src/dataset_sample.ipynb
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:0cdeb27a316f7c3949d5c721062ad7837b5527d3c7fda70129b51b993a087cf4
|
| 3 |
+
size 26286441
|
src/sdxs_create.ipynb
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:64795c45e866b9672710f79a3633a814e7a701c52906c59df458f3bf37478af1
|
| 3 |
+
size 43355
|
src/sdxs_create_07.ipynb
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:7b24d9182db53377431320496f8f5fba1a74c3c09dd011a2cf1d3ff32f8aba58
|
| 3 |
+
size 6648
|
test.ipynb
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:7ee6048c4a59ddefaf190e5398f0dd7586746b0959db16971a118ca0a8e6e269
|
| 3 |
+
size 8882423
|
train.py
CHANGED
|
@@ -29,7 +29,7 @@ from transformers import AutoTokenizer, AutoModel
|
|
| 29 |
# --------------------------- Параметры ---------------------------
|
| 30 |
ds_path = "/workspace/sdxs/datasets/768"
|
| 31 |
project = "unet"
|
| 32 |
-
batch_size =
|
| 33 |
base_learning_rate = 2e-5 #2.7e-5
|
| 34 |
min_learning_rate = 2e-6 #2.7e-5
|
| 35 |
num_epochs = 10
|
|
@@ -341,6 +341,14 @@ if limit > 0:
|
|
| 341 |
else:
|
| 342 |
dataset = load_from_disk(ds_path)
|
| 343 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 344 |
# --- [UPDATED] Collate Function ---
|
| 345 |
def collate_fn_simple(batch):
|
| 346 |
# 1. Латенты (VAE)
|
|
@@ -374,7 +382,8 @@ batch_sampler = DistributedResolutionBatchSampler(
|
|
| 374 |
)
|
| 375 |
|
| 376 |
dataloader = DataLoader(dataset, batch_sampler=batch_sampler, collate_fn=collate_fn_simple)
|
| 377 |
-
|
|
|
|
| 378 |
dataloader = accelerator.prepare(dataloader)
|
| 379 |
|
| 380 |
start_epoch = 0
|
|
@@ -733,11 +742,13 @@ for epoch in range(start_epoch, start_epoch + num_epochs):
|
|
| 733 |
wandb.log(log_data, step=global_step)
|
| 734 |
if use_comet_ml:
|
| 735 |
comet_experiment.log_metrics(log_data, step=global_step)
|
| 736 |
-
|
| 737 |
if global_step % sample_interval == 0:
|
| 738 |
# Передаем tuple (emb, mask) для негатива
|
| 739 |
-
|
| 740 |
-
|
|
|
|
|
|
|
| 741 |
last_n = sample_interval
|
| 742 |
|
| 743 |
if save_model:
|
|
|
|
| 29 |
# --------------------------- Параметры ---------------------------
|
| 30 |
ds_path = "/workspace/sdxs/datasets/768"
|
| 31 |
project = "unet"
|
| 32 |
+
batch_size = 36
|
| 33 |
base_learning_rate = 2e-5 #2.7e-5
|
| 34 |
min_learning_rate = 2e-6 #2.7e-5
|
| 35 |
num_epochs = 10
|
|
|
|
| 341 |
else:
|
| 342 |
dataset = load_from_disk(ds_path)
|
| 343 |
|
| 344 |
+
dataset = dataset.filter(
|
| 345 |
+
lambda x: [not (path.startswith("/workspace/ds/animesfw") or path.startswith("/workspace/ds/d4/animesfw")) for path in x["image_path"]],
|
| 346 |
+
batched=True,
|
| 347 |
+
batch_size=10000, # обрабатываем по 10к строк за раз
|
| 348 |
+
num_proc=8
|
| 349 |
+
)
|
| 350 |
+
print(f"Осталось примеров после фильтрации: {len(dataset)}")
|
| 351 |
+
|
| 352 |
# --- [UPDATED] Collate Function ---
|
| 353 |
def collate_fn_simple(batch):
|
| 354 |
# 1. Латенты (VAE)
|
|
|
|
| 382 |
)
|
| 383 |
|
| 384 |
dataloader = DataLoader(dataset, batch_sampler=batch_sampler, collate_fn=collate_fn_simple)
|
| 385 |
+
if accelerator.is_main_process:
|
| 386 |
+
print("Total samples", len(dataloader))
|
| 387 |
dataloader = accelerator.prepare(dataloader)
|
| 388 |
|
| 389 |
start_epoch = 0
|
|
|
|
| 742 |
wandb.log(log_data, step=global_step)
|
| 743 |
if use_comet_ml:
|
| 744 |
comet_experiment.log_metrics(log_data, step=global_step)
|
| 745 |
+
|
| 746 |
if global_step % sample_interval == 0:
|
| 747 |
# Передаем tuple (emb, mask) для негатива
|
| 748 |
+
if save_model:
|
| 749 |
+
generate_and_save_samples(fixed_samples, (uncond_emb, uncond_mask), global_step)
|
| 750 |
+
elif epoch % 10 == 0:
|
| 751 |
+
generate_and_save_samples(fixed_samples, (uncond_emb, uncond_mask), global_step)
|
| 752 |
last_n = sample_interval
|
| 753 |
|
| 754 |
if save_model:
|
unet/config.json
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:80410b994cba2961422e6bade67a2a6a41abaf90e6dd89c0226402f45ef113cb
|
| 3 |
+
size 1892
|
unet/diffusion_pytorch_model.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:7e5b6db0af234e3191d65afd39653d779a2e49bd2377b3fc4e12c3b68df3fded
|
| 3 |
+
size 3722280432
|