2023-10-17 06:23:10 +00:00
|
|
|
from fastapi import APIRouter, Path
|
2023-10-17 06:02:15 +00:00
|
|
|
|
|
|
|
from invokeai.app.api.dependencies import ApiDependencies
|
2023-10-17 08:42:02 +00:00
|
|
|
from invokeai.app.invocations.baseinvocation import WorkflowField
|
2023-10-17 06:02:15 +00:00
|
|
|
|
|
|
|
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)
|