{ "openapi": "3.1.0", "info": { "title": "ESD 1.5.0", "description": "", "version": "1.0.0" }, "tags": [ { "name": "健康检查(Ping)" }, { "name": "角色(Roles)" }, { "name": "用户(Users)" }, { "name": "模型文件(Checkpoints)" }, { "name": "推理端点(Endpoints)" }, { "name": "推理(Inferences)" } ], "paths": { "/ping": { "get": { "summary": "健康检查 (Ping)", "deprecated": false, "description": "测试客户端是否可以连接到 API,并检查配置是否正确。\nTest whether client can connect to api and check the API_TOKEN is correct.", "operationId": "TestConnection", "tags": [ "健康检查(Ping)", "Test" ], "parameters": [], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string" }, "statusCode": { "type": "integer" } }, "required": [ "message", "statusCode" ] }, "examples": { "1": { "summary": "Success", "value": { "message": "pong", "statusCode": 200 } } } } } } }, "security": [ { "apikey-header-x-api-key": [] } ] } }, "/roles": { "get": { "summary": "获取角色列表 ListRoles", "deprecated": false, "description": "获取角色列表\nList all roles", "operationId": "ListRoles", "tags": [ "角色(Roles)", "Role" ], "parameters": [ { "name": "role", "in": "query", "description": "角色名(Role Name)", "required": false, "example": "byoc", "schema": { "type": "string" } }, { "name": "username", "in": "header", "description": "", "required": true, "example": "{{bearerToken}}", "schema": { "type": "string" } } ], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "statusCode": { "type": "integer" }, "data": { "type": "object", "properties": { "roles": { "type": "array", "items": { "type": "object", "properties": { "role_name": { "type": "string" }, "creator": { "type": "string" }, "permissions": { "type": "array", "items": { "type": "string" } } }, "required": [ "role_name", "creator", "permissions" ] } }, "previous_evaluated_key": { "type": "string" }, "last_evaluated_key": { "type": "null" } }, "required": [ "roles", "previous_evaluated_key", "last_evaluated_key" ] }, "message": { "type": "string" } }, "required": [ "statusCode", "data", "message" ] }, "examples": { "1": { "summary": "Success", "value": { "statusCode": 200, "data": { "roles": [ { "role_name": "IT Operator", "creator": "admin", "permissions": [ "train:all", "checkpoint:all", "inference:all", "sagemaker_endpoint:all", "user:all", "role:all" ] }, { "role_name": "byoc", "creator": "admin", "permissions": [ "sagemaker_endpoint:all" ] }, { "role_name": "new_role_name", "creator": "admin", "permissions": [ "train:all", "checkpoint:all" ] } ], "previous_evaluated_key": "not_applicable", "last_evaluated_key": null }, "message": "OK" } } } } } } }, "security": [ { "apikey-header-x-api-key": [] } ] }, "delete": { "summary": "删除角色 DeleteRoles", "deprecated": false, "description": "删除角色\nDelete roles", "operationId": "ListRoles", "tags": [ "角色(Roles)", "Role" ], "parameters": [ { "name": "username", "in": "header", "description": "", "required": true, "example": "{{userName}}", "schema": { "type": "string" } } ], "requestBody": { "content": { "application/json": { "schema": { "type": "object", "properties": { "role_name_list": { "type": "array", "items": { "type": "string", "description": "角色(Role Name)" }, "description": "角色列表(Role Name List)" } }, "required": [ "role_name_list" ] }, "example": { "role_name_list": [ "role_name_1" ] } } } }, "responses": { "204": { "description": "No Content", "content": { "application/json": { "schema": { "type": "object", "properties": {} } } } } }, "security": [ { "apikey-header-x-api-key": [] } ] }, "post": { "summary": "创建角色 CreateRole", "deprecated": false, "description": "创建新角色\nCreate a new role\n", "operationId": "CreateRole", "tags": [ "角色(Roles)", "Role" ], "parameters": [], "requestBody": { "content": { "application/json": { "schema": { "type": "object", "properties": { "role_name": { "type": "string", "description": "角色名(Role Name)" }, "permissions": { "type": "array", "items": { "type": "string", "description": "- train:all\n- checkpoint:all\n- inference:all\n- sagemaker_endpoint:all\n- user:all\n- role:all" }, "description": "权限列表(Permissions)" } }, "required": [ "role_name", "permissions" ] }, "example": { "role_name": "new_role_name", "permissions": [ "train:all", "checkpoint:all" ] } } } }, "responses": { "201": { "description": "Created", "content": { "application/json": { "schema": { "type": "object", "properties": { "statusCode": { "type": "integer" }, "message": { "type": "string" } }, "required": [ "statusCode", "message" ] }, "examples": { "1": { "summary": "Success", "value": { "statusCode": 201, "message": "role created" } } } } } } }, "security": [ { "apikey-header-x-api-key": [] } ] } }, "/users": { "get": { "summary": "获取用户列表 ListUsers", "deprecated": false, "description": "获取用户列表\nList all users", "operationId": "ListUsers", "tags": [ "用户(Users)", "User" ], "parameters": [ { "name": "username", "in": "header", "description": "", "required": true, "example": "{{bearerToken}}", "schema": { "type": "string" } } ], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "statusCode": { "type": "integer" }, "data": { "type": "object", "properties": { "users": { "type": "array", "items": { "type": "object", "properties": { "username": { "type": "string" }, "roles": { "type": "array", "items": { "type": "string" } }, "creator": { "type": "string" }, "permissions": { "type": "array", "items": { "type": "string" } }, "password": { "type": "string" } }, "required": [ "username", "roles", "creator", "permissions", "password" ] } }, "previous_evaluated_key": { "type": "string" }, "last_evaluated_key": { "type": "string" } }, "required": [ "users", "previous_evaluated_key", "last_evaluated_key" ] }, "message": { "type": "string" } }, "required": [ "statusCode", "data", "message" ] }, "examples": { "1": { "summary": "Success", "value": { "statusCode": 200, "data": { "users": [ { "username": "admin", "roles": [ "IT Operator", "byoc" ], "creator": "admin", "permissions": [ "checkpoint:all", "inference:all", "role:all", "sagemaker_endpoint:all", "train:all", "user:all" ], "password": "********" }, { "username": "username", "roles": [ "IT Operator" ], "creator": "admin", "permissions": [ "checkpoint:all", "inference:all", "role:all", "sagemaker_endpoint:all", "train:all", "user:all" ], "password": "********" } ], "previous_evaluated_key": "not_applicable", "last_evaluated_key": "not_applicable" }, "message": "OK" } } } } } } }, "security": [ { "apikey-header-x-api-key": [] } ] }, "post": { "summary": "创建用户 CreateUser", "deprecated": false, "description": "创建新用户\nCreate a new user\n", "operationId": "CreateUser", "tags": [ "用户(Users)", "User" ], "parameters": [], "requestBody": { "content": { "application/json": { "schema": { "type": "object", "properties": { "username": { "type": "string", "description": "用户名(User Name)" }, "roles": { "type": "array", "items": { "type": "string", "description": "角色名" }, "description": "角色列表(Roles)" }, "permissions": { "type": "array", "items": { "type": "string", "description": "权限" }, "description": "权限列表(Permissions)" }, "password": { "type": "string", "description": "密码(Password)" } }, "required": [ "username", "roles", "permissions", "password" ] }, "example": { "username": "username", "password": "XXXXXXXXXXXXX", "roles": [ "IT Operator", "Designer" ] } } } }, "responses": { "201": { "description": "Created", "content": { "application/json": { "schema": { "type": "object", "properties": { "statusCode": { "type": "integer" }, "message": { "type": "string" } }, "required": [ "statusCode", "message" ] }, "examples": { "1": { "summary": "Success", "value": { "statusCode": 201, "message": "Created" } } } } } } }, "security": [ { "apikey-header-x-api-key": [] } ] }, "delete": { "summary": "删除用户 DeleteUsers", "deprecated": false, "description": "删除用户\nDelete users\n", "operationId": "DeleteUser", "tags": [ "用户(Users)", "User" ], "parameters": [ { "name": "username", "in": "header", "description": "", "required": true, "example": "{{userName}}", "schema": { "type": "string" } } ], "requestBody": { "content": { "application/json": { "schema": { "type": "object", "properties": { "user_name_list": { "type": "array", "items": { "type": "string", "description": "用户名(User Name)" }, "description": "用户名列表(User Name List)" } }, "required": [ "user_name_list" ] } } } }, "responses": { "204": { "description": "No Content", "content": { "application/json": { "schema": { "type": "object", "properties": {} } } } } }, "security": [ { "apikey-header-x-api-key": [] } ] } }, "/checkpoints": { "post": { "summary": "通过URL上传模型文件 CreateCheckpoint", "deprecated": false, "description": "通过URL上传模型文件\nCreate a new Checkpoint by URL\n", "operationId": "CreateCheckpoint", "tags": [ "模型文件(Checkpoints)", "Checkpoint" ], "parameters": [], "requestBody": { "content": { "application/json": { "schema": { "type": "object", "properties": { "checkpoint_type": { "type": "string", "description": "模型文件类型(Checkpoint Type)" }, "params": { "type": "object", "properties": { "message": { "type": "string", "description": "模型文件信息(Message)" } }, "required": [ "message" ], "description": "参数(Params)" }, "urls": { "type": "array", "items": { "type": "string" }, "description": "URLs" } }, "required": [ "checkpoint_type", "params", "urls" ] }, "example": { "checkpoint_type": "ControlNet", "params": { "message": "placeholder for chkpts upload test" }, "urls": [ "https://huggingface.co/lllyasviel/ControlNet-v1-1/resolve/main/control_v11p_sd15_canny.pth" ] } } } }, "responses": { "202": { "description": "Accepted", "content": { "application/json": { "schema": { "type": "object", "properties": { "statusCode": { "type": "integer" }, "data": { "type": "object", "properties": { "checkpoint": { "type": "object", "properties": { "id": { "type": "string" }, "type": { "type": "string" }, "s3_location": { "type": "string" }, "status": { "type": "string" }, "params": { "type": "object", "properties": { "message": { "type": "string" }, "creator": { "type": "string" }, "created": { "type": "string" }, "multipart_upload": { "type": "object", "properties": { "v1-5-pruned-emaonly.safetensors2": { "type": "object", "properties": { "upload_id": { "type": "string" }, "bucket": { "type": "string" }, "key": { "type": "string" } }, "required": [ "upload_id", "bucket", "key" ] } }, "required": [ "v1-5-pruned-emaonly.safetensors2" ] } }, "required": [ "message", "creator", "created", "multipart_upload" ] } }, "required": [ "id", "type", "s3_location", "status", "params" ] }, "s3PresignUrl": { "type": "object", "properties": { "v1-5-pruned-emaonly.safetensors2": { "type": "array", "items": { "type": "string" } } }, "required": [ "v1-5-pruned-emaonly.safetensors2" ] } }, "required": [ "checkpoint", "s3PresignUrl" ] }, "message": { "type": "string" } }, "required": [ "statusCode", "data", "message" ] }, "examples": { "1": { "summary": "Success", "value": { "statusCode": 202, "message": "Checkpoint creation in progress, please check later" } } } } } } }, "security": [ { "apikey-header-x-api-key": [] } ] }, "get": { "summary": "获取模型文件列表 ListCheckpoints", "deprecated": false, "description": "获取模型文件列表\nLists all checkpoints", "operationId": "ListCheckpoints", "tags": [ "模型文件(Checkpoints)", "Checkpoint" ], "parameters": [ { "name": "status[]", "in": "query", "description": "状态列表(Status)", "required": false, "example": "Active", "schema": { "type": "string" } }, { "name": "username", "in": "query", "description": "用户名(User Name)", "required": false, "example": "admin", "schema": { "type": "string" } }, { "name": "username", "in": "header", "description": "", "required": true, "example": "{{bearerToken}}", "schema": { "type": "string" } } ], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "statusCode": { "type": "integer" }, "data": { "type": "object", "properties": { "page": { "type": "integer" }, "per_page": { "type": "integer" }, "pages": { "type": "integer" }, "total": { "type": "integer" }, "checkpoints": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "s3Location": { "type": "string" }, "type": { "type": "string" }, "status": { "type": "string" }, "name": { "type": "array", "items": { "type": "string" } }, "created": { "type": "string" }, "params": { "type": "object", "properties": { "creator": { "type": "string" }, "multipart_upload": { "type": "object", "properties": { "control_v11p_sd15_canny.pth": { "type": "object", "properties": { "bucket": { "type": "string" }, "upload_id": { "type": "string" }, "key": { "type": "string" } }, "required": [ "bucket", "upload_id", "key" ] }, "LahCuteCartoonSDXL_alpha.safetensors": { "type": "object", "properties": { "bucket": { "type": "string" }, "upload_id": { "type": "string" }, "key": { "type": "string" } }, "required": [ "bucket", "upload_id", "key" ] }, "nendoroid_xl_v7.safetensors": { "type": "object", "properties": { "bucket": { "type": "string" }, "upload_id": { "type": "string" }, "key": { "type": "string" } }, "required": [ "bucket", "upload_id", "key" ] }, "control_v11p_sd15_openpose.pth": { "type": "object", "properties": { "bucket": { "type": "string" }, "upload_id": { "type": "string" }, "key": { "type": "string" } }, "required": [ "bucket", "upload_id", "key" ] }, "v1-5-pruned-emaonly.safetensors": { "type": "object", "properties": { "bucket": { "type": "string" }, "upload_id": { "type": "string" }, "key": { "type": "string" } }, "required": [ "bucket", "upload_id", "key" ] } }, "required": [ "v1-5-pruned-emaonly.safetensors" ] }, "message": { "type": "string" }, "created": { "type": "string" } }, "required": [ "creator", "multipart_upload", "message", "created" ] }, "allowed_roles_or_users": { "type": "array", "items": { "type": "string" } } }, "required": [ "id", "s3Location", "type", "status", "name", "created", "params", "allowed_roles_or_users" ] } } }, "required": [ "page", "per_page", "pages", "total", "checkpoints" ] }, "message": { "type": "string" } }, "required": [ "statusCode", "data", "message" ] }, "examples": { "1": { "summary": "Success", "value": { "statusCode": 200, "data": { "page": 1, "per_page": 5, "pages": 2, "total": 5, "checkpoints": [ { "id": "7e759754-7e29-42c5-8d52-f8dca53c9c8a", "s3Location": "s3://xxxx/ControlNet/checkpoint/custom/7e759754-7e29-42c5-8d52-f8dca53c9c8a", "type": "ControlNet", "status": "Active", "name": [ "control_v11p_sd15_canny.pth" ], "created": "1706257286.187403", "params": { "creator": "admin", "multipart_upload": { "control_v11p_sd15_canny.pth": { "bucket": "xxxx", "upload_id": "soO9TZvZJq5Ksa_VPfFeMVwyyfCuETs_8jV0FxE7FmWdAEOb70nrHdMOlmC4XoUCktgKbj9vmqE4h0tpz1U1zVUQvAVLdEKz.6nVQ76AqdfMdeM7Ggdj2LsKlJLbCal26WxjXlS9a_eGYDlxB3yyuT2NDzT2348BZtF6UOXwsi6uVjpaak4YGi92.xKtx.OR9gE21o.ABxcZz8QDk7ry.NpIbXnBsxOs8i45L055OeY-", "key": "ControlNet/checkpoint/custom/7e759754-7e29-42c5-8d52-f8dca53c9c8a/control_v11p_sd15_canny.pth" } }, "message": "placeholder for chkpts upload test", "created": "2024-01-26 08:21:26.140570" }, "allowed_roles_or_users": [ "IT Operator", "byoc" ] }, { "id": "d98471d5-d522-46e0-913c-3c169084435c", "s3Location": "s3://xxxx/Stable-diffusion/checkpoint/custom/d98471d5-d522-46e0-913c-3c169084435c", "type": "Stable-diffusion", "status": "Active", "name": [ "LahCuteCartoonSDXL_alpha.safetensors" ], "created": "1706257241.116612", "params": { "creator": "admin", "multipart_upload": { "LahCuteCartoonSDXL_alpha.safetensors": { "bucket": "xxxx", "upload_id": "e9j98hWLC40yFYdDPHkqnzO0c0FJsrY9FcOYL4P5o_ZsajgEzXtfjJ5Auxls4Dfndz9MwwqSP6LBaaa_c4WXGhidalIVktTuZ6lDo0yKXIh93mklE3k1AtCYgoKPvAi877RzemvaFM3G4.QIK.eenrBpyk.SBGguGaTd_m_FlrHxa8LewTjubZyuF5cvIsH_KBgsbLSNVcPP4S2qPVvSeBwy73TYYnKu_Uw74K0Sq9U-", "key": "Stable-diffusion/checkpoint/custom/d98471d5-d522-46e0-913c-3c169084435c/LahCuteCartoonSDXL_alpha.safetensors" } }, "message": "placeholder for chkpts upload test", "created": "2024-01-26 08:20:41.066635" }, "allowed_roles_or_users": [ "IT Operator", "byoc" ] }, { "id": "86068f5d-7cfa-416a-af66-0e78b7e1d8f4", "s3Location": "s3://xxxx/Lora/checkpoint/custom/86068f5d-7cfa-416a-af66-0e78b7e1d8f4", "type": "Lora", "status": "Active", "name": [ "nendoroid_xl_v7.safetensors" ], "created": "1706257284.302761", "params": { "creator": "admin", "multipart_upload": { "nendoroid_xl_v7.safetensors": { "bucket": "xxxx", "upload_id": "3XvVonX27A4nn9MeC2ekzXkA2hlA6b.ENNEYh8dXaoH.srbhs.l3KJvwFdV5Rhko8UYwaFbMilPGLAIbo3nAI03YJAbtfTDa3UGnO82mlx7Vd7Ds1Ccief2IvQ8ZjOit8JchGtmsGa0.W66HVruzSQdRx9IAo58teX08IlpH5efBhA9xOwHGDfyycTYIrAP4xOQUXBmo93xtN.oaTZccHH0xFjwbOP1jLrZ_Jsi28GY-", "key": "Lora/checkpoint/custom/86068f5d-7cfa-416a-af66-0e78b7e1d8f4/nendoroid_xl_v7.safetensors" } }, "message": "placeholder for chkpts upload test", "created": "2024-01-26 08:21:24.262763" }, "allowed_roles_or_users": [ "IT Operator", "byoc" ] }, { "id": "83983f01-f71e-429c-83f0-9b9d5721b3c0", "s3Location": "s3://xxxx/ControlNet/checkpoint/custom/83983f01-f71e-429c-83f0-9b9d5721b3c0", "type": "ControlNet", "status": "Active", "name": [ "control_v11p_sd15_openpose.pth" ], "created": "1706257297.493205", "params": { "creator": "admin", "multipart_upload": { "control_v11p_sd15_openpose.pth": { "bucket": "xxxx", "upload_id": "fad698w0tlzK4y6VkIHYLu6wengx5dCLo2HGb5LfHUnbffPbbaBDR9RsY7girPXOOi1Lk.nFzZzN8F5jR4quldQlU8GuAu5EJ4tC_CHym4cAtUeitDjQp4pHe30Qqf56OhPL_IXctwh6GhTqWll0VmUAnwazAaRXxhe7qYbA6TWsbUaRUht5gbrVc4MqIfMRbNfgetprwW3K455GM9fjLQYbuPMwW1eGjOk_oDfSLGQ-", "key": "ControlNet/checkpoint/custom/83983f01-f71e-429c-83f0-9b9d5721b3c0/control_v11p_sd15_openpose.pth" } }, "message": "placeholder for chkpts upload test", "created": "2024-01-26 08:21:37.448222" }, "allowed_roles_or_users": [ "IT Operator", "byoc" ] }, { "id": "32a7af23-3763-4289-a6af-2156a2331878", "s3Location": "s3://xxxx/Stable-diffusion/checkpoint/custom/32a7af23-3763-4289-a6af-2156a2331878", "type": "Stable-diffusion", "status": "Active", "name": [ "v1-5-pruned-emaonly.safetensors" ], "created": "1706257208.072628", "params": { "creator": "admin", "multipart_upload": { "v1-5-pruned-emaonly.safetensors": { "bucket": "xxxx", "upload_id": "0lZ9V2zTHVeflFpkbFGxJyW.4Sq5tqJjzlVUDvsgxfV_R55iL.ZBD0vXmLJex_Qkf..EvtSR8N52SdwGup2n0w70hHJsvdTXlY1uNmOpR2OOTfqnavtVZciEUpQEXUmG8a_6v.WTS5XCnCMo412SdgZwMoPOoTXXD_NsOULGq.u818BuANSvH7ObxvbhJdLOEccP7T4jni9hAmjI58C7PC7X3ow.xhaI8KmdHl7B_QY-", "key": "Stable-diffusion/checkpoint/custom/32a7af23-3763-4289-a6af-2156a2331878/v1-5-pruned-emaonly.safetensors" } }, "message": "placeholder for chkpts upload test", "created": "2024-01-26 08:20:08.029381" }, "allowed_roles_or_users": [ "IT Operator", "byoc" ] } ] }, "message": "OK" } } } } } } }, "security": [ { "apikey-header-x-api-key": [] } ] }, "delete": { "summary": "删除模型文件 DeleteCheckpoints", "deprecated": false, "description": "删除模型文件 \nDelete checkpoints\n", "operationId": "ListCheckpoints", "tags": [ "模型文件(Checkpoints)", "Checkpoint" ], "parameters": [], "requestBody": { "content": { "application/json": { "schema": { "type": "object", "properties": { "checkpoint_id_list": { "type": "array", "items": { "type": "string", "description": "ID" }, "description": "模型文件ID列表(ID List)" } }, "required": [ "checkpoint_id_list" ] } } } }, "responses": { "204": { "description": "No Content", "content": { "application/json": { "schema": { "type": "object", "properties": {} } } } } }, "security": [ { "apikey-header-x-api-key": [] } ] } }, "/endpoints": { "get": { "summary": "获取端点列表 ListEndpoints", "deprecated": false, "description": "获取推理端点列表\nList inference endpoints", "operationId": "ListEndpoints", "tags": [ "推理端点(Endpoints)", "Endpoint" ], "parameters": [ { "name": "username", "in": "header", "description": "", "required": true, "example": "{{bearerToken}}", "schema": { "type": "string" } } ], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "statusCode": { "type": "integer" }, "data": { "type": "object", "properties": { "endpoints": { "type": "array", "items": { "type": "object", "properties": { "EndpointDeploymentJobId": { "type": "string" }, "autoscaling": { "type": "boolean" }, "max_instance_number": { "type": "string" }, "startTime": { "type": "string" }, "status": { "type": "null" }, "instance_type": { "type": "string" }, "current_instance_count": { "type": "string" }, "endTime": { "type": "string" }, "endpoint_status": { "type": "string" }, "endpoint_name": { "type": "string" }, "error": { "type": "null" }, "endpoint_type": { "type": "string" }, "owner_group_or_role": { "type": "array", "items": { "type": "string" } } }, "required": [ "EndpointDeploymentJobId", "autoscaling", "max_instance_number", "startTime", "status", "instance_type", "current_instance_count", "endTime", "endpoint_status", "endpoint_name", "error", "endpoint_type", "owner_group_or_role" ] } } }, "required": [ "endpoints" ] }, "message": { "type": "string" } }, "required": [ "statusCode", "data", "message" ] }, "examples": { "1": { "summary": "Success", "value": { "statusCode": 200, "data": { "endpoints": [ { "EndpointDeploymentJobId": "d1253aa5-c884-4989-a7d1-d8806bc4fa59", "autoscaling": false, "max_instance_number": "1", "startTime": "2024-01-30 07:59:46.842717", "status": null, "instance_type": "ml.g4dn.2xlarge", "current_instance_count": "1", "endTime": "2024-01-30 08:03:33.991793", "endpoint_status": "InService", "endpoint_name": "esd-real-time-api-test", "error": null, "endpoint_type": "Real-time", "owner_group_or_role": [ "byoc" ] }, { "EndpointDeploymentJobId": "a50ba02e-057f-433d-83be-0f52fdd45b13", "autoscaling": true, "max_instance_number": "1", "startTime": "2024-01-26 08:19:52.759748", "status": null, "instance_type": "ml.g4dn.xlarge", "current_instance_count": "0", "endTime": "2024-02-02 03:58:32.946464", "endpoint_status": "InService", "endpoint_name": "esd-async-api-test", "error": null, "endpoint_type": "Async", "owner_group_or_role": [ "IT Operator" ] } ] }, "message": "OK" } } } } } } }, "security": [ { "apikey-header-x-api-key": [] } ] }, "post": { "summary": "创建端点 CreateEndpoint", "deprecated": false, "description": "创建推理端点\nCreate Endpoint\n", "operationId": "CreateEndpoint", "tags": [ "推理端点(Endpoints)", "Endpoint" ], "parameters": [], "requestBody": { "content": { "application/json": { "schema": { "type": "object", "properties": { "endpoint_name": { "type": "string", "description": "端点名称(Endpoint Name)" }, "endpoint_type": { "type": "string", "description": "端点类型(Endpoint Type)" }, "instance_type": { "type": "string", "description": "实例类型(Instance Type)" }, "initial_instance_count": { "type": "integer", "description": "初始实例数(Initial Instance Count)" }, "autoscaling_enabled": { "type": "boolean", "description": "开启 Autoscaling(Enable Autoscaling)" }, "assign_to_roles": { "type": "array", "items": { "type": "string" }, "description": "角色列表(Role List)" }, "creator": { "type": "string", "description": "创建者用户名(Creator User Name)" }, "min_instance_number": { "type": "integer", "description": "最小实例数(Min Instance Count)" }, "max_instance_number": { "type": "integer", "description": "最大实例数(Max Instance Count)" } }, "required": [ "endpoint_name", "endpoint_type", "instance_type", "initial_instance_count", "min_instance_number", "max_instance_number", "autoscaling_enabled", "assign_to_roles", "creator" ] }, "example": { "endpoint_name": "test", "instance_type": "ml.g5.2xlarge", "initial_instance_count": "1", "autoscaling_enabled": false, "assign_to_roles": [ "Designer", "IT Operator" ] } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "statusCode": { "type": "integer" }, "message": { "type": "string" }, "data": { "$ref": "#/components/schemas/Endpoint" } }, "required": [ "statusCode", "message", "data" ] }, "examples": { "1": { "summary": "Success", "value": { "statusCode": 200, "message": "Endpoint deployment started: infer-endpoint-prod", "data": { "EndpointDeploymentJobId": "60b12a2e-c54d-496c-b405-1bc77b17e2f9", "autoscaling": false, "max_instance_number": "1", "startTime": "2023-12-07 01:08:43.410628", "status": null, "current_instance_count": "0", "endTime": null, "endpoint_status": "Creating", "endpoint_name": "infer-endpoint-prod", "error": null, "owner_group_or_role": [ "Designer", "IT Operator" ] } } } } } } } }, "security": [ { "apikey-header-x-api-key": [] } ] }, "delete": { "summary": "删除端点 DeleteEndpoints", "deprecated": false, "description": "删除推理端点\nDelete endpoints", "operationId": "DeleteEndpoints", "tags": [ "推理端点(Endpoints)", "Endpoint" ], "parameters": [ { "name": "username", "in": "header", "description": "", "required": true, "example": "{{bearerToken}}", "schema": { "type": "string" } } ], "requestBody": { "content": { "application/json": { "schema": { "type": "object", "properties": { "endpoint_name_list": { "type": "array", "items": { "type": "string" }, "description": "端点名列表(Endpoint Name List)" } }, "required": [ "endpoint_name_list" ] }, "example": { "endpoint_name_list": [ "esd-async-test-tmp" ] } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": {} } } } } }, "security": [ { "apikey-header-x-api-key": [] } ] } }, "/inferences": { "post": { "summary": "创建推理作业 CreateInferenceJob", "deprecated": false, "description": "创建推理作业,创建成功后,需要通过返回的`api_params_s3_upload_url` 上传推理参数\nCreate inference, When you got response, you have to upload your Payload to `api_params_s3_upload_url`", "operationId": "CreateInferenceJob", "tags": [ "推理(Inferences)", "Inference" ], "parameters": [], "requestBody": { "content": { "application/json": { "schema": { "type": "object", "properties": { "inference_type": { "type": "string", "description": "推理类型(Inference Type)Async | Real-time" }, "task_type": { "type": "string", "description": "任务类型(Task Type)txt2img | img2img | rembg" }, "models": { "type": "object", "properties": { "Stable-diffusion": { "type": "array", "items": { "type": "string" } }, "VAE": { "type": "array", "items": { "type": "string" } }, "embeddings": { "type": "array", "items": { "type": "string" } } }, "required": [ "Stable-diffusion", "VAE", "embeddings" ], "description": "模型列表(Model List)" } }, "required": [ "inference_type", "task_type", "models" ] }, "example": { "user_id": "admin", "inference_type": "Async", "task_type": "txt2img", "models": { "Stable-diffusion": [ "v1-5-pruned-emaonly.safetensors" ], "VAE": [ "Automatic" ], "embeddings": [] }, "filters": { "createAt": 1707141090.135923, "creator": "sd-webui" } } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "statusCode": { "type": "integer" }, "data": { "type": "object", "properties": { "inference": { "type": "object", "properties": { "id": { "type": "string" }, "type": { "type": "string" }, "api_params_s3_location": { "type": "string" }, "api_params_s3_upload_url": { "type": "string" }, "models": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "array", "items": { "type": "string" } }, "type": { "type": "string" } }, "required": [ "id", "name", "type" ] } } }, "required": [ "id", "type", "api_params_s3_location", "api_params_s3_upload_url", "models" ] } }, "required": [ "inference" ] }, "message": { "type": "string" } }, "required": [ "statusCode", "data", "message" ] }, "examples": { "1": { "summary": "Success", "value": { "statusCode": 201, "data": { "inference": { "id": "f3421ce5-9ab9-40a2-b33b-3f126de70a52", "type": "txt2img", "api_params_s3_location": "s3://xxxx/txt2img/infer_v2/f3421ce5-9ab9-40a2-b33b-3f126de70a52/api_param.json", "api_params_s3_upload_url": "https://xxxx.s3.amazonaws.com/txt2img/infer_v2/f3421ce5-9ab9-40a2-b33b-3f126de70a52/api_param.json?AWSAccessKeyId=xxxx&Signature=HNp81KZy2%2FDSgz7%2FWP%2FdMIUPz8s%3D&x-amz-security-token=IQoJb3JpZ2luX2VjEOz%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FwEaDmFwLXNvdXRoZWFzdC0xIkcwRQIgNMLgV7at1Vaao4wiFDgLOk4vc3OwD1D%2F4vyd%2Bz5vxhkCIQCnDqwzj3jP%2BIEyc2hCFw%2FNbWOHE%2BLDOVNFfxowLpQFEyrhAwi1%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F8BEAAaDDg2MDY2MDYwMDY5MCIM%2B6KJWPfr9JG4NBwKKrUDxMOpMiWgg2N1uusnm%2FRpoZhBFTe4MnPMNHf5M%2Bb8mTZWHD1JnMNAda1RUzfc9QoL%2BO76bH2QxhHQgmWaCnoX9i4hQCH7U%2F2slmF4EVSktyKWPbKMr%2BooX4uSpCiuU7qXqgjhPKbEn3tmsfH0RVf%2ByaGLXe6G43JAHpArjaJTIRnmH%2Bszbq55F%2FaifIpjhw9IlB6X18uVTzx9vqepS8zF%2Bn7%2F0L0da%2FhNvzz5QbRxbTrzjtDIGKd7aOz2%2BuXM03naXLcRFDRw29wzbMH2Z2P%2Bran9lZsrJBDYlWN4BMV3PSaweOghOOTldPlxylTzWiE86xWmw5kUpgU%2B4A8Te%2BZmJRl6Qqhq7sOZ%2BaaNTAqpYYQhjkFxLFziZjub90%2B7%2B0idFmQN7CpKEmBUTVdrQGAcagAJ9jQRUosTfRfHP%2BiXK1dj2sOOgDsDOZE6X2O9dpJQCiQAJKDDDvBKPn1s%2BDp7KlgRh5AdlBEgUkfcx3fUyhFz7hrVGLHR74hYIScIM714eDMlPvqtPtznr8IKtRvzKRYGxMyN%2FM%2FdvqhDE2WEHOP9M%2B4bvDBxMTDhNngjdZsMs524zVcw79aGrgY6ngEPUkOghS7xw2T1%2FGr6jR8AIjsdZ4ZsC5BZp22jizDO%2FQBmWEH2Z9LJK6Jmf7XwCRagmOuZlc8ZSr929Q48f371DwbhPGJdwjb7VPYqA20CJkcz6mFrU5zwLm%2BqDB2%2BpNVWIBMWeRsoGfcEipeR%2BVRd5DhVh0gCYc9BqDtshpstnhEvesuPSr8syAt5VQwUEAplxtWGFHh%2BPH3RHcgu%2Bw%3D%3D&Expires=1707194752", "models": [ { "id": "32a7af23-3763-4289-a6af-2156a2331878", "name": [ "v1-5-pruned-emaonly.safetensors" ], "type": "Stable-diffusion" }, { "id": "VAE", "name": [ "Automatic" ], "type": "VAE" } ] } }, "message": "Created" } } } } } } }, "security": [ { "apikey-header-x-api-key": [] } ] }, "get": { "summary": "获取推理作业列表 ListInferenceJobs", "deprecated": false, "description": "获取推理作业列表\nList inference jobs\n", "operationId": "ListInferenceJobs", "tags": [ "推理(Inferences)", "Inference" ], "parameters": [ { "name": "username", "in": "header", "description": "", "required": false, "example": "{{userName}}", "schema": { "type": "string" } } ], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/InferenceJob" } }, "examples": { "1": { "summary": "Success", "value": { "statusCode": 200, "data": { "inferences": [ { "InferenceJobId": "31d3d034-795b-4f82-8bab-0400199efa4c", "status": "succeed", "taskType": "txt2img", "owner_group_or_role": [ "admin" ], "inference_info_name": "/tmp/31d3d034-795b-4f82-8bab-0400199efa4c_param.json", "startTime": "2024-02-05 06:05:44.377116", "createTime": "2024-02-05 06:05:44.377095", "image_names": [ "image_0.png" ], "sagemakerRaw": "{'awsRegion': 'ap-southeast-1', 'eventTime': '2024-02-05T06:05:54.118Z', 'receivedTime': '2024-02-05T06:05:50.334Z', 'invocationStatus': 'Completed', 'requestParameters': {'accept': '*/*', 'endpointName': 'esd-async-97fce5e', 'inputLocation': 's3://sagemaker-ap-southeast-1-xxxx/async-endpoint-inputs/esd-async-97fce5e-240205-0605/2024-02-05-06-05-49-989-502d011b-80cf-4cc8-9359-639f4c889fb1'}, 'responseParameters': {'contentType': 'application/json', 'outputLocation': 's3://xxxx/sagemaker_output/8ee18fc1-0f51-49c7-8833-31e2daafa7c6.out'}, 'inferenceId': '31d3d034-795b-4f82-8bab-0400199efa4c', 'eventVersion': '1.0', 'eventSource': 'aws:sagemaker', 'eventName': 'InferenceResult'}", "completeTime": "2024-02-05 06:05:55.239513", "params": { "input_body_s3": "s3://xxxx/txt2img/infer_v2/31d3d034-795b-4f82-8bab-0400199efa4c/api_param.json", "sagemaker_inference_endpoint_id": "97fce5ef-3c1b-4902-9043-ec7cb614d7d1", "input_body_presign_url": "https://xxxx.s3.amazonaws.com/txt2img/infer_v2/31d3d034-795b-4f82-8bab-0400199efa4c/api_param.json?AWSAccessKeyId=xxxx&Signature=qASpoFpZxNNMbDZNzwjcfS31%2Bts%3D&x-amz-security-token=IQoJb3JpZ2luX2VjENb%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FwEaDmFwLXNvdXRoZWFzdC0xIkgwRgIhALn6k5IG2ikYnvMq55N8qzxoi0PcGaPgqzQiNfqjU2ueAiEAlD%2B36qo6fakPvbFIO%2FCEBq3OWIZy3PVRc50g11Yh%2BLAq4QMIn%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FARAAGgw4NjA2NjA2MDA2OTAiDP6CmhQmhgcfvjTYpSq1A%2FUxhB9s6Vam%2FSSyEYlgMkVgvRGOntmYPgfgAdGj9j37KcncPzUxzsuttNgVQzP%2Bu9CVAI4QrO02ObsyNPvsy3KOCLmpBRcSmZDqRkPW5%2BTmQwVEAD8AYut7P3CiLt0mIcCcMS8UOZuXbvb6%2FyaPAegYR20bUEfPDiOEvYxyBOrj9%2FdbED5lvSrS3fHucyIVk9wF6tJQQVucqWRA1qllL6Dj%2BIg86dFYkLl2BiYty0Vd0OBT6y51ATmhBJqqz66M5MlKuVvxWZ5ZL7T%2BcNcJyPnukXAADGuBXt6ZjD7QWxve7TQE6aUTHGi6WbF%2FLi0%2BqWOmVoKdootyVT3bCj34rA56NudSO5t0QjBonQ%2BfnFJlB7s1if4UHZUp%2FijPImWJU8uC6PMp9Qshgux3IwCjO6X%2B5GcyWnL1hO5GaljtyERBLQZ8SS2ZHej3kSw9cJ3w%2FN5cCgejLWkbNffQdkyan1XsRav9ufZOHQMNtupz0LEsUIvbctZjip3FLdBp0rwZDfrBEFlpuDEnmzpCbJVIw7BajO7Fqtu%2FzYHeyEH7ZLLHSMFSkK4apzXb2gkhpmM44XalQzu7MLb1ga4GOp0BghTpORcI%2F6KMUkPVI3YuuZ7O5HLQTlq8TYtl9%2BEWIpG8omXyk232ysXfV4hgvVNA1yOfBpa0IEY86LVLIUOGRgNgPtAkBp2Mao9lA0GcAh2XGCCJYRFyvwVU1veBhN5XgNA15dy1Vqp9YC2ZtwMiTxQcy5R6vlm8mI2cKaI0RJWlD9gWhRhlZJZVx5RTgYI6jjhnr0Zis3L52wmd0A%3D%3D&Expires=1707116744", "used_models": { "Stable-diffusion": [ { "s3": "s3://xxxx/Stable-diffusion/checkpoint/custom/32a7af23-3763-4289-a6af-2156a2331878", "id": "32a7af23-3763-4289-a6af-2156a2331878", "model_name": "v1-5-pruned-emaonly.safetensors", "type": "Stable-diffusion" } ], "VAE": [ { "s3": "None", "id": "VAE", "model_name": "Automatic", "type": "VAE" } ] }, "output_path": "s3://xxxx/sagemaker_output/8ee18fc1-0f51-49c7-8833-31e2daafa7c6.out", "sagemaker_inference_instance_type": "ml.g4dn.2xlarge", "sagemaker_inference_endpoint_name": "esd-async-97fce5e" }, "inference_type": "Async" }, { "InferenceJobId": "55cb83dc-24c0-4aec-9814-e0bea8abc5d0", "status": "succeed", "taskType": "txt2img", "owner_group_or_role": [ "admin" ], "inference_info_name": "/tmp/55cb83dc-24c0-4aec-9814-e0bea8abc5d0_param.json", "startTime": "2024-02-05 06:15:26.753213", "createTime": "2024-02-05 06:15:26.753195", "image_names": [ "image_0.png" ], "sagemakerRaw": "{'awsRegion': 'ap-southeast-1', 'eventTime': '2024-02-05T06:15:31.206Z', 'receivedTime': '2024-02-05T06:15:27.385Z', 'invocationStatus': 'Completed', 'requestParameters': {'accept': '*/*', 'endpointName': 'esd-async-97fce5e', 'inputLocation': 's3://sagemaker-ap-southeast-1-1111111/async-endpoint-inputs/esd-async-97fce5e-240205-0615/2024-02-05-06-15-27-073-3ac4a485-a2d5-4595-8688-c598c0681463'}, 'responseParameters': {'contentType': 'application/json', 'outputLocation': 's3://xxxx/sagemaker_output/a3e5cbed-717d-4a82-af68-584ed26c6b51.out'}, 'inferenceId': '55cb83dc-24c0-4aec-9814-e0bea8abc5d0', 'eventVersion': '1.0', 'eventSource': 'aws:sagemaker', 'eventName': 'InferenceResult'}", "completeTime": "2024-02-05 06:15:32.583124", "params": { "input_body_s3": "s3://xxxx/txt2img/infer_v2/55cb83dc-24c0-4aec-9814-e0bea8abc5d0/api_param.json", "sagemaker_inference_endpoint_id": "97fce5ef-3c1b-4902-9043-ec7cb614d7d1", "input_body_presign_url": "https://xxxx.s3.amazonaws.com/txt2img/infer_v2/55cb83dc-24c0-4aec-9814-e0bea8abc5d0/api_param.json?AWSAccessKeyId=xxxx&Signature=IoOJDXuETJeMBz4vac3VuVOPhs8%3D&x-amz-security-token=IQoJb3JpZ2luX2VjENb%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FwEaDmFwLXNvdXRoZWFzdC0xIkgwRgIhALn6k5IG2ikYnvMq55N8qzxoi0PcGaPgqzQiNfqjU2ueAiEAlD%2B36qo6fakPvbFIO%2FCEBq3OWIZy3PVRc50g11Yh%2BLAq4QMIn%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FARAAGgw4NjA2NjA2MDA2OTAiDP6CmhQmhgcfvjTYpSq1A%2FUxhB9s6Vam%2FSSyEYlgMkVgvRGOntmYPgfgAdGj9j37KcncPzUxzsuttNgVQzP%2Bu9CVAI4QrO02ObsyNPvsy3KOCLmpBRcSmZDqRkPW5%2BTmQwVEAD8AYut7P3CiLt0mIcCcMS8UOZuXbvb6%2FyaPAegYR20bUEfPDiOEvYxyBOrj9%2FdbED5lvSrS3fHucyIVk9wF6tJQQVucqWRA1qllL6Dj%2BIg86dFYkLl2BiYty0Vd0OBT6y51ATmhBJqqz66M5MlKuVvxWZ5ZL7T%2BcNcJyPnukXAADGuBXt6ZjD7QWxve7TQE6aUTHGi6WbF%2FLi0%2BqWOmVoKdootyVT3bCj34rA56NudSO5t0QjBonQ%2BfnFJlB7s1if4UHZUp%2FijPImWJU8uC6PMp9Qshgux3IwCjO6X%2B5GcyWnL1hO5GaljtyERBLQZ8SS2ZHej3kSw9cJ3w%2FN5cCgejLWkbNffQdkyan1XsRav9ufZOHQMNtupz0LEsUIvbctZjip3FLdBp0rwZDfrBEFlpuDEnmzpCbJVIw7BajO7Fqtu%2FzYHeyEH7ZLLHSMFSkK4apzXb2gkhpmM44XalQzu7MLb1ga4GOp0BghTpORcI%2F6KMUkPVI3YuuZ7O5HLQTlq8TYtl9%2BEWIpG8omXyk232ysXfV4hgvVNA1yOfBpa0IEY86LVLIUOGRgNgPtAkBp2Mao9lA0GcAh2XGCCJYRFyvwVU1veBhN5XgNA15dy1Vqp9YC2ZtwMiTxQcy5R6vlm8mI2cKaI0RJWlD9gWhRhlZJZVx5RTgYI6jjhnr0Zis3L52wmd0A%3D%3D&Expires=1707117326", "used_models": { "Stable-diffusion": [ { "s3": "s3://xxxx/Stable-diffusion/checkpoint/custom/32a7af23-3763-4289-a6af-2156a2331878", "id": "32a7af23-3763-4289-a6af-2156a2331878", "model_name": "v1-5-pruned-emaonly.safetensors", "type": "Stable-diffusion" } ], "VAE": [ { "s3": "None", "id": "VAE", "model_name": "Automatic", "type": "VAE" } ] }, "output_path": "s3://xxxx/sagemaker_output/a3e5cbed-717d-4a82-af68-584ed26c6b51.out", "sagemaker_inference_instance_type": "ml.g4dn.2xlarge", "sagemaker_inference_endpoint_name": "esd-async-97fce5e" }, "inference_type": "Async" } ] }, "message": "OK" } } } } } } }, "security": [ { "apikey-header-x-api-key": [] } ] }, "delete": { "summary": "删除推理作业 DeleteInferenceJobs", "deprecated": false, "description": "删除推理作业列表\nDelete inference jobs\n", "operationId": "ListInferenceJobs", "tags": [ "推理(Inferences)", "Inference" ], "parameters": [ { "name": "username", "in": "header", "description": "", "required": true, "example": "{{userName}}", "schema": { "type": "string" } } ], "requestBody": { "content": { "application/json": { "schema": { "type": "object", "properties": { "inference_id_list": { "type": "array", "items": { "type": "string" }, "description": "推理作业ID列表(Inference Job ID List)" } }, "required": [ "inference_id_list" ] }, "example": { "inference_id_list": [ "99" ] } } } }, "responses": { "204": { "description": "No Content", "content": { "application/json": { "schema": { "type": "object", "properties": {} }, "examples": { "1": { "summary": "Success", "value": {} } } } } } }, "security": [ { "apikey-header-x-api-key": [] } ] } }, "/inferences/{jobId}/start": { "put": { "summary": "开始推理作业 StartInferenceJob", "deprecated": false, "description": "开始推理作业\nStart inference job\n", "operationId": "RunInferenceJob", "tags": [ "推理(Inferences)", "Inference" ], "parameters": [ { "name": "jobId", "in": "path", "description": "推理作业ID(Inference Job ID)", "required": true, "example": "", "schema": { "type": "string" } } ], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "statusCode": { "type": "integer" }, "data": { "type": "object", "properties": { "inference": { "type": "object", "properties": { "inference_id": { "type": "string" }, "status": { "type": "string" }, "endpoint_name": { "type": "string" }, "output_path": { "type": "string" } }, "required": [ "inference_id", "status", "endpoint_name", "output_path" ] } }, "required": [ "inference" ] }, "message": { "type": "string" } }, "required": [ "statusCode", "data", "message" ] }, "examples": { "1": { "summary": "Success", "value": { "statusCode": 202, "data": { "inference": { "inference_id": "f3421ce5-9ab9-40a2-b33b-3f126de70a52", "status": "inprogress", "endpoint_name": "esd-async-97fce5e", "output_path": "s3://xxxx/sagemaker_output/48159016-c040-4b49-8a1c-b57445946918.out" } }, "message": "Accepted" } } } } } } }, "security": [ { "apikey-header-x-api-key": [] } ] } }, "/checkpoints/{checkpointId}": { "put": { "summary": "更新模型文件状态 UpdateCheckpoint", "deprecated": false, "description": "更新模型文件状态\nUpdate Checkpoint", "operationId": "UpdateCheckpoint", "tags": [ "模型文件(Checkpoints)", "Checkpoint" ], "parameters": [ { "name": "checkpointId", "in": "path", "description": "", "required": true, "example": "{{checkpointId}}", "schema": { "type": "string" } } ], "requestBody": { "content": { "application/json": { "schema": { "type": "object", "properties": { "status": { "type": "string", "description": "状态(Status)" }, "multi_parts_tags": { "type": "object", "properties": { "v1-5-pruned-emaonly.safetensors": { "type": "array", "items": { "type": "object", "properties": { "ETag": { "type": "string" }, "PartNumber": { "type": "integer" } }, "required": [ "ETag", "PartNumber" ] } } }, "required": [ "v1-5-pruned-emaonly.safetensors" ], "description": "ETags" } }, "required": [ "status", "multi_parts_tags" ] }, "example": { "checkpoint_id": "5b47fc8f-c1b0-47ad-9d85-ad0f08526e28", "status": "Active", "multi_parts_tags": { "v1-5-pruned-emaonly.safetensors": [ { "ETag": "\"e6279f0ad8bf8048c0d106095c4d4b24\"", "PartNumber": 1 }, { "ETag": "\"01a458e7d019140cb792b577596b7918\"", "PartNumber": 2 }, { "ETag": "\"296e59a1fb1ea02f6512c5b4c4565bea\"", "PartNumber": 3 }, { "ETag": "\"9dd22961ddf32130a22b36dc53f93fd0\"", "PartNumber": 4 }, { "ETag": "\"bfb91caed0e9f1aaaca7a0f125e7e96b\"", "PartNumber": 5 } ] } } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "statusCode": { "type": "integer", "description": "Status Code" }, "headers": { "type": "object", "properties": { "Access-Control-Allow-Headers": { "type": "string" }, "Access-Control-Allow-Origin": { "type": "string" }, "Access-Control-Allow-Methods": { "type": "string" } }, "required": [ "Access-Control-Allow-Headers", "Access-Control-Allow-Origin", "Access-Control-Allow-Methods" ] }, "checkpoint": { "type": "object", "properties": { "id": { "type": "string", "description": "ID" }, "type": { "type": "string", "description": "Type" }, "s3_location": { "type": "string", "description": "S3 Key" }, "status": { "type": "string", "description": "Status" }, "params": { "type": "object", "properties": { "creator": { "type": "string", "description": "User Name" }, "multipart_upload": { "type": "object", "properties": { "v1-5-pruned-emaonly.safetensors": { "type": "object", "properties": { "bucket": { "type": "string" }, "upload_id": { "type": "string" }, "key": { "type": "string" } }, "required": [ "bucket", "upload_id", "key" ] } }, "required": [ "v1-5-pruned-emaonly.safetensors" ], "description": "S3 Multipart Upload" }, "message": { "type": "string", "description": "Message" }, "created": { "type": "string", "description": "Created At" } }, "required": [ "creator", "multipart_upload", "message", "created" ] } }, "required": [ "id", "type", "s3_location", "status", "params" ], "description": "Checkpoint" } }, "required": [ "statusCode", "headers", "checkpoint" ] }, "examples": { "1": { "summary": "Success", "value": { "statusCode": 200, "checkpoint": { "id": "d613760c-c8f7-466a-9838-cea3033bf57d", "type": "Stable-diffusion", "s3_location": "s3://******/Stable-diffusion/checkpoint/custom/d613760c-c8f7-466a-9838-cea3033bf57d", "status": "Initial", "params": { "creator": "admin", "multipart_upload": { "v1-5-pruned-emaonly.safetensors": { "bucket": "******", "upload_id": "KFzbB7FwAuCDkR3NRaAO81uNM6E38KrvbB9m9T2dPlE0XUbOXrDB0c9CbhpLA3wFqnN6uTf0qh7HOYOmSXFwicHYOL7XfPMAhsT0cbxRhWvbyKPo8bO_wXrFcbUMDY.ef4vFZNKfdKaRba23Src44CrwGtYjkp3RQ8dEZubjleVTTTz0gaclwjfxmrdpqcZa", "key": "Stable-diffusion/checkpoint/custom/d613760c-c8f7-466a-9838-cea3033bf57d/v1-5-pruned-emaonly.safetensors" } }, "message": "api-test-message", "created": "2023-12-07 00:45:59.334826" } } } } } } } } }, "security": [ { "apikey-header-x-api-key": [] } ] } }, "/inferences/{jobId}": { "get": { "summary": "获取推理作业详情 GetInferenceJob", "deprecated": false, "description": "获取指定的推理作业详情\nGets a specific inference job\n", "operationId": "GetInferenceJob", "tags": [ "推理(Inferences)", "Inference" ], "parameters": [ { "name": "jobId", "in": "path", "description": "推理作业ID(Inference Job ID)", "required": true, "example": "{{jobId}}", "schema": { "type": "string" } } ], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "statusCode": { "type": "integer" }, "data": { "type": "object", "properties": { "img_presigned_urls": { "type": "array", "items": { "type": "string" } }, "output_presigned_urls": { "type": "array", "items": { "type": "string" } }, "inference_info_name": { "type": "string" }, "startTime": { "type": "string" }, "taskType": { "type": "string" }, "completeTime": { "type": "string" }, "params": { "type": "object", "properties": { "input_body_presign_url": { "type": "string" }, "used_models": { "type": "object", "properties": { "Stable-diffusion": { "type": "array", "items": { "type": "object", "properties": { "s3": { "type": "string" }, "id": { "type": "string" }, "model_name": { "type": "string" }, "type": { "type": "string" } } } }, "VAE": { "type": "array", "items": { "type": "object", "properties": { "s3": { "type": "string" }, "id": { "type": "string" }, "model_name": { "type": "string" }, "type": { "type": "string" } } } } }, "required": [ "Stable-diffusion", "VAE" ] }, "input_body_s3": { "type": "string" }, "sagemaker_inference_instance_type": { "type": "string" }, "sagemaker_inference_endpoint_id": { "type": "string" }, "sagemaker_inference_endpoint_name": { "type": "string" } }, "required": [ "input_body_presign_url", "used_models", "input_body_s3", "sagemaker_inference_instance_type", "sagemaker_inference_endpoint_id", "sagemaker_inference_endpoint_name" ] }, "InferenceJobId": { "type": "string" }, "status": { "type": "string" }, "inference_type": { "type": "string" }, "createTime": { "type": "string" }, "image_names": { "type": "array", "items": { "type": "string" } }, "owner_group_or_role": { "type": "array", "items": { "type": "string" } } }, "required": [ "img_presigned_urls", "output_presigned_urls", "inference_info_name", "startTime", "taskType", "completeTime", "params", "InferenceJobId", "status", "inference_type", "createTime", "image_names", "owner_group_or_role" ] }, "message": { "type": "string" } }, "required": [ "statusCode", "data", "message" ] }, "examples": { "1": { "summary": "Success", "value": { "statusCode": 200, "data": { "img_presigned_urls": [ "https://xxxx.s3.amazonaws.com/out/9d93e241-745a-4464-bb99-22253c910a01/result/image_0.png?AWSAccessKeyId=xxxx&Signature=%2BIoU%2BUuY0oJmd9yb8B6xJGnRN3Q%3D&x-amz-security-token=IQoJb3JpZ2luX2VjEOz%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FwEaDmFwLXNvdXRoZWFzdC0xIkgwRgIhAJXX4Y7cAU1VjSQK3Ga5Q3oWrK9Pu7e%2BaJ%2FcP89H3DnAAiEAw%2FSIHzSWR01mAw6xb2kqhTgkapA3hRzRlmIgb%2FQuuNsq4QMItf%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FARAAGgw4NjA2NjA2MDA2OTAiDI5nIbuU88AEtxiKeSq1A0em0PiCJywBO91ACgdnEOZhh46%2BcPMBZS8sbo2G7FuNR8VRz4nGIQjp4HdX468AMjoAN7tRidsufLva6L2xTrqmiiEZobRLqc%2FgsJnuxkK0FFbmdW%2B4GSjUWC8NIyICwF4KtL%2FS05fYVQyq5%2FBV%2B%2FVMw0aT5m7ai4E9FkHAgTsMvhxg31L3v%2BPe8A8Y%2BZbuWGdvonMzHE4CYMKAKe6SfvjK7u8U8YHR8IeCFWd90jzlkygIk83oFVOuyybITePaZbxWKuyEvBSJd3T7y46CeThyzc3I8AlmYTrfbuj8BhSqiptedtN5%2BmtMP5q04c3EGpIQ86B13NAUhHDadBeImztplPRLJFUXJsj7AMUHc5I7h8o%2BRXy1xE4GZD382WXsHOKLJ39UkioqRUvWCAozO%2B%2FBsILadh83RUcE7C7HFGd6%2BdnfcWPfjDOr5i%2FI5P%2BeamDL9Cvw9hakaaMSryI8ki3kmMMbubBc2JExOtspIh3SquN2dw6RUtb34mBZerxZhJHNGFsdARrboM7IZA1f8S6oGuMRX7tr67P%2Fgx5alSHiiS%2FvFlNyPqIRk7O3uAlnzLkQ7IgyMO%2FZhq4GOp0B1Fyc2ySOy88xOUvUFDkJHr5dpVYIOkffdqOgGXOi9H0edCyg8xELWZwofu6eT%2FecDv4xvjkHjXyJ%2B3H7KP1%2FmE2IoQSFJBFvI0El1rvg7jsvROTe8QVuNYG9V1PqH3zLLz%2Fw9V1R9fK6ys5ZdlDCm208LClKZq8YlxQWXlOO%2FLMLcR51FJxqu5tqXLAaVIFDNdwO%2BrUyvZx5xMTifg%3D%3D&Expires=1707195462" ], "output_presigned_urls": [ "https://xxxx.s3.amazonaws.com/out/9d93e241-745a-4464-bb99-22253c910a01/result/9d93e241-745a-4464-bb99-22253c910a01_param.json?AWSAccessKeyId=xxxx&Signature=sAi%2ByxVsUBdZfSh34QCMAh%2B2jGg%3D&x-amz-security-token=IQoJb3JpZ2luX2VjEOz%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FwEaDmFwLXNvdXRoZWFzdC0xIkgwRgIhAJXX4Y7cAU1VjSQK3Ga5Q3oWrK9Pu7e%2BaJ%2FcP89H3DnAAiEAw%2FSIHzSWR01mAw6xb2kqhTgkapA3hRzRlmIgb%2FQuuNsq4QMItf%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FARAAGgw4NjA2NjA2MDA2OTAiDI5nIbuU88AEtxiKeSq1A0em0PiCJywBO91ACgdnEOZhh46%2BcPMBZS8sbo2G7FuNR8VRz4nGIQjp4HdX468AMjoAN7tRidsufLva6L2xTrqmiiEZobRLqc%2FgsJnuxkK0FFbmdW%2B4GSjUWC8NIyICwF4KtL%2FS05fYVQyq5%2FBV%2B%2FVMw0aT5m7ai4E9FkHAgTsMvhxg31L3v%2BPe8A8Y%2BZbuWGdvonMzHE4CYMKAKe6SfvjK7u8U8YHR8IeCFWd90jzlkygIk83oFVOuyybITePaZbxWKuyEvBSJd3T7y46CeThyzc3I8AlmYTrfbuj8BhSqiptedtN5%2BmtMP5q04c3EGpIQ86B13NAUhHDadBeImztplPRLJFUXJsj7AMUHc5I7h8o%2BRXy1xE4GZD382WXsHOKLJ39UkioqRUvWCAozO%2B%2FBsILadh83RUcE7C7HFGd6%2BdnfcWPfjDOr5i%2FI5P%2BeamDL9Cvw9hakaaMSryI8ki3kmMMbubBc2JExOtspIh3SquN2dw6RUtb34mBZerxZhJHNGFsdARrboM7IZA1f8S6oGuMRX7tr67P%2Fgx5alSHiiS%2FvFlNyPqIRk7O3uAlnzLkQ7IgyMO%2FZhq4GOp0B1Fyc2ySOy88xOUvUFDkJHr5dpVYIOkffdqOgGXOi9H0edCyg8xELWZwofu6eT%2FecDv4xvjkHjXyJ%2B3H7KP1%2FmE2IoQSFJBFvI0El1rvg7jsvROTe8QVuNYG9V1PqH3zLLz%2Fw9V1R9fK6ys5ZdlDCm208LClKZq8YlxQWXlOO%2FLMLcR51FJxqu5tqXLAaVIFDNdwO%2BrUyvZx5xMTifg%3D%3D&Expires=1707195462" ], "inference_info_name": "/tmp/9d93e241-745a-4464-bb99-22253c910a01_param.json", "startTime": "2024-02-05 06:10:52.552528", "taskType": "txt2img", "completeTime": "2024-02-05 06:10:56.270528", "params": { "input_body_presign_url": "https://xxxx.s3.amazonaws.com/txt2img/infer_v2/9d93e241-745a-4464-bb99-22253c910a01/api_param.json?AWSAccessKeyId=xxxx&Signature=i8q7mM74oZoqtl6reQCPEklgXkc%3D&x-amz-security-token=IQoJb3JpZ2luX2VjENb%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FwEaDmFwLXNvdXRoZWFzdC0xIkgwRgIhALn6k5IG2ikYnvMq55N8qzxoi0PcGaPgqzQiNfqjU2ueAiEAlD%2B36qo6fakPvbFIO%2FCEBq3OWIZy3PVRc50g11Yh%2BLAq4QMIn%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FARAAGgw4NjA2NjA2MDA2OTAiDP6CmhQmhgcfvjTYpSq1A%2FUxhB9s6Vam%2FSSyEYlgMkVgvRGOntmYPgfgAdGj9j37KcncPzUxzsuttNgVQzP%2Bu9CVAI4QrO02ObsyNPvsy3KOCLmpBRcSmZDqRkPW5%2BTmQwVEAD8AYut7P3CiLt0mIcCcMS8UOZuXbvb6%2FyaPAegYR20bUEfPDiOEvYxyBOrj9%2FdbED5lvSrS3fHucyIVk9wF6tJQQVucqWRA1qllL6Dj%2BIg86dFYkLl2BiYty0Vd0OBT6y51ATmhBJqqz66M5MlKuVvxWZ5ZL7T%2BcNcJyPnukXAADGuBXt6ZjD7QWxve7TQE6aUTHGi6WbF%2FLi0%2BqWOmVoKdootyVT3bCj34rA56NudSO5t0QjBonQ%2BfnFJlB7s1if4UHZUp%2FijPImWJU8uC6PMp9Qshgux3IwCjO6X%2B5GcyWnL1hO5GaljtyERBLQZ8SS2ZHej3kSw9cJ3w%2FN5cCgejLWkbNffQdkyan1XsRav9ufZOHQMNtupz0LEsUIvbctZjip3FLdBp0rwZDfrBEFlpuDEnmzpCbJVIw7BajO7Fqtu%2FzYHeyEH7ZLLHSMFSkK4apzXb2gkhpmM44XalQzu7MLb1ga4GOp0BghTpORcI%2F6KMUkPVI3YuuZ7O5HLQTlq8TYtl9%2BEWIpG8omXyk232ysXfV4hgvVNA1yOfBpa0IEY86LVLIUOGRgNgPtAkBp2Mao9lA0GcAh2XGCCJYRFyvwVU1veBhN5XgNA15dy1Vqp9YC2ZtwMiTxQcy5R6vlm8mI2cKaI0RJWlD9gWhRhlZJZVx5RTgYI6jjhnr0Zis3L52wmd0A%3D%3D&Expires=1707117052", "used_models": { "Stable-diffusion": [ { "s3": "s3://xxxx/Stable-diffusion/checkpoint/custom/32a7af23-3763-4289-a6af-2156a2331878", "id": "32a7af23-3763-4289-a6af-2156a2331878", "model_name": "v1-5-pruned-emaonly.safetensors", "type": "Stable-diffusion" } ], "VAE": [ { "s3": "None", "id": "VAE", "model_name": "Automatic", "type": "VAE" } ] }, "input_body_s3": "s3://xxxx/txt2img/infer_v2/9d93e241-745a-4464-bb99-22253c910a01/api_param.json", "sagemaker_inference_instance_type": "ml.g4dn.2xlarge", "sagemaker_inference_endpoint_id": "9ef3c8bf-936e-47bb-a6da-e11e43140fb1", "sagemaker_inference_endpoint_name": "esd-real-time-9ef3c8b" }, "InferenceJobId": "9d93e241-745a-4464-bb99-22253c910a01", "status": "succeed", "inference_type": "Real-time", "createTime": "2024-02-05 06:10:52.299624", "image_names": [ "image_0.png" ], "owner_group_or_role": [ "admin" ] }, "message": "OK" } } } } } } }, "security": [ { "apikey-header-x-api-key": [] } ] } } }, "components": { "schemas": { "Checkpoint": { "type": "object", "properties": { "id": { "type": "string" }, "s3Location": { "type": "string" }, "type": { "type": "string" }, "status": { "type": "string" }, "name": { "type": "array", "items": { "type": "string" } }, "created": { "type": "number" }, "allowed_roles_or_users": { "type": "array", "items": { "type": "string" } } }, "required": [ "id", "s3Location", "type", "status", "name", "created", "allowed_roles_or_users" ] }, "Endpoint": { "type": "object", "properties": { "EndpointDeploymentJobId": { "type": "string", "description": "ID" }, "autoscaling": { "type": "boolean", "description": "Autoscaling Enabled" }, "max_instance_number": { "type": "string", "description": "Max Instance Count" }, "startTime": { "type": "string", "description": "Start Time" }, "current_instance_count": { "type": "integer", "description": "Current Instance Count" }, "endTime": { "type": "string", "description": "End Time" }, "endpoint_status": { "type": "string", "description": "Endpoint Status" }, "endpoint_name": { "type": "string", "description": "Endpoint Name" }, "error": { "type": "null", "description": "Error Message" }, "owner_group_or_role": { "type": "array", "items": { "type": "string" }, "description": "Roles" } }, "required": [ "EndpointDeploymentJobId", "autoscaling", "max_instance_number", "startTime", "current_instance_count", "endTime", "endpoint_status", "endpoint_name", "error", "owner_group_or_role" ] }, "User": { "type": "object", "properties": { "username": { "type": "string", "description": "用户名(User Name)" }, "roles": { "type": "array", "items": { "type": "string", "description": "角色名" }, "description": "角色列表(Roles)" }, "creator": { "type": "string", "description": "创建者用户名(Creator User Name)" }, "permissions": { "type": "array", "items": { "type": "string", "description": "权限" }, "description": "权限列表(Permissions)" }, "password": { "type": "string", "description": "密码(Password)" } }, "required": [ "username", "roles", "creator", "permissions", "password" ] }, "InferenceJob": { "type": "object", "properties": { "inference_info_name": { "type": "string", "description": "Inference Info Name" }, "startTime": { "type": "string", "description": "Start Time" }, "taskType": { "type": "string", "description": "Task Type" }, "completeTime": { "type": "string", "description": "Complete Time" }, "params": { "type": "object", "properties": { "input_body_presign_url": { "type": "string" }, "used_models": { "type": "object", "properties": { "Stable-diffusion": { "type": "array", "items": { "type": "object", "properties": { "s3": { "type": "string" }, "id": { "type": "string" }, "model_name": { "type": "string" }, "type": { "type": "string" } } } }, "Lora": { "type": "array", "items": { "type": "object", "properties": { "s3": { "type": "string" }, "id": { "type": "string" }, "model_name": { "type": "string" }, "type": { "type": "string" } } } } }, "required": [ "Stable-diffusion", "Lora" ] }, "input_body_s3": { "type": "string" }, "output_path": { "type": "string" }, "sagemaker_inference_endpoint_id": { "type": "string" }, "sagemaker_inference_endpoint_name": { "type": "string" } }, "required": [ "input_body_presign_url", "used_models", "input_body_s3", "output_path", "sagemaker_inference_endpoint_id", "sagemaker_inference_endpoint_name" ], "description": "Params" }, "InferenceJobId": { "type": "string", "description": "Inference Job Id" }, "status": { "type": "string", "description": "Status" }, "sagemakerRaw": { "type": "string", "description": "Sagemaker Raw" }, "image_names": { "type": "array", "items": { "type": "string" }, "description": "Images Array" }, "owner_group_or_role": { "type": "array", "items": { "type": "string" }, "description": "Roles" } }, "required": [ "inference_info_name", "startTime", "taskType", "completeTime", "params", "InferenceJobId", "status", "sagemakerRaw", "image_names", "owner_group_or_role" ] }, "Role": { "type": "object", "properties": { "role_name": { "type": "string", "description": "角色名(Role Name)" }, "creator": { "type": "string", "description": "创建者用户名(Creator User Name)" }, "permissions": { "type": "array", "items": { "type": "string", "description": "- train:all\n- checkpoint:all\n- inference:all\n- sagemaker_endpoint:all\n- user:all\n- role:all" }, "description": "权限列表(Permissions)" } }, "required": [ "role_name", "creator", "permissions" ] } }, "securitySchemes": { "apikey-header-x-api-key": { "type": "apiKey", "in": "header", "name": "x-api-key" } } }, "servers": [] }