> ## 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.

# Store a local ComfyUI installation for the Create a Build wizard

> Stores a short-lived handoff of a local ComfyUI installation (its Desktop snapshot, the models it has installed, and optionally the workflow open in it) so the Create a Build wizard can open pre-filled from it. Local ComfyUI calls this on the user's explicit request with the user's own credential; the wizard then reads it back with GET /v1/import-bundles/{id}. Nothing is resolved or built here: the bundle is stored as sent, and the wizard runs the snapshot and workflow through the existing resolve endpoints.

The bundle belongs to the caller's workspace AND the caller's user (for an API key, the user who created the key). Only that same workspace and user can ever read it; it is never public and never readable by another member of the workspace. It is kept, in the builder's private storage, for 24 hours from creation (expiresAt) and then reads as not found; it is deleted within about two hours after that. A user may hold a limited number of unexpired bundles per workspace (20 by default; each builder deployment sets its own).

The request body must be sent as `application/json` (parameters such as charset are allowed) and is capped in size (31,457,280 bytes, 30 MiB, by default; each builder deployment sets its own, and the 413 message states it). Validation (applied before anything is stored): the body is a JSON object; `snapshot` is an object whose `type` is "comfyui-desktop-2-snapshot" and whose `snapshots` array is non-empty; `models` is a non-null array of at most 50,000 objects, each with a `directory` string of 1-256 characters and a `filename` string of 1-1024 characters; `workflow` is absent, null or an object; `name` is absent, null or a string of at most 200 characters with no NUL (U+0000); `source` is exactly "comfyui"; keys are matched exactly (case-sensitive), and unknown top-level keys are ignored and not stored. `snapshot`, `models` and `workflow` are stored and read back byte for byte, unknown members and large integers included.

Errors carry the identifier a caller branches on, never the wording: `INVALID_IMPORT_BUNDLE` (400) when the body is malformed JSON or breaks any validation rule above, `UNSUPPORTED_MEDIA_TYPE` (415) when it is not sent as application/json, `IMPORT_BUNDLE_TOO_LARGE` (413) when the body exceeds the cap, `IMPORT_BUNDLE_TIMEOUT` (408) when the body does not finish arriving within 60 seconds, `IMPORT_BUNDLE_LIMIT` (429) when the caller already holds its limit of unexpired bundles in this workspace (checked before the body is read, so a caller at its limit can stop sending), `IMPORT_BUNDLE_STORAGE_UNAVAILABLE` (503, no Retry-After) when this builder has no storage configured for import bundles, which no retry fixes, `IMPORT_BUNDLE_IN_PROGRESS` (429, with Retry-After) when the caller already has another import-bundle request (create or read) in progress on the builder instance it reached, and `IMPORT_BUNDLE_BUSY` (503, with Retry-After) when the instance's memory budget for bundles stayed full for 5 seconds; retry either after the given seconds. One caller's slow upload or download never makes another caller's request busy unless the bundles in flight together exceed the budget.




## OpenAPI

