Skip to content

Commit b902846

Browse files
committed
Implement Adaptive noise scale
1 parent 344b4af commit b902846

File tree

5 files changed

+249
-154
lines changed

5 files changed

+249
-154
lines changed

dreambooth_gui.py

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ def save_configuration(
104104
caption_dropout_rate,
105105
optimizer,
106106
optimizer_args,
107-
noise_offset,
107+
noise_offset_type,noise_offset,adaptive_noise_scale,
108108
multires_noise_iterations,
109109
multires_noise_discount,
110110
sample_every_n_steps,
@@ -222,7 +222,7 @@ def open_configuration(
222222
caption_dropout_rate,
223223
optimizer,
224224
optimizer_args,
225-
noise_offset,
225+
noise_offset_type,noise_offset,adaptive_noise_scale,
226226
multires_noise_iterations,
227227
multires_noise_discount,
228228
sample_every_n_steps,
@@ -323,7 +323,7 @@ def train_model(
323323
caption_dropout_rate,
324324
optimizer,
325325
optimizer_args,
326-
noise_offset,
326+
noise_offset_type,noise_offset,adaptive_noise_scale,
327327
multires_noise_iterations,
328328
multires_noise_discount,
329329
sample_every_n_steps,
@@ -387,15 +387,15 @@ def train_model(
387387
)
388388
lr_warmup = '0'
389389

390-
if float(noise_offset) > 0 and (
391-
multires_noise_iterations > 0 or multires_noise_discount > 0
392-
):
393-
output_message(
394-
msg="noise offset and multires_noise can't be set at the same time. Only use one or the other.",
395-
title='Error',
396-
headless=headless_bool,
397-
)
398-
return
390+
# if float(noise_offset) > 0 and (
391+
# multires_noise_iterations > 0 or multires_noise_discount > 0
392+
# ):
393+
# output_message(
394+
# msg="noise offset and multires_noise can't be set at the same time. Only use one or the other.",
395+
# title='Error',
396+
# headless=headless_bool,
397+
# )
398+
# return
399399

400400
# Get a list of all subfolders in train_data_dir, excluding hidden folders
401401
subfolders = [
@@ -582,7 +582,9 @@ def train_model(
582582
bucket_reso_steps=bucket_reso_steps,
583583
caption_dropout_every_n_epochs=caption_dropout_every_n_epochs,
584584
caption_dropout_rate=caption_dropout_rate,
585+
noise_offset_type=noise_offset_type,
585586
noise_offset=noise_offset,
587+
adaptive_noise_scale=adaptive_noise_scale,
586588
multires_noise_iterations=multires_noise_iterations,
587589
multires_noise_discount=multires_noise_discount,
588590
additional_parameters=additional_parameters,
@@ -805,7 +807,7 @@ def dreambooth_tab(
805807
bucket_reso_steps,
806808
caption_dropout_every_n_epochs,
807809
caption_dropout_rate,
808-
noise_offset,
810+
noise_offset_type,noise_offset,adaptive_noise_scale,
809811
multires_noise_iterations,
810812
multires_noise_discount,
811813
additional_parameters,
@@ -912,7 +914,7 @@ def dreambooth_tab(
912914
caption_dropout_rate,
913915
optimizer,
914916
optimizer_args,
915-
noise_offset,
917+
noise_offset_type,noise_offset,adaptive_noise_scale,
916918
multires_noise_iterations,
917919
multires_noise_discount,
918920
sample_every_n_steps,

finetune_gui.py

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ def save_configuration(
103103
caption_dropout_rate,
104104
optimizer,
105105
optimizer_args,
106-
noise_offset,
106+
noise_offset_type,noise_offset,adaptive_noise_scale,
107107
multires_noise_iterations,
108108
multires_noise_discount,
109109
sample_every_n_steps,
@@ -227,7 +227,7 @@ def open_configuration(
227227
caption_dropout_rate,
228228
optimizer,
229229
optimizer_args,
230-
noise_offset,
230+
noise_offset_type,noise_offset,adaptive_noise_scale,
231231
multires_noise_iterations,
232232
multires_noise_discount,
233233
sample_every_n_steps,
@@ -334,7 +334,7 @@ def train_model(
334334
caption_dropout_rate,
335335
optimizer,
336336
optimizer_args,
337-
noise_offset,
337+
noise_offset_type,noise_offset,adaptive_noise_scale,
338338
multires_noise_iterations,
339339
multires_noise_discount,
340340
sample_every_n_steps,
@@ -358,15 +358,15 @@ def train_model(
358358
):
359359
return
360360

361-
if float(noise_offset) > 0 and (
362-
multires_noise_iterations > 0 or multires_noise_discount > 0
363-
):
364-
output_message(
365-
msg="noise offset and multires_noise can't be set at the same time. Only use one or the other.",
366-
title='Error',
367-
headless=headless_bool,
368-
)
369-
return
361+
# if float(noise_offset) > 0 and (
362+
# multires_noise_iterations > 0 or multires_noise_discount > 0
363+
# ):
364+
# output_message(
365+
# msg="noise offset and multires_noise can't be set at the same time. Only use one or the other.",
366+
# title='Error',
367+
# headless=headless_bool,
368+
# )
369+
# return
370370

371371
if optimizer == 'Adafactor' and lr_warmup != '0':
372372
output_message(
@@ -532,7 +532,9 @@ def train_model(
532532
bucket_reso_steps=bucket_reso_steps,
533533
caption_dropout_every_n_epochs=caption_dropout_every_n_epochs,
534534
caption_dropout_rate=caption_dropout_rate,
535+
noise_offset_type=noise_offset_type,
535536
noise_offset=noise_offset,
537+
adaptive_noise_scale=adaptive_noise_scale,
536538
multires_noise_iterations=multires_noise_iterations,
537539
multires_noise_discount=multires_noise_discount,
538540
additional_parameters=additional_parameters,
@@ -771,7 +773,7 @@ def finetune_tab(headless=False):
771773
bucket_reso_steps,
772774
caption_dropout_every_n_epochs,
773775
caption_dropout_rate,
774-
noise_offset,
776+
noise_offset_type,noise_offset,adaptive_noise_scale,
775777
multires_noise_iterations,
776778
multires_noise_discount,
777779
additional_parameters,
@@ -871,7 +873,7 @@ def finetune_tab(headless=False):
871873
caption_dropout_rate,
872874
optimizer,
873875
optimizer_args,
874-
noise_offset,
876+
noise_offset_type,noise_offset,adaptive_noise_scale,
875877
multires_noise_iterations,
876878
multires_noise_discount,
877879
sample_every_n_steps,

0 commit comments

Comments
 (0)