mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-06-20 23:09:27 +08:00
chore(openapi): sync shared API contract from cloud@d10ff72 (#14518)
Some checks are pending
Detect Unreviewed Merge / detect (push) Waiting to run
Python Linting / Run Ruff (push) Waiting to run
Python Linting / Run Pylint (push) Waiting to run
Full Comfy CI Workflow Runs / test-stable (12.1, , linux, 3.10, [self-hosted Linux], stable) (push) Waiting to run
Full Comfy CI Workflow Runs / test-stable (12.1, , linux, 3.11, [self-hosted Linux], stable) (push) Waiting to run
Full Comfy CI Workflow Runs / test-stable (12.1, , linux, 3.12, [self-hosted Linux], stable) (push) Waiting to run
Full Comfy CI Workflow Runs / test-unix-nightly (12.1, , linux, 3.11, [self-hosted Linux], nightly) (push) Waiting to run
Execution Tests / test (macos-latest) (push) Waiting to run
Execution Tests / test (ubuntu-latest) (push) Waiting to run
Execution Tests / test (windows-latest) (push) Waiting to run
Test server launches without errors / test (push) Waiting to run
Unit Tests / test (macos-latest) (push) Waiting to run
Unit Tests / test (ubuntu-latest) (push) Waiting to run
Unit Tests / test (windows-2022) (push) Waiting to run
Some checks are pending
Detect Unreviewed Merge / detect (push) Waiting to run
Python Linting / Run Ruff (push) Waiting to run
Python Linting / Run Pylint (push) Waiting to run
Full Comfy CI Workflow Runs / test-stable (12.1, , linux, 3.10, [self-hosted Linux], stable) (push) Waiting to run
Full Comfy CI Workflow Runs / test-stable (12.1, , linux, 3.11, [self-hosted Linux], stable) (push) Waiting to run
Full Comfy CI Workflow Runs / test-stable (12.1, , linux, 3.12, [self-hosted Linux], stable) (push) Waiting to run
Full Comfy CI Workflow Runs / test-unix-nightly (12.1, , linux, 3.11, [self-hosted Linux], nightly) (push) Waiting to run
Execution Tests / test (macos-latest) (push) Waiting to run
Execution Tests / test (ubuntu-latest) (push) Waiting to run
Execution Tests / test (windows-latest) (push) Waiting to run
Test server launches without errors / test (push) Waiting to run
Unit Tests / test (macos-latest) (push) Waiting to run
Unit Tests / test (ubuntu-latest) (push) Waiting to run
Unit Tests / test (windows-2022) (push) Waiting to run
This commit is contained in:
parent
8483c215dc
commit
16514da2e7
195
openapi.yaml
195
openapi.yaml
@ -673,6 +673,35 @@ components:
|
|||||||
- created_at
|
- created_at
|
||||||
- updated_at
|
- updated_at
|
||||||
type: object
|
type: object
|
||||||
|
JobsCancelRequest:
|
||||||
|
additionalProperties: false
|
||||||
|
description: Request to cancel multiple jobs by ID.
|
||||||
|
properties:
|
||||||
|
job_ids:
|
||||||
|
description: Job identifiers (UUIDs) to cancel.
|
||||||
|
items:
|
||||||
|
format: uuid
|
||||||
|
type: string
|
||||||
|
maxItems: 100
|
||||||
|
minItems: 1
|
||||||
|
type: array
|
||||||
|
required:
|
||||||
|
- job_ids
|
||||||
|
type: object
|
||||||
|
JobsCancelResponse:
|
||||||
|
description: Response for POST /api/jobs/cancel.
|
||||||
|
properties:
|
||||||
|
cancelled:
|
||||||
|
description: |
|
||||||
|
Job IDs for which a cancel event was successfully dispatched by this
|
||||||
|
call. Jobs already in a terminal or cancelling state are idempotently
|
||||||
|
skipped and will not appear here.
|
||||||
|
items:
|
||||||
|
type: string
|
||||||
|
type: array
|
||||||
|
required:
|
||||||
|
- cancelled
|
||||||
|
type: object
|
||||||
JobsListResponse:
|
JobsListResponse:
|
||||||
description: Paginated list of jobs for the authenticated user.
|
description: Paginated list of jobs for the authenticated user.
|
||||||
properties:
|
properties:
|
||||||
@ -1006,7 +1035,7 @@ components:
|
|||||||
description: If true, clear all pending jobs from the queue
|
description: If true, clear all pending jobs from the queue
|
||||||
type: boolean
|
type: boolean
|
||||||
delete:
|
delete:
|
||||||
description: Array of PENDING job IDs to cancel
|
description: Array of job IDs to cancel; pending and running jobs transition to cancelled
|
||||||
items:
|
items:
|
||||||
type: string
|
type: string
|
||||||
type: array
|
type: array
|
||||||
@ -1822,6 +1851,83 @@ paths:
|
|||||||
summary: Update asset metadata
|
summary: Update asset metadata
|
||||||
tags:
|
tags:
|
||||||
- file
|
- file
|
||||||
|
/api/assets/{id}/content:
|
||||||
|
get:
|
||||||
|
description: |
|
||||||
|
Returns the binary content of an asset by ID.
|
||||||
|
|
||||||
|
The contract is the same across runtimes — "GET this path and you
|
||||||
|
receive the asset's bytes" — but the mechanism differs:
|
||||||
|
- **Local ComfyUI** streams the bytes directly (`200`,
|
||||||
|
`application/octet-stream`).
|
||||||
|
- **Cloud** does not proxy large files; it responds `302` with a
|
||||||
|
`Location` redirect to a short-lived signed storage URL. Clients that
|
||||||
|
follow redirects (browsers, `fetch`/XHR, `<img>`/`<video>`) receive
|
||||||
|
the bytes transparently.
|
||||||
|
|
||||||
|
Prefer this over the filename-addressed `/api/view` when you have an
|
||||||
|
asset ID.
|
||||||
|
operationId: getAssetContent
|
||||||
|
parameters:
|
||||||
|
- description: Asset ID
|
||||||
|
in: path
|
||||||
|
name: id
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
- description: |
|
||||||
|
Content-Disposition for the response: `attachment` (download) or
|
||||||
|
`inline` (render in browser). Defaults to `attachment`.
|
||||||
|
in: query
|
||||||
|
name: disposition
|
||||||
|
schema:
|
||||||
|
default: attachment
|
||||||
|
enum:
|
||||||
|
- inline
|
||||||
|
- attachment
|
||||||
|
type: string
|
||||||
|
responses:
|
||||||
|
"200":
|
||||||
|
content:
|
||||||
|
application/octet-stream:
|
||||||
|
schema:
|
||||||
|
format: binary
|
||||||
|
type: string
|
||||||
|
description: Asset content stream (local runtime streams the bytes directly)
|
||||||
|
"302":
|
||||||
|
description: Redirect to a signed storage URL (cloud runtime)
|
||||||
|
headers:
|
||||||
|
Cache-Control:
|
||||||
|
description: Private caching directive scoped to the signed URL lifetime
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
Location:
|
||||||
|
description: Short-lived signed URL to the asset content in storage
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
Vary:
|
||||||
|
description: Partitions any cached redirect by auth credentials so a private redirect is not reused across users
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
"404":
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/ErrorResponse'
|
||||||
|
description: Asset not found
|
||||||
|
"500":
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/ErrorResponse'
|
||||||
|
description: Internal server error
|
||||||
|
security:
|
||||||
|
- ApiKeyAuth: []
|
||||||
|
- BearerAuth: []
|
||||||
|
- CookieAuth: []
|
||||||
|
summary: Get asset content
|
||||||
|
tags:
|
||||||
|
- file
|
||||||
/api/assets/{id}/tags:
|
/api/assets/{id}/tags:
|
||||||
delete:
|
delete:
|
||||||
description: Removes one or more tags from an existing asset
|
description: Removes one or more tags from an existing asset
|
||||||
@ -2675,14 +2781,20 @@ paths:
|
|||||||
summary: Get internationalisation translation strings
|
summary: Get internationalisation translation strings
|
||||||
/api/interrupt:
|
/api/interrupt:
|
||||||
post:
|
post:
|
||||||
|
deprecated: true
|
||||||
description: |
|
description: |
|
||||||
Cancel all currently RUNNING jobs for the authenticated user.
|
Deprecated. Prefer the jobs-namespace cancel endpoints:
|
||||||
This will interrupt any job that is currently in 'in_progress' status.
|
POST /api/jobs/{job_id}/cancel for a single job, or
|
||||||
Note: This endpoint only affects running jobs. To cancel pending jobs, use /api/queue.
|
POST /api/jobs/cancel to cancel jobs by ID.
|
||||||
|
|
||||||
|
Cancels the first active job for the authenticated user (the currently
|
||||||
|
running job if there is one, otherwise the next pending job). Takes no
|
||||||
|
body and cannot target a specific job — use the jobs-namespace endpoints
|
||||||
|
for that.
|
||||||
operationId: interruptJob
|
operationId: interruptJob
|
||||||
responses:
|
responses:
|
||||||
"200":
|
"200":
|
||||||
description: Success - Job interrupted or no running job found
|
description: Success - first active job cancelled, or no active job found
|
||||||
"401":
|
"401":
|
||||||
content:
|
content:
|
||||||
application/json:
|
application/json:
|
||||||
@ -2695,7 +2807,7 @@ paths:
|
|||||||
schema:
|
schema:
|
||||||
$ref: '#/components/schemas/ErrorResponse'
|
$ref: '#/components/schemas/ErrorResponse'
|
||||||
description: Internal server error
|
description: Internal server error
|
||||||
summary: Interrupt currently running jobs
|
summary: Interrupt the first active job
|
||||||
tags:
|
tags:
|
||||||
- queue
|
- queue
|
||||||
/api/job/{job_id}/status:
|
/api/job/{job_id}/status:
|
||||||
@ -2954,6 +3066,64 @@ paths:
|
|||||||
summary: Cancel a job
|
summary: Cancel a job
|
||||||
tags:
|
tags:
|
||||||
- workflow
|
- workflow
|
||||||
|
/api/jobs/cancel:
|
||||||
|
post:
|
||||||
|
description: |
|
||||||
|
Cancel one or more jobs for the authenticated user in a single request.
|
||||||
|
|
||||||
|
State-agnostic: cancels both pending and running jobs (both transition to
|
||||||
|
the cancelled state via the same mechanism as the single-job endpoint).
|
||||||
|
|
||||||
|
Idempotent per job: a job already in a terminal or cancelling state is a
|
||||||
|
no-op and simply will not appear in the returned `cancelled` list.
|
||||||
|
|
||||||
|
Fail-fast on unknown IDs: if any provided job ID does not exist for this
|
||||||
|
user, the request returns 404 and no jobs are cancelled. This surfaces
|
||||||
|
bad IDs to the caller rather than silently dropping them.
|
||||||
|
|
||||||
|
This is the canonical batch-cancel endpoint. The delete operation on
|
||||||
|
POST /api/queue is deprecated in favour of this.
|
||||||
|
operationId: cancelJobs
|
||||||
|
requestBody:
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/JobsCancelRequest'
|
||||||
|
required: true
|
||||||
|
responses:
|
||||||
|
"200":
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/JobsCancelResponse'
|
||||||
|
description: Success - cancel requests dispatched (or jobs were already terminal)
|
||||||
|
"400":
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/ErrorResponse'
|
||||||
|
description: Bad Request - job_ids is missing, empty, exceeds the maximum count, or contains an invalid UUID
|
||||||
|
"401":
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/ErrorResponse'
|
||||||
|
description: Unauthorized - Authentication required
|
||||||
|
"404":
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/ErrorResponse'
|
||||||
|
description: One or more job IDs not found for this user (no jobs cancelled)
|
||||||
|
"500":
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/ErrorResponse'
|
||||||
|
description: Internal server error - cancellation failed
|
||||||
|
summary: Cancel multiple jobs
|
||||||
|
tags:
|
||||||
|
- workflow
|
||||||
/api/node_replacements:
|
/api/node_replacements:
|
||||||
get:
|
get:
|
||||||
description: |
|
description: |
|
||||||
@ -3104,9 +3274,18 @@ paths:
|
|||||||
tags:
|
tags:
|
||||||
- queue
|
- queue
|
||||||
post:
|
post:
|
||||||
|
deprecated: true
|
||||||
description: |
|
description: |
|
||||||
Cancel specific PENDING jobs by ID or clear all pending jobs in the queue.
|
Deprecated. Prefer the jobs-namespace cancel endpoints:
|
||||||
Note: This endpoint only affects pending jobs. To cancel running jobs, use /api/interrupt.
|
POST /api/jobs/cancel for cancelling jobs by ID, and
|
||||||
|
POST /api/jobs/{job_id}/cancel for a single job.
|
||||||
|
|
||||||
|
Cancel specific jobs by ID (the `delete` field) or clear all pending
|
||||||
|
jobs in the queue (the `clear` field). Despite the `delete` naming, this
|
||||||
|
does not delete anything — listed jobs transition to the cancelled state,
|
||||||
|
and `delete` cancels both pending and running jobs (not pending-only as
|
||||||
|
previously documented). Job-by-ID cancellation is superseded by
|
||||||
|
POST /api/jobs/cancel; `clear` has no jobs-namespace replacement yet.
|
||||||
operationId: manageQueue
|
operationId: manageQueue
|
||||||
requestBody:
|
requestBody:
|
||||||
content:
|
content:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user