mirror of
https://github.com/sd-webui/stable-diffusion-webui.git
synced 2024-12-15 07:12:58 +03:00
Made the defaults settings from the config file be stored inside st.session_state to avoid loading it multiple times when calling the "sd_utils.py" file from other modules.
This commit is contained in:
parent
ef6b39ab6d
commit
1afc89e0d1
1312
scripts/DeforumStableDiffusion.py
Normal file
1312
scripts/DeforumStableDiffusion.py
Normal file
File diff suppressed because it is too large
Load Diff
@ -57,10 +57,14 @@ except:
|
||||
# remove some annoying deprecation warnings that show every now and then.
|
||||
warnings.filterwarnings("ignore", category=DeprecationWarning)
|
||||
|
||||
defaults = OmegaConf.load("configs/webui/webui_streamlit.yaml")
|
||||
if (os.path.exists("configs/webui/userconfig_streamlit.yaml")):
|
||||
user_defaults = OmegaConf.load("configs/webui/userconfig_streamlit.yaml");
|
||||
defaults = OmegaConf.merge(defaults, user_defaults)
|
||||
if "defaults" not in st.session_state:
|
||||
st.session_state["defaults"] = OmegaConf.load(os.path.join("configs","webui", "webui_streamlit.yaml"))
|
||||
|
||||
if (os.path.exists(os.path.join("configs","webui", "userconfig_streamlit.yaml"))):
|
||||
user_defaults = OmegaConf.load(os.path.join("configs","webui", "userconfig_streamlit.yaml"));
|
||||
st.session_state["defaults"] = OmegaConf.merge(st.session_state["defaults"], user_defaults)
|
||||
|
||||
defaults = st.session_state["defaults"]
|
||||
|
||||
# this is a fix for Windows users. Without it, javascript files will be served with text/html content-type and the bowser will not show any UI
|
||||
mimetypes.init()
|
||||
|
Loading…
Reference in New Issue
Block a user