> ## Documentation Index
> Fetch the complete documentation index at: https://docs.comfy.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Cut and build a release

> Freezes the current definition and starts a build. A retry of the same definition returns the same release (dedupe by manifest_sha256) rather than making a second, and re-drives that release's builds: a target whose build failed is built again, so a transient failure is recovered by re-cutting. There is no separate build route. The cut checks the definition before it looks for that release, so a retry whose baseComfyVersion is a branch or commit upstream ComfyUI has since dropped answers 400 INVALID_DEFINITION instead; the release it made stays deployable. A new release is also refused with 400 INVALID_DEFINITION, at `models[<n>].sha256`, when a model's declared sha256 differs from the one its link's host states; a host that states none, errs or is out of time never refuses.
The returned status is the release's status as it stood before the re-drive, so poll statusUrl rather than treating it as final.




## OpenAPI

````yaml /openapi-builder.yaml post /v1/builds/{id}/releases
openapi: 3.0.3
info:
  title: Comfy Builder API
  version: 0.1.0
  description: >
    Builder owns builds (editable environment definitions) and cuts immutable,
    deployable releases that Deploy later runs.
servers:
  - url: https://platformapi.comfy.org/builder
    description: Comfy Developer Platform
security:
  - BearerAuth: []
  - ApiKeyAuth: []
paths:
  /v1/builds/{id}/releases:
    post:
      summary: Cut and build a release
      description: >
        Freezes the current definition and starts a build. A retry of the same
        definition returns the same release (dedupe by manifest_sha256) rather
        than making a second, and re-drives that release's builds: a target
        whose build failed is built again, so a transient failure is recovered
        by re-cutting. There is no separate build route. The cut checks the
        definition before it looks for that release, so a retry whose
        baseComfyVersion is a branch or commit upstream ComfyUI has since
        dropped answers 400 INVALID_DEFINITION instead; the release it made
        stays deployable. A new release is also refused with 400
        INVALID_DEFINITION, at `models[<n>].sha256`, when a model's declared
        sha256 differs from the one its link's host states; a host that states
        none, errs or is out of time never refuses.

        The returned status is the release's status as it stood before the
        re-drive, so poll statusUrl rather than treating it as final.
      operationId: cutRelease
      parameters:
        - $ref: '#/components/parameters/PathID'
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CutReleaseRequest'
      responses:
        '202':
          description: Accepted; poll statusUrl.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CutReleaseResult'
        '400':
          description: The definition has problems.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationError'
        '402':
          $ref: '#/components/responses/SubscriptionRequired'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/ReleaseLimit'
        '429':
          $ref: '#/components/responses/ConcurrencyLimit'