````yaml /openapi-builder.yaml post /v1/import-bundles
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/import-bundles:
    post:
      summary: Store a local ComfyUI installation for the Create a Build wizard
      description: >
        Stores a short-lived handoff of a local ComfyUI installation (its
        Desktop snapshot, the models it has installed, and optionally the
        workflow open in it) so the Create a Build wizard can open pre-filled
        from it. Local ComfyUI calls this on the user's explicit request with
        the user's own credential; the wizard then reads it back with GET
        /v1/import-bundles/{id}. Nothing is resolved or built here: the bundle
        is stored as sent, and the wizard runs the snapshot and workflow through
        the existing resolve endpoints.


        The bundle belongs to the caller's workspace AND the caller's user (for
        an API key, the user who created the key). Only that same workspace and
        user can ever read it; it is never public and never readable by another
        member of the workspace. It is kept, in the builder's private storage,
        for 24 hours from creation (expiresAt) and then reads as not found; it
        is deleted within about two hours after that. A user may hold a limited
        number of unexpired bundles per workspace (20 by default; each builder
        deployment sets its own).


        The request body must be sent as `application/json` (parameters such as
        charset are allowed) and is capped in size (31,457,280 bytes, 30 MiB, by
        default; each builder deployment sets its own, and the 413 message
        states it). Validation (applied before anything is stored): the body is
        a JSON object; `snapshot` is an object whose `type` is
        "comfyui-desktop-2-snapshot" and whose `snapshots` array is non-empty;
        `models` is a non-null array of at most 50,000 objects, each with a
        `directory` string of 1-256 characters and a `filename` string of 1-1024
        characters; `workflow` is absent, null or an object; `name` is absent,
        null or a string of at most 200 characters with no NUL (U+0000);
        `source` is exactly "comfyui"; keys are matched exactly
        (case-sensitive), and unknown top-level keys are ignored and not stored.
        `snapshot`, `models` and `workflow` are stored and read back byte for
        byte, unknown members and large integers included.


        Errors carry the identifier a caller branches on, never the wording:
        `INVALID_IMPORT_BUNDLE` (400) when the body is malformed JSON or breaks
        any validation rule above, `UNSUPPORTED_MEDIA_TYPE` (415) when it is not
        sent as application/json, `IMPORT_BUNDLE_TOO_LARGE` (413) when the body
        exceeds the cap, `IMPORT_BUNDLE_TIMEOUT` (408) when the body does not
        finish arriving within 60 seconds, `IMPORT_BUNDLE_LIMIT` (429) when the
        caller already holds its limit of unexpired bundles in this workspace
        (checked before the body is read, so a caller at its limit can stop
        sending), `IMPORT_BUNDLE_STORAGE_UNAVAILABLE` (503, no Retry-After) when
        this builder has no storage configured for import bundles, which no
        retry fixes, `IMPORT_BUNDLE_IN_PROGRESS` (429, with Retry-After) when
        the caller already has another import-bundle request (create or read) in
        progress on the builder instance it reached, and `IMPORT_BUNDLE_BUSY`
        (503, with Retry-After) when the instance's memory budget for bundles
        stayed full for 5 seconds; retry either after the given seconds. One
        caller's slow upload or download never makes another caller's request
        busy unless the bundles in flight together exceed the budget.
      operationId: createImportBundle
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateImportBundleRequest'
      responses:
        '201':
          description: >
            Stored. Hand `id` and `workspaceId` to the wizard; the bundle can be
            opened until expiresAt.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImportBundleCreated'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          description: No valid credential, or the credential names no workspace or user.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          $ref: '#/components/responses/Forbidden'
        '408':
          description: >
            The request body did not finish arriving within 60 seconds
            (IMPORT_BUNDLE_TIMEOUT). Nothing was stored.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '413':
          description: >-
            The request body exceeds this builder's size cap
            (IMPORT_BUNDLE_TOO_LARGE).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '415':
          description: >-
            The request body is not sent as application/json
            (UNSUPPORTED_MEDIA_TYPE).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: >
            Either the caller already holds its limit of unexpired bundles in
            this workspace (IMPORT_BUNDLE_LIMIT), which clears on its own as
            older bundles expire, or (IMPORT_BUNDLE_IN_PROGRESS, with
            Retry-After) the caller already has another import-bundle request in
            progress; retry once it finishes.
          headers:
            Retry-After:
              description: >-
                Seconds to wait before retrying; sent with
                IMPORT_BUNDLE_IN_PROGRESS.
              schema:
                type: integer
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '503':
          description: >
            Either the builder instance's memory budget for import bundles
            stayed full for 5 seconds (IMPORT_BUNDLE_BUSY, with Retry-After), or
            the builder has no storage configured for import bundles
            (IMPORT_BUNDLE_STORAGE_UNAVAILABLE, no Retry-After; retrying does
            not help). Nothing was stored either way.
          headers:
            Retry-After:
              description: Seconds to wait before retrying; sent with IMPORT_BUNDLE_BUSY.
              schema:
                type: integer
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    CreateImportBundleRequest:
      type: object
      required:
        - snapshot
        - models
        - source
      properties:
        snapshot:
          allOf:
            - $ref: '#/components/schemas/ImportBundleSnapshot'
          x-go-type: json.RawMessage
        models:
          type: array
          maxItems: 50000
          x-go-type: json.RawMessage
          description: >
            Every model file installed locally, possibly empty. Not the models
            the workflow needs; the wizard works those out from the workflow.
          items:
            $ref: '#/components/schemas/ImportBundleModel'
        workflow:
          allOf:
            - $ref: '#/components/schemas/ComfyWorkflow'
          nullable: true
          description: >-
            The workflow open in ComfyUI, stored as sent. Absent or null when
            none was sent.
          x-go-type: json.RawMessage
          x-go-type-skip-optional-pointer: true
        name:
          type: string
          nullable: true
          maxLength: 200
          description: Optional label for the bundle, at most 200 characters.
        source:
          type: string
          enum:
            - comfyui
          description: Which client produced the bundle. Always "comfyui".
    ImportBundleCreated:
      type: object
      required:
        - id
        - workspaceId
        - expiresAt
      properties:
        id:
          type: string
          format: uuid
          description: The bundle id to open it by.
        workspaceId:
          type: string
          description: >
            The workspace the bundle belongs to (the caller's). The wizard must
            be in this workspace to open it.
        expiresAt:
          type: string
          format: date-time
          description: When the bundle stops being readable (24 hours after creation).
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: string
          description: Machine-readable error code.
        message:
          type: string
          description: Human-readable detail.
    ImportBundleSnapshot:
      type: object
      description: >
        A ComfyUI Desktop snapshot export (the same format DesktopSnapshot
        reads), constrained for storage: `type` must be
        "comfyui-desktop-2-snapshot" and `snapshots` must be non-empty. Stored
        and returned as sent; feed it to POST /v1/snapshots/resolve to learn
        what it maps to.
      required:
        - type
        - snapshots
      properties:
        type:
          type: string
          enum:
            - comfyui-desktop-2-snapshot
        snapshots:
          type: array
          minItems: 1
          items:
            type: object
            additionalProperties: true
      additionalProperties: true
    ImportBundleModel:
      type: object
      description: >
        One model file installed in the local ComfyUI. Answers "which models
        does the user already have, and where": a folder name plus a path
        relative to it, never an absolute path and never a hash, so it is not
        proof of the file's contents.
      required:
        - directory
        - filename
      properties:
        directory:
          type: string
          minLength: 1
          maxLength: 256
          description: >-
            The ComfyUI model folder name it was found under, e.g. "checkpoints"
            or "loras".
        filename:
          type: string
          minLength: 1
          maxLength: 1024
          description: >
            Path relative to that folder, with any subfolders, as ComfyUI lists
            it (e.g. "sdxl/model.safetensors").
    ComfyWorkflow:
      type: object
      description: >
        A ComfyUI workflow, in either export dialect. The API format is a flat
        object of node id to node, each carrying `class_type` and its values
        under `inputs`. The UI format carries a `nodes` array with positional
        `widgets_values` alongside a `links` array, which is what identifies it,
        and may hold reusable groups under `definitions.subgraphs` that are
        expanded when read.


        Read rather than validated field by field: the node classes and model
        filenames are taken out, and everything else is ignored. A payload that
        matches neither dialect is a 400.
      additionalProperties: true
  responses:
    BadRequest:
      description: Invalid request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Forbidden:
      description: Forbidden
      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.