mirror of
https://github.com/sd-webui/stable-diffusion-webui.git
synced 2024-12-14 06:35:14 +03:00
Fixed missing keys on first run, it seems related to server_state doing a rerun in the background on first run which changes the first session_state initialization, this causes it to be empty until the second run.
This commit is contained in:
parent
e975aac7a4
commit
2a078d5657
@ -99,7 +99,10 @@ st.session_state["defaults"] = OmegaConf.load("configs/webui/webui_streamlit.yam
|
||||
|
||||
if (os.path.exists("configs/webui/userconfig_streamlit.yaml")):
|
||||
user_defaults = OmegaConf.load("configs/webui/userconfig_streamlit.yaml")
|
||||
st.session_state["defaults"] = OmegaConf.merge(st.session_state["defaults"], user_defaults)
|
||||
try:
|
||||
st.session_state["defaults"] = OmegaConf.merge(st.session_state["defaults"], user_defaults)
|
||||
except KeyError:
|
||||
st.experimental_rerun()
|
||||
else:
|
||||
OmegaConf.save(config=st.session_state.defaults, f="configs/webui/userconfig_streamlit.yaml")
|
||||
loaded = OmegaConf.load("configs/webui/userconfig_streamlit.yaml")
|
||||
|
@ -124,7 +124,10 @@ def layout():
|
||||
if tabs =='Stable Diffusion':
|
||||
# set the page url and title
|
||||
st.experimental_set_query_params(page='stable-diffusion')
|
||||
set_page_title("Stable Diffusion Playground")
|
||||
try:
|
||||
set_page_title("Stable Diffusion Playground")
|
||||
except NameError:
|
||||
st.experimental_rerun()
|
||||
|
||||
txt2img_tab, img2img_tab, txt2vid_tab, img2txt_tab, concept_library_tab = st.tabs(["Text-to-Image", "Image-to-Image",
|
||||
"Text-to-Video", "Image-To-Text",
|
||||
|
Loading…
Reference in New Issue
Block a user