feat: add workflows table & service

This commit is contained in:
psychedelicious
2023-10-17 17:02:15 +11:00
parent 9195c8c957
commit c2da74c587
11 changed files with 235 additions and 33 deletions

View File

@ -0,0 +1,20 @@
from fastapi import APIRouter, Body, Path
from invokeai.app.api.dependencies import ApiDependencies
from invokeai.app.services.workflow_records.workflow_records_common import WorkflowField
workflows_router = APIRouter(prefix="/v1/workflows", tags=["workflows"])
@workflows_router.get(
"/i/{workflow_id}",
operation_id="get_workflow",
responses={
200: {"model": WorkflowField},
},
)
async def get_workflow(
workflow_id: str = Path(description="The workflow to get"),
) -> WorkflowField:
"""Gets a workflow"""
return ApiDependencies.invoker.services.workflow_records.get(workflow_id)