refactor: 更新ComfyWorkflow类的构造函数,简化工作流数据处理逻辑,并在相关API调用中应用新结构

This commit is contained in:
iHeyTang
2025-08-21 14:59:43 +08:00
parent 3c4c689532
commit fc265570d3
6 changed files with 66 additions and 51 deletions

View File

@@ -219,11 +219,11 @@ async def update_workflow_run_node_status(
await session.commit()
async def get_workflow_run(workflow_run_id: str) -> Optional[dict]:
async def get_workflow_run(workflow_run_id: str) -> Optional[WorkflowRun]:
"""获取工作流运行记录"""
async with AsyncSessionLocal() as session:
workflow_run = await session.get(WorkflowRun, workflow_run_id)
return workflow_run.to_dict() if workflow_run else None
return workflow_run
async def get_workflow_run_nodes(workflow_run_id: str) -> List[dict]: