aboutsummaryrefslogtreecommitdiff
path: root/modules/ui.py
diff options
context:
space:
mode:
authorChris OBryan <13701027+cobryan05@users.noreply.github.com>2022-10-28 16:11:16 -0500
committerChris OBryan <13701027+cobryan05@users.noreply.github.com>2022-10-28 16:14:21 -0500
commit1f1b327959b546b5e6f995905a1699c5fe4a0c35 (patch)
treed11af8b01a05319f4cc2b6480c3b1263b9ed4b7a /modules/ui.py
parentbde4731f1d3ddf30c46f86c9f6e71e6c0644089d (diff)
extras: Make image cache LRU
This changes the extras image cache into a Least-Recently-Used cache. This allows more experimentation with different upscalers without missing the cache. Max cache size is increased to 5 and is cleared on source image update.
Diffstat (limited to 'modules/ui.py')
-rw-r--r--modules/ui.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/modules/ui.py b/modules/ui.py
index 16b6ac49..b7c36c55 100644
--- a/modules/ui.py
+++ b/modules/ui.py
@@ -1178,6 +1178,11 @@ def create_ui(wrap_gradio_gpu_call):
outputs=[init_img_with_mask],
)
+ extras_image.change(
+ fn=modules.extras.clear_cache,
+ inputs=[], outputs=[]
+ )
+
with gr.Blocks(analytics_enabled=False) as pnginfo_interface:
with gr.Row().style(equal_height=False):
with gr.Column(variant='panel'):