From 0cf3d1b0ef85440fd5b0579db791bc78d1365cf2 Mon Sep 17 00:00:00 2001 From: Chris Heald Date: Fri, 16 Sep 2022 16:29:10 -0700 Subject: [PATCH] When early terminating, generation_callback gets invoked but st.session_state is empty. When this happens, just bail. --- scripts/sd_utils.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/sd_utils.py b/scripts/sd_utils.py index eb35628..a5d8aa1 100644 --- a/scripts/sd_utils.py +++ b/scripts/sd_utils.py @@ -787,6 +787,8 @@ def ModelLoader(models,load=False,unload=False,imgproc_realesrgan_model_name='Re # @retry(tries=5) def generation_callback(img, i=0): + if "update_preview_frequency" not in st.session_state: + return try: if i == 0: