mirror of
https://github.com/Sygil-Dev/sygil-webui.git
synced 2024-12-14 14:05:36 +03:00
Fixed errors when post-processing models aren't installed
Fixes #1522, #1604
This commit is contained in:
parent
d8e61a5cd3
commit
10b66cc2b9
@ -545,7 +545,9 @@ def layout():
|
||||
upscaling_method_list.append("LDSR")
|
||||
|
||||
st.session_state["upscaling_method"] = st.selectbox("Upscaling Method", upscaling_method_list,
|
||||
index=upscaling_method_list.index(st.session_state['defaults'].general.upscaling_method))
|
||||
index=upscaling_method_list.index(st.session_state['defaults'].general.upscaling_method)
|
||||
if st.session_state['defaults'].general.upscaling_method in upscaling_method_list
|
||||
else 0)
|
||||
|
||||
if st.session_state["RealESRGAN_available"]:
|
||||
with st.expander("RealESRGAN"):
|
||||
|
@ -2010,6 +2010,8 @@ def GFPGAN_available():
|
||||
st.session_state["GFPGAN_available"] = True
|
||||
else:
|
||||
st.session_state["GFPGAN_available"] = False
|
||||
st.session_state["use_GFPGAN"] = False
|
||||
st.session_state["GFPGAN_model"] = "GFPGANv1.4"
|
||||
|
||||
#
|
||||
def RealESRGAN_available():
|
||||
@ -2028,6 +2030,8 @@ def RealESRGAN_available():
|
||||
st.session_state["RealESRGAN_available"] = True
|
||||
else:
|
||||
st.session_state["RealESRGAN_available"] = False
|
||||
st.session_state["use_RealESRGAN"] = False
|
||||
st.session_state["RealESRGAN_model"] = "RealESRGAN_x4plus"
|
||||
#
|
||||
def LDSR_available():
|
||||
#with server_state_lock["RealESRGAN_models"]:
|
||||
@ -2048,6 +2052,8 @@ def LDSR_available():
|
||||
st.session_state["LDSR_available"] = True
|
||||
else:
|
||||
st.session_state["LDSR_available"] = False
|
||||
st.session_state["use_LDSR"] = False
|
||||
st.session_state["LDSR_model"] = "model"
|
||||
|
||||
|
||||
|
||||
|
@ -570,7 +570,9 @@ def layout():
|
||||
|
||||
#print (st.session_state["RealESRGAN_available"])
|
||||
st.session_state["upscaling_method"] = st.selectbox("Upscaling Method", upscaling_method_list,
|
||||
index=upscaling_method_list.index(str(st.session_state['defaults'].general.upscaling_method)))
|
||||
index=upscaling_method_list.index(st.session_state['defaults'].general.upscaling_method)
|
||||
if st.session_state['defaults'].general.upscaling_method in upscaling_method_list
|
||||
else 0)
|
||||
|
||||
if st.session_state["RealESRGAN_available"]:
|
||||
with st.expander("RealESRGAN"):
|
||||
|
@ -1788,7 +1788,9 @@ def layout():
|
||||
upscaling_method_list.append("LDSR")
|
||||
|
||||
st.session_state["upscaling_method"] = st.selectbox("Upscaling Method", upscaling_method_list,
|
||||
index=upscaling_method_list.index(st.session_state['defaults'].general.upscaling_method))
|
||||
index=upscaling_method_list.index(st.session_state['defaults'].general.upscaling_method)
|
||||
if st.session_state['defaults'].general.upscaling_method in upscaling_method_list
|
||||
else 0)
|
||||
|
||||
if st.session_state["RealESRGAN_available"]:
|
||||
with st.expander("RealESRGAN"):
|
||||
|
Loading…
Reference in New Issue
Block a user