Skip to content
This repository has been archived by the owner on Aug 11, 2024. It is now read-only.

Commit

Permalink
fix: publish model info optional
Browse files Browse the repository at this point in the history
  • Loading branch information
xingren23 committed Dec 17, 2023
1 parent 639e92c commit 4b169ea
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions modules/publish_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ def publish_app_ui(app, cookies):
st.session_state['publish_invalid_node'] = True

# parse app models
with st.expander("Parse comfyui node info", expanded=True):
with st.expander("Parse comfyui model info", expanded=True):
for node_id in api_data_json:
inputs = api_data_json[node_id]['inputs']
class_type = api_data_json[node_id]['class_type']
Expand All @@ -168,7 +168,13 @@ def publish_app_ui(app, cookies):
try:
if isinstance(value, str):
if is_comfyui_model_path(value):
model_options = endpoint_object_info[class_type]['input']['required'][key][0]
if key in endpoint_object_info[class_type]['input']['required']:
model_options = endpoint_object_info[class_type]['input']['required'][key][0]
elif key in endpoint_object_info[class_type]['input']['optional']:
model_options = endpoint_object_info[class_type]['input']['optional'][key][0]
else:
model_options = []

if value not in model_options:
st.write(f":red[Invalid model path\, {value}]")
st.session_state['publish_invalid_node'] = True
Expand Down

0 comments on commit 4b169ea

Please sign in to comment.