优化数字人功能,添加工作流配置初始化逻辑,确保源选择时变量始终定义

This commit is contained in:
puke committed 2026-01-29 19:19:46 +08:00
1 parent 9ab268b0ee
commit 75999d816a
1 file changed
+15 -10
+15 -10
View File
@@ -151,27 +151,32 @@ class DigitalHumanPipelineUI(PipelineUI):
label_visibility="collapsed"
)
# Initialize workflow_config with default value based on source selection
# This ensures the variable is always defined even if the backend is not configured
if source == "runninghub":
workflow_config = {
"first_workflow_path": "workflows/runninghub/digital_image.json",
"second_workflow_path": "workflows/runninghub/digital_combination.json",
"third_workflow_path": "workflows/runninghub/digital_customize.json"
}
else:
workflow_config = {
"first_workflow_path": "workflows/selfhost/digital_image.json",
"second_workflow_path": "workflows/selfhost/digital_combination.json",
"third_workflow_path": "workflows/selfhost/digital_customize.json"
}
# Show hint based on selection
if source == "runninghub":
if not has_runninghub:
st.warning(tr("asset_based.source.runninghub_not_configured"))
else:
st.info(tr("asset_based.source.runninghub_hint"))
workflow_config = {
"first_workflow_path": "workflows/runninghub/digital_image.json",
"second_workflow_path": "workflows/runninghub/digital_combination.json",
"third_workflow_path": "workflows/runninghub/digital_customize.json"
}
else:
if not has_selfhost:
st.warning(tr("asset_based.source.selfhost_not_configured"))
else:
st.info(tr("asset_based.source.selfhost_hint"))
workflow_config = {
"first_workflow_path": "workflows/selfhost/digital_image.json",
"second_workflow_path": "workflows/selfhost/digital_combination.json",
"third_workflow_path": "workflows/selfhost/digital_customize.json"
}
# Check and warn for selfhost workflows (auto popup if not confirmed)
# Warn for the first workflow as representative
# TODO: need to check if the workflow is valid