mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2025-08-08 22:26:46 +00:00
[openapi] Replace bare object schemas with proper component references
Replace inline object definitions for queue, history, and resource management operations with reusable schema components: - Add QueueManageRequest schema for /api/queue POST requests - Add FreeResourcesRequest schema for /api/free POST requests - Add HistoryManageRequest schema for /api/history POST requests - Add UploadResponse schema for upload endpoints This improves API consistency and reusability by moving common object definitions to the components section.
This commit is contained in:
parent
d6270cbdf3
commit
7baed85b1d
101
openapi.yaml
101
openapi.yaml
@ -108,17 +108,7 @@ paths:
|
|||||||
content:
|
content:
|
||||||
application/json:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
type: object
|
$ref: '#/components/schemas/QueueManageRequest'
|
||||||
properties:
|
|
||||||
clear:
|
|
||||||
type: boolean
|
|
||||||
description: If true, clears the entire queue
|
|
||||||
delete:
|
|
||||||
type: array
|
|
||||||
description: Array of prompt IDs to delete from the queue
|
|
||||||
items:
|
|
||||||
type: string
|
|
||||||
format: uuid
|
|
||||||
responses:
|
responses:
|
||||||
'200':
|
'200':
|
||||||
description: Success
|
description: Success
|
||||||
@ -144,14 +134,7 @@ paths:
|
|||||||
content:
|
content:
|
||||||
application/json:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
type: object
|
$ref: '#/components/schemas/FreeResourcesRequest'
|
||||||
properties:
|
|
||||||
unload_models:
|
|
||||||
type: boolean
|
|
||||||
description: If true, unloads models from memory
|
|
||||||
free_memory:
|
|
||||||
type: boolean
|
|
||||||
description: If true, frees GPU memory
|
|
||||||
responses:
|
responses:
|
||||||
'200':
|
'200':
|
||||||
description: Success
|
description: Success
|
||||||
@ -190,17 +173,7 @@ paths:
|
|||||||
content:
|
content:
|
||||||
application/json:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
type: object
|
$ref: '#/components/schemas/HistoryManageRequest'
|
||||||
properties:
|
|
||||||
clear:
|
|
||||||
type: boolean
|
|
||||||
description: If true, clears the entire history
|
|
||||||
delete:
|
|
||||||
type: array
|
|
||||||
description: Array of prompt IDs to delete from history
|
|
||||||
items:
|
|
||||||
type: string
|
|
||||||
format: uuid
|
|
||||||
responses:
|
responses:
|
||||||
'200':
|
'200':
|
||||||
description: Success
|
description: Success
|
||||||
@ -302,17 +275,7 @@ paths:
|
|||||||
content:
|
content:
|
||||||
application/json:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
type: object
|
$ref: '#/components/schemas/UploadResponse'
|
||||||
properties:
|
|
||||||
name:
|
|
||||||
type: string
|
|
||||||
description: Filename of the uploaded image
|
|
||||||
subfolder:
|
|
||||||
type: string
|
|
||||||
description: Subfolder the image was stored in
|
|
||||||
type:
|
|
||||||
type: string
|
|
||||||
description: Type of directory the image was stored in
|
|
||||||
'400':
|
'400':
|
||||||
description: Bad request
|
description: Bad request
|
||||||
/api/upload/mask:
|
/api/upload/mask:
|
||||||
@ -343,16 +306,7 @@ paths:
|
|||||||
application/json:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
type: object
|
type: object
|
||||||
properties:
|
$ref: '#/components/schemas/UploadResponse'
|
||||||
name:
|
|
||||||
type: string
|
|
||||||
description: Filename of the uploaded mask
|
|
||||||
subfolder:
|
|
||||||
type: string
|
|
||||||
description: Subfolder the mask was stored in
|
|
||||||
type:
|
|
||||||
type: string
|
|
||||||
description: Type of directory the mask was stored in
|
|
||||||
'400':
|
'400':
|
||||||
description: Bad request
|
description: Bad request
|
||||||
/api/view:
|
/api/view:
|
||||||
@ -893,3 +847,48 @@ components:
|
|||||||
torch_vram_free:
|
torch_vram_free:
|
||||||
type: number
|
type: number
|
||||||
description: Free VRAM as reported by PyTorch
|
description: Free VRAM as reported by PyTorch
|
||||||
|
QueueManageRequest:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
clear:
|
||||||
|
type: boolean
|
||||||
|
description: If true, clears the entire queue
|
||||||
|
delete:
|
||||||
|
type: array
|
||||||
|
description: Array of prompt IDs to delete from the queue
|
||||||
|
items:
|
||||||
|
type: string
|
||||||
|
format: uuid
|
||||||
|
FreeResourcesRequest:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
unload_models:
|
||||||
|
type: boolean
|
||||||
|
description: If true, unloads models from memory
|
||||||
|
free_memory:
|
||||||
|
type: boolean
|
||||||
|
description: If true, frees GPU memory
|
||||||
|
HistoryManageRequest:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
clear:
|
||||||
|
type: boolean
|
||||||
|
description: If true, clears the entire history
|
||||||
|
delete:
|
||||||
|
type: array
|
||||||
|
description: Array of prompt IDs to delete from history
|
||||||
|
items:
|
||||||
|
type: string
|
||||||
|
format: uuid
|
||||||
|
UploadResponse:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
name:
|
||||||
|
type: string
|
||||||
|
description: Filename of the uploaded file
|
||||||
|
subfolder:
|
||||||
|
type: string
|
||||||
|
description: Subfolder where the file was stored
|
||||||
|
type:
|
||||||
|
type: string
|
||||||
|
description: Type of directory the file was stored in
|
||||||
|
Loading…
x
Reference in New Issue
Block a user