aboutsummaryrefslogtreecommitdiffstats
path: root/modules/ui_extra_networks_checkpoints.py
diff options
context:
space:
mode:
authorw-e-w <40751091+w-e-w@users.noreply.github.com>2023-09-03 02:56:02 +0000
committerw-e-w <40751091+w-e-w@users.noreply.github.com>2023-09-03 02:56:02 +0000
commitaab385d01b4311726127397552d791f4d71b7147 (patch)
tree0884cec336426d40b7fae698007428f55a9008d3 /modules/ui_extra_networks_checkpoints.py
parentd39440bfb9d3b20338fc23a78e6655b1e2f7c1d5 (diff)
downloadstable-diffusion-webui-gfx803-aab385d01b4311726127397552d791f4d71b7147.tar.gz
stable-diffusion-webui-gfx803-aab385d01b4311726127397552d791f4d71b7147.tar.bz2
stable-diffusion-webui-gfx803-aab385d01b4311726127397552d791f4d71b7147.zip
thread safe extra network list_items
Diffstat (limited to 'modules/ui_extra_networks_checkpoints.py')
-rw-r--r--modules/ui_extra_networks_checkpoints.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/modules/ui_extra_networks_checkpoints.py b/modules/ui_extra_networks_checkpoints.py
index ca6c2607..2753214f 100644
--- a/modules/ui_extra_networks_checkpoints.py
+++ b/modules/ui_extra_networks_checkpoints.py
@@ -30,9 +30,9 @@ class ExtraNetworksPageCheckpoints(ui_extra_networks.ExtraNetworksPage):
}
def list_items(self):
- names = list(sd_models.checkpoints_list)
- for index, name in enumerate(names):
- yield self.create_item(name, index)
+ with self.thread_lock:
+ for index, name in enumerate(sd_models.checkpoints_list):
+ yield self.create_item(name, index)
def allowed_directories_for_previews(self):
return [v for v in [shared.cmd_opts.ckpt_dir, sd_models.model_path] if v is not None]