Skip to content

Commit 8901479

Browse files
feat: add cloud-specific fields to OSS openapi.yaml as nullable (Comfy-Org#13623)
* feat: add cloud-specific fields to OSS openapi.yaml as nullable Add cross-runtime fields with x-runtime: [cloud] extension and [cloud-only] description prefix per the convention established in BE-613. All new fields are nullable and not in required arrays, so they are purely additive. /api/features response: - max_upload_size (integer, int64) - free_tier_credits (integer, int32) - posthog_api_host (string, uri) - max_concurrent_jobs (integer, int32) - workflow_templates_version (string) - workflow_templates_source (string, enum) PromptRequest schema: - workflow_id (string, uuid) - workflow_version_id (string, uuid) POST /api/assets: - id field (uuid) on multipart/form-data for idempotent creation - application/json alternate content-type for URL-based uploads POST /api/assets/from-hash: - mime_type (string) to preserve type without re-inspection PUT /api/assets/{id}: - mime_type (string) for overriding auto-detection GET /api/assets additional query parameters: - job_ids (string) — filter by associated job UUIDs - include_public (boolean) — include workspace-public assets - asset_hash (string) — filter by exact content hash Resolves: BE-613 Blocks: BE-364, BE-361, BE-363 Co-authored-by: Matt Miller <MillerMedia@users.noreply.github.com> * fix(openapi): address CodeRabbit feedback (BE-613) - max_upload_size is set in both runtimes via SERVER_FEATURE_FLAGS; drop the cloud-only / nullable tagging. - Require `url` on the application/json POST /api/assets body so the contract is enforceable by validators and codegen. --------- Co-authored-by: Matt Miller <MillerMedia@users.noreply.github.com>
1 parent 431fadb commit 8901479

1 file changed

Lines changed: 111 additions & 11 deletions

File tree

openapi.yaml

Lines changed: 111 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -631,7 +631,7 @@ paths:
631631
operationId: getFeatures
632632
tags: [system]
633633
summary: Get enabled feature flags
634-
description: Returns a dictionary of feature flag names to their enabled state.
634+
description: Returns a dictionary of feature flag names to their enabled state. Cloud deployments may include additional typed fields alongside the boolean flags.
635635
responses:
636636
"200":
637637
description: Feature flags
@@ -641,6 +641,43 @@ paths:
641641
type: object
642642
additionalProperties:
643643
type: boolean
644+
properties:
645+
max_upload_size:
646+
type: integer
647+
format: int64
648+
minimum: 0
649+
description: "Maximum file upload size in bytes."
650+
free_tier_credits:
651+
type: integer
652+
format: int32
653+
minimum: 0
654+
nullable: true
655+
x-runtime: [cloud]
656+
description: "[cloud-only] Credits available to free-tier users. Local ComfyUI returns null."
657+
posthog_api_host:
658+
type: string
659+
format: uri
660+
nullable: true
661+
x-runtime: [cloud]
662+
description: "[cloud-only] PostHog analytics proxy URL for frontend telemetry. Local ComfyUI returns null."
663+
max_concurrent_jobs:
664+
type: integer
665+
format: int32
666+
minimum: 0
667+
nullable: true
668+
x-runtime: [cloud]
669+
description: "[cloud-only] Maximum concurrent jobs the authenticated user can run. Local ComfyUI returns null."
670+
workflow_templates_version:
671+
type: string
672+
nullable: true
673+
x-runtime: [cloud]
674+
description: "[cloud-only] Version identifier for the workflow templates bundle. Local ComfyUI returns null."
675+
workflow_templates_source:
676+
type: string
677+
nullable: true
678+
enum: [dynamic_config_override, workflow_templates_version_json]
679+
x-runtime: [cloud]
680+
description: "[cloud-only] How the templates version was resolved. Local ComfyUI returns null."
644681

645682
# ---------------------------------------------------------------------------
646683
# Node / Object Info
@@ -1497,6 +1534,24 @@ paths:
14971534
type: string
14981535
enum: [asc, desc]
14991536
description: Sort direction
1537+
- name: job_ids
1538+
in: query
1539+
schema:
1540+
type: string
1541+
x-runtime: [cloud]
1542+
description: "[cloud-only] Comma-separated UUIDs to filter assets by associated job."
1543+
- name: include_public
1544+
in: query
1545+
schema:
1546+
type: boolean
1547+
x-runtime: [cloud]
1548+
description: "[cloud-only] Include workspace-public assets in addition to the caller's own."
1549+
- name: asset_hash
1550+
in: query
1551+
schema:
1552+
type: string
1553+
x-runtime: [cloud]
1554+
description: "[cloud-only] Filter by exact content hash."
15001555
responses:
15011556
"200":
15021557
description: Asset list
@@ -1542,6 +1597,49 @@ paths:
15421597
type: string
15431598
format: uuid
15441599
description: ID of an existing asset to use as the preview image
1600+
id:
1601+
type: string
1602+
format: uuid
1603+
nullable: true
1604+
x-runtime: [cloud]
1605+
description: "[cloud-only] Client-supplied asset ID for idempotent creation. If an asset with this ID already exists, the existing asset is returned."
1606+
application/json:
1607+
schema:
1608+
type: object
1609+
x-runtime: [cloud]
1610+
description: "[cloud-only] URL-based asset upload. Caller supplies a URL instead of a file body; the server fetches the content."
1611+
required:
1612+
- url
1613+
properties:
1614+
url:
1615+
type: string
1616+
format: uri
1617+
description: "[cloud-only] URL of the file to import as an asset"
1618+
name:
1619+
type: string
1620+
description: Display name for the asset
1621+
tags:
1622+
type: string
1623+
description: Comma-separated tags
1624+
user_metadata:
1625+
type: string
1626+
description: JSON-encoded user metadata
1627+
hash:
1628+
type: string
1629+
description: "Blake3 hash of the file content (e.g. blake3:abc123...)"
1630+
mime_type:
1631+
type: string
1632+
description: MIME type of the file (overrides auto-detected type)
1633+
preview_id:
1634+
type: string
1635+
format: uuid
1636+
description: ID of an existing asset to use as the preview image
1637+
id:
1638+
type: string
1639+
format: uuid
1640+
nullable: true
1641+
x-runtime: [cloud]
1642+
description: "[cloud-only] Client-supplied asset ID for idempotent creation. If an asset with this ID already exists, the existing asset is returned."
15451643
responses:
15461644
"201":
15471645
description: Asset created
@@ -1580,6 +1678,11 @@ paths:
15801678
user_metadata:
15811679
type: object
15821680
additionalProperties: true
1681+
mime_type:
1682+
type: string
1683+
nullable: true
1684+
x-runtime: [cloud]
1685+
description: "[cloud-only] MIME type of the content, so the type is preserved without re-inspecting content. Ignored by local ComfyUI."
15831686
responses:
15841687
"201":
15851688
description: Asset created from hash
@@ -1644,6 +1747,11 @@ paths:
16441747
type: string
16451748
format: uuid
16461749
description: ID of the asset to use as the preview
1750+
mime_type:
1751+
type: string
1752+
nullable: true
1753+
x-runtime: [cloud]
1754+
description: "[cloud-only] MIME type override when auto-detection was wrong. Ignored by local ComfyUI."
16471755
responses:
16481756
"200":
16491757
description: Asset updated
@@ -2004,21 +2112,13 @@ components:
20042112
format: uuid
20052113
nullable: true
20062114
x-runtime: [cloud]
2007-
description: |
2008-
UUID identifying a hosted-cloud workflow entity to associate with this
2009-
job. Local ComfyUI doesn't track workflow entities and returns `null`
2010-
(or omits the field). The `x-runtime: [cloud]` extension marks this
2011-
as populated only by the hosted-cloud runtime; absence of the tag
2012-
means a field is populated by all runtimes.
2115+
description: "[cloud-only] Cloud workflow entity ID for tracking and gallery association. Ignored by local ComfyUI."
20132116
workflow_version_id:
20142117
type: string
20152118
format: uuid
20162119
nullable: true
20172120
x-runtime: [cloud]
2018-
description: |
2019-
UUID identifying a hosted-cloud workflow version to associate with
2020-
this job. Local ComfyUI returns `null` (or omits the field). See
2021-
`workflow_id` above for `x-runtime` semantics.
2121+
description: "[cloud-only] Cloud workflow version ID for pinning execution to a specific version. Ignored by local ComfyUI."
20222122

20232123
PromptResponse:
20242124
type: object

0 commit comments

Comments
 (0)