diff options
author | flamelaw <flamelaw.com3d2@gmail.com> | 2022-11-21 01:15:46 +0000 |
---|---|---|
committer | flamelaw <flamelaw.com3d2@gmail.com> | 2022-11-21 01:15:46 +0000 |
commit | 5b57f61ba47f8b11d19a5b46e7fb5a52458abae5 (patch) | |
tree | 474be8cd4ca69e75ba95516b100874a88d235fde /modules/hypernetworks/hypernetwork.py | |
parent | 2d22d72cdaaf2b78b2986b841d478c11ac855dd2 (diff) | |
download | stable-diffusion-webui-gfx803-5b57f61ba47f8b11d19a5b46e7fb5a52458abae5.tar.gz stable-diffusion-webui-gfx803-5b57f61ba47f8b11d19a5b46e7fb5a52458abae5.tar.bz2 stable-diffusion-webui-gfx803-5b57f61ba47f8b11d19a5b46e7fb5a52458abae5.zip |
fix pin_memory with different latent sampling method
Diffstat (limited to 'modules/hypernetworks/hypernetwork.py')
-rw-r--r-- | modules/hypernetworks/hypernetwork.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/modules/hypernetworks/hypernetwork.py b/modules/hypernetworks/hypernetwork.py index 3d3301b0..0128419b 100644 --- a/modules/hypernetworks/hypernetwork.py +++ b/modules/hypernetworks/hypernetwork.py @@ -416,7 +416,10 @@ def train_hypernetwork(hypernetwork_name, learn_rate, batch_size, gradient_step, pin_memory = shared.opts.pin_memory
ds = modules.textual_inversion.dataset.PersonalizedBase(data_root=data_root, width=training_width, height=training_height, repeats=shared.opts.training_image_repeats_per_epoch, placeholder_token=hypernetwork_name, model=shared.sd_model, cond_model=shared.sd_model.cond_stage_model, device=devices.device, template_file=template_file, include_cond=True, batch_size=batch_size, gradient_step=gradient_step, shuffle_tags=shuffle_tags, tag_drop_out=tag_drop_out, latent_sampling_method=latent_sampling_method)
- dl = modules.textual_inversion.dataset.PersonalizedDataLoader(ds, batch_size=ds.batch_size, pin_memory=pin_memory)
+
+ latent_sampling_method = ds.latent_sampling_method
+
+ dl = modules.textual_inversion.dataset.PersonalizedDataLoader(ds, latent_sampling_method=latent_sampling_method, batch_size=ds.batch_size, pin_memory=pin_memory)
if unload:
shared.sd_model.cond_stage_model.to(devices.cpu)
|