components:
  parameters:
    PathID:
      name: id
      in: path
      required: true
      schema:
        type: string
  schemas:
    CutReleaseRequest:
      type: object
      properties:
        targets:
          type: array
          description: Defaults to a single linux/nvidia target when omitted.
          items:
            $ref: '#/components/schemas/Target'
    CutReleaseResult:
      type: object
      required:
        - releaseId
        - status
        - statusUrl
      properties:
        releaseId:
          type: string
        status:
          $ref: '#/components/schemas/ReleaseStatus'
        statusUrl:
          type: string
        queuePosition:
          type: integer
          description: >-
            Not sent: a new release at the running-build cap is refused with 429
            (CONCURRENCY_LIMIT) rather than queued.
    ValidationError:
      type: object
      required:
        - error
        - invalid
      properties:
        error:
          type: string
          description: >-
            INVALID_DEFINITION, or, from POST /v1/builds/{id}/validate only,
            INVALID_WORKFLOW or WORKFLOW_TOO_LARGE for the workflow it was sent.
        invalid:
          type: array
          items:
            $ref: '#/components/schemas/ValidationIssue'
        workflowCoverage:
          $ref: '#/components/schemas/WorkflowCoverage'
        warnings:
          type: array
          description: >-
            POST /v1/builds/{id}/validate only: the non-blocking advisories it
            found beside the problems, such as a model link a deployment could
            not download at `models[<n>].sourceUri`. A release cut never sets
            it.
          items:
            $ref: '#/components/schemas/ValidationIssue'
        resolved:
          type: object
          additionalProperties: true
          description: >-
            POST /v1/builds/{id}/validate only: the definition as saved, so a
            caller can name the model a `models[<n>]` finding is about. A
            release cut never sets it.
    Target:
      type: object
      required:
        - os
        - gpu
      properties:
        os:
          type: string
          enum:
            - linux
            - windows
            - mac
        gpu:
          type: string
          enum:
            - nvidia
            - amd
            - cpu
            - mps
        accelVariant:
          type: string
          readOnly: true
          description: >
            Accelerator build variant, e.g. cu128. Part of the target identity.
            Server-derived from the gpu and the release's base image: exactly
            one variant is valid per pair, so a value sent on a request is
            IGNORED. Present on responses to report what was built.
    ReleaseStatus:
      type: string
      description: >
        Closed enum for a release's build lifecycle: queued (nothing started),
        building (a target is in flight), stopping (a target is stopping),
        stopped (all targets are terminal and some stopped), complete (all
        targets are terminal and none stopped). It says only whether the build
        is DONE, not whether it succeeded or is deployable. A complete release
        may have built all, some, or none of its targets; see artifactCounts and
        deployable. Adding or retrying a target reopens it to building.
      enum:
        - queued
        - building
        - complete
        - stopping
        - stopped
    ValidationIssue:
      type: object
      required:
        - field
        - reason
      properties:
        field:
          type: string
        reason:
          type: string
    WorkflowCoverage:
      type: object
      description: >
        Which of a workflow's custom node classes a definition installs. Every
        such class is counted in `covered`, listed under one pack in `missing`,
        or listed in `unverified`, exactly once.
      required:
        - format
        - complete
        - covered
        - missing
        - unverified
      properties:
        format:
          type: string
          description: >-
            Which export dialect the file was read as, `api` or `ui` (the same
            values as WorkflowResolveResult's `format`).
        complete:
          type: boolean
          description: >
            True only when the definition provably installs every custom class:
            nothing missing and nothing unverified. Not a statement about
            models, Python packages or partner access.
        covered:
          type: integer
          description: How many distinct custom classes the definition provides.
        missing:
          type: array
          description: The packs to add, sorted by `packId`.
          items:
            $ref: '#/components/schemas/WorkflowMissingPack'
        unverified:
          type: array
          description: The classes nothing could decide, sorted by `classType`.
          items:
            $ref: '#/components/schemas/WorkflowUnverifiedClass'
    PaymentRequiredError:
      type: object
      description: >
        A 402 body. error is always PAYMENT_REQUIRED; reason says which gate
        refused. This service refuses only a workspace an operator blocked, so
        every 402 it sends carries spend_blocked -- the enum matches the deploy
        API's so one client can branch on one vocabulary across both.
      required:
        - error
        - reason
      properties:
        error:
          type: string
          description: Machine-readable error code. Always PAYMENT_REQUIRED.
        message:
          type: string
          description: Human-readable detail.
        reason:
          type: string
          description: >
            no_credit_balance: the workspace has neither an active subscription
            nor a positive credit balance, so subscribing or topping up clears
            it. No longer sent by this service. spend_blocked: an operator
            blocked this workspace, which topping up does not clear.
          enum:
            - no_credit_balance
            - spend_blocked
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: string
          description: Machine-readable error code.
        message:
          type: string
          description: Human-readable detail.
    WorkflowMissingPack:
      type: object
      description: >-
        A pack the registry names for the workflow's classes and the definition
        lacks.
      required:
        - packId
        - classes
      properties:
        packId:
          type: string
          description: >-
            The registry id, or the clone URL for a pack the registry does not
            publish.
        name:
          type: string
        repository:
          type: string
        latestVersion:
          type: string
          description: >-
            The registry's newest published version, the one known to carry
            these classes.
        classes:
          type: array
          description: The workflow's classes this pack provides, sorted.
          items:
            type: string
    WorkflowUnverifiedClass:
      type: object
      required:
        - classType
        - reason
      properties:
        classType:
          type: string
        reason:
          type: string
          enum:
            - unknownClass
            - lookupFailed
            - pinnedVersion
            - otherRepository
            - stampOnly
            - uploadedPack
            - unmatchedUpload
          description: >
            unknownClass: nothing attributes the class to a pack. lookupFailed:
            the registry did not answer for its pack. pinnedVersion: the pack is
            in the definition at a registry version other than the latest, or at
            a git ref or commit. otherRepository: an entry carries the pack's
            registry id but installs from a different repository, such as a
            fork. stampOnly: the pack is in the definition, but only the pack
            the workflow file stamped on the class, or for a class with no
            registry stamp the registry's class index, attributes the class to
            it, so the pack may no longer ship it. uploadedPack: the pack is in
            the definition as an uploaded file. unmatchedUpload: the pack is
            absent by id and repository, but the definition holds an upload that
            may be it.
        packId:
          type: string
          description: The pack the class is attributed to, when one is known.
  responses:
    SubscriptionRequired:
      description: >
        An operator blocked the workspace (PAYMENT_REQUIRED, reason
        spend_blocked). A workspace with no credit is not refused here; it is
        held to the Standard plan's caps and asked for credit when it deploys.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/PaymentRequiredError'
    Forbidden:
      description: Forbidden
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: Not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    ReleaseLimit:
      description: >
        The workspace holds as many build versions as maxTotalReleases allows
        (RELEASE_LIMIT). Not ConcurrencyLimit, which bounds how many are
        building at once. Retrying alone never clears this: the workspace has to
        delete a build version it no longer needs, or delete the build, which
        removes all its versions, or move to a plan with a higher limit.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    ConcurrencyLimit:
      description: >
        The workspace has as many builds running at once as maxRunningBuilds
        allows (CONCURRENCY_LIMIT). Not ReleaseLimit, which bounds how many
        build versions it holds in total. Deleting a build version does not
        clear this one: the delete does not stop the build that version started,
        which keeps its place here until it finishes.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >
        A workspace-scoped Cloud JWT. A missing or invalid token is 401
        UNAUTHORIZED in the Error body.
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: >
        A workspace API key, sent alone. The service checks it on every request
        and acts as the key's user in the key's workspace. A request carrying a
        key and a Bearer token is 400 INVALID_REQUEST, and a value that is not a
        key's shape is 401 UNAUTHORIZED. A refused key answers 401
        (UNAUTHORIZED), 403 (FORBIDDEN), 404 (NOT_FOUND) or 429 (RATE_LIMITED)
        with its message and Retry-After; a 503 (SERVICE_UNAVAILABLE) means the
        key could not be checked right now, so retry. Each refusal answers the
        Error body.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.