From 8e143d3545140b8f0398dfbe1d95a0a766019283 Mon Sep 17 00:00:00 2001 From: Chenlei Hu Date: Sun, 25 Jun 2023 00:45:53 -0400 Subject: [PATCH] Set default cache size for first time installation (#1706) --- scripts/global_state.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/global_state.py b/scripts/global_state.py index 42b3b4437..2537ec736 100644 --- a/scripts/global_state.py +++ b/scripts/global_state.py @@ -20,7 +20,7 @@ def cache_preprocessors(preprocessor_modules: Dict[str, Callable]) -> Dict[str, Callable]: """ We want to share the preprocessor results in a single big cache, instead of a small cache for each preprocessor function. """ - CACHE_SIZE = shared.cmd_opts.controlnet_preprocessor_cache_size + CACHE_SIZE = getattr(shared.cmd_opts, "controlnet_preprocessor_cache_size", 0) # Set CACHE_SIZE = 0 will completely remove the caching layer. This can be # helpful when debugging preprocessor code.