diff options
author | AUTOMATIC <16777216c@gmail.com> | 2023-01-18 20:04:24 +0000 |
---|---|---|
committer | AUTOMATIC <16777216c@gmail.com> | 2023-01-18 20:04:24 +0000 |
commit | 924e222004ab54273806c5f2ca7a0e7cfa76ad83 (patch) | |
tree | 153a08105ee2bc87df43a8a1423df96d25a8e19b /modules/hypernetworks | |
parent | 889b851a5260ce869a3286ad15d17d1bbb1da0a7 (diff) | |
download | stable-diffusion-webui-gfx803-924e222004ab54273806c5f2ca7a0e7cfa76ad83.tar.gz stable-diffusion-webui-gfx803-924e222004ab54273806c5f2ca7a0e7cfa76ad83.tar.bz2 stable-diffusion-webui-gfx803-924e222004ab54273806c5f2ca7a0e7cfa76ad83.zip |
add option to show/hide warnings
removed hiding warnings from LDSR
fixed/reworked few places that produced warnings
Diffstat (limited to 'modules/hypernetworks')
-rw-r--r-- | modules/hypernetworks/hypernetwork.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/modules/hypernetworks/hypernetwork.py b/modules/hypernetworks/hypernetwork.py index c963fc40..74e78582 100644 --- a/modules/hypernetworks/hypernetwork.py +++ b/modules/hypernetworks/hypernetwork.py @@ -12,7 +12,7 @@ import torch import tqdm
from einops import rearrange, repeat
from ldm.util import default
-from modules import devices, processing, sd_models, shared, sd_samplers, hashes
+from modules import devices, processing, sd_models, shared, sd_samplers, hashes, sd_hijack_checkpoint
from modules.textual_inversion import textual_inversion, logging
from modules.textual_inversion.learn_schedule import LearnRateScheduler
from torch import einsum
@@ -575,6 +575,8 @@ def train_hypernetwork(id_task, hypernetwork_name, learn_rate, batch_size, gradi pbar = tqdm.tqdm(total=steps - initial_step)
try:
+ sd_hijack_checkpoint.add()
+
for i in range((steps-initial_step) * gradient_step):
if scheduler.finished:
break
@@ -724,6 +726,9 @@ Last saved image: {html.escape(last_saved_image)}<br/> pbar.close()
hypernetwork.eval()
#report_statistics(loss_dict)
+ sd_hijack_checkpoint.remove()
+
+
filename = os.path.join(shared.cmd_opts.hypernetwork_dir, f'{hypernetwork_name}.pt')
hypernetwork.optimizer_name = optimizer_name
|