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

# Read a ComfyUI Desktop snapshot as a build definition

> Turns a Desktop snapshot export into the definition it maps to, without writing anything. A snapshot describes a machine; a definition describes something the builder can reproduce, and most but not all of a snapshot survives that translation. Everything that does not is named in the report rather than dropped, because a pack that quietly vanishes between the import and the build is the failure this endpoint exists to avoid.

Every pack the snapshot attributes to the Comfy Registry is checked against the registry before the pin is believed, so a pack that was never published is reported here instead of failing deep inside a build. A registry that cannot be reached leaves its pins alone: the cut still catches a pin it cannot resolve, and dropping one over a network fault would mangle an import the registry never objected to.

A 400 carries the identifier a caller branches on, never the wording: `INVALID_REQUEST` when no snapshot was sent, `INVALID_SNAPSHOT` when the payload is not a Desktop export, and `SNAPSHOT_TOO_LARGE` when it names more custom nodes than a definition may hold.

Use POST /v1/builds/from-snapshot to create the build in one call instead.




## OpenAPI

````yaml /openapi-builder.yaml post /v1/snapshots/resolve
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/snapshots/resolve:
    post:
      summary: Read a ComfyUI Desktop snapshot as a build definition
      description: >
        Turns a Desktop snapshot export into the definition it maps to, without
        writing anything. A snapshot describes a machine; a definition describes
        something the builder can reproduce, and most but not all of a snapshot
        survives that translation. Everything that does not is named in the
        report rather than dropped, because a pack that quietly vanishes between
        the import and the build is the failure this endpoint exists to avoid.


        Every pack the snapshot attributes to the Comfy Registry is checked
        against the registry before the pin is believed, so a pack that was
        never published is reported here instead of failing deep inside a build.
        A registry that cannot be reached leaves its pins alone: the cut still
        catches a pin it cannot resolve, and dropping one over a network fault
        would mangle an import the registry never objected to.


        A 400 carries the identifier a caller branches on, never the wording:
        `INVALID_REQUEST` when no snapshot was sent, `INVALID_SNAPSHOT` when the
        payload is not a Desktop export, and `SNAPSHOT_TOO_LARGE` when it names
        more custom nodes than a definition may hold.


        Use POST /v1/builds/from-snapshot to create the build in one call
        instead.
      operationId: resolveSnapshot
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SnapshotResolveRequest'
      responses:
        '200':
          description: >
            The snapshot was read. An empty report means everything in it
            translated, which is a normal outcome and not a guarantee the build
            will succeed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SnapshotResolveResult'
        '400':
          $ref: '#/components/responses/BadRequest'
components:
  schemas:
    SnapshotResolveRequest:
      type: object
      required:
        - snapshot
      properties:
        snapshot:
          $ref: '#/components/schemas/DesktopSnapshot'
        baseImageId:
          type: string
          description: >
            Build on this base image rather than the one the snapshot's Python
            selects. The report still says whether the choice fits the snapshot.
    SnapshotResolveResult:
      type: object
      required:
        - definition
        - report
      properties:
        definition:
          $ref: '#/components/schemas/Definition'
        report:
          $ref: '#/components/schemas/SnapshotImportReport'
        installationName:
          type: string
          description: >-
            The name Desktop gave the install, as a starting point for the
            build's name.
        comfyVersion:
          type: string
          description: >-
            The upstream ComfyUI release the install is on. Empty when the
            snapshot does not vouch for one.
        pythonVersion:
          type: string
          description: >-
            The Python the install ran on, which is what the pins were resolved
            against.
        nodes:
          type: array
          description: Every pack the snapshot named, as it was read.
          items:
            $ref: '#/components/schemas/SnapshotNode'
    DesktopSnapshot:
      type: object
      description: >
        A ComfyUI Desktop snapshot export, exactly as Desktop writes it. Read
        rather than validated field by field: what the builder can install from
        is carried across, and what it cannot is reported. A payload that is not
        a Desktop export at all is a 400.


        Only the FIRST entry in `snapshots` is read — Desktop lists newest
        first, so that is the state the machine is in. An export-all envelope's
        remaining entries are history and are ignored, so trim before sending:
        they cost request size for nothing, and the request is bounded like
        every other. A snapshot naming more custom nodes than a definition may
        hold is a 400.


        An optional top-level `models` list, `[{folder, name, size}]`, names the
        model files the install has on disk: the ComfyUI model folder kind, the
        name relative to it, and the size in bytes. It is carried into the
        report as localModels, never into the definition. A malformed entry is
        dropped on its own, and a `models` that is not a list is ignored. A
        top-level `modelsTruncated: true` says the sender cut the list itself,
        and is passed on as localModelsTruncated.
      additionalProperties: true
    Definition:
      type: object
      description: >
        The user's environment choices (nodes, models, base version). Free-form
        for MVP, except that a field named like a known one in another case
        (customnodes for customNodes) is rejected: create and update refuse one
        they bring in, and check and cut refuse it wherever it sits. A public
        custom node declares an https github.com repository URL plus an optional
        gitRef (absent means the default branch); a private one references an
        uploaded blobId; exactly one of the two per node. A model declares a
        type (the ComfyUI model folder it lands in, e.g. checkpoints, loras,
        vae) plus exactly one source, a public sourceUri (https) or a private
        blobId, and an optional filename and sha256; the built release records
        each model so it can be placed at deploy time (models are not baked into
        the image). A CivitAI sourceUri is saved without its token query
        parameter and any user:password@ part, since a deployment downloads
        CivitAI links with the platform's own token, so a saved definition can
        read back without them. A CivitAI sourceUri (civitai.com or civitai.red,
        with or without www.) should be a download link
        (https://civitai.com/api/download/models/<versionId>) or a model page
        link (https://civitai.com/models/<modelId>), since a deployment can
        download no other CivitAI link: create and update warn on any other, and
        check and cut refuse it. An optional baseImage names the curated base
        image (the CUDA/Python/torch runtime the build is built on) by id;
        omitted means the default, and an unrecognized id is rejected (only
        images we build are selectable, never an arbitrary ref). pipDependencies
        is a requirements.txt string (one requirement per line). A version pin
        (`numpy<2.5`) is applied as an override in the single dependency
        resolution, so it beats every other declaration of that package; it
        forces a version rather than adding a package, so use it to correct
        versions your nodes already bring in, and the build warns about a pin
        nothing else requires. A direct reference to an https wheel (`nunchaku @
        https://host/nunchaku-1.0.1-cp311-cp311-linux_x86_64.whl`) is instead a
        root of the resolution and adds that package, which is how an engine
        published only as a wheel outside PyPI gets in; an optional `#sha256=`
        fragment on the address is verified at install. Local paths, file: URLs,
        git+ references and addresses carrying credentials are dropped with a
        warning, and so is an address for a package a version pin in the same
        blob also names, whatever markers either line carries, because the pin
        would replace the address in the resolution. modelPolicy,
        partnerNodePolicy and customNodePolicy are allow/deny lists for which
        models, partner nodes and custom nodes the build permits: each is an
        object with a mode of "allowlist" (allow only the list) or "blocklist"
        (allow all except the list) plus a list of string ids. An optional
        uiOrigin string records which client flow authored the definition; the
        platform currently writes "desktop-snapshot" or "comfyui-bundle". It is
        attribution only: stored and read back as sent, never validated, and it
        changes nothing about the build (the worker reports it, truncated to 64
        characters, as ui_origin on its build analytics events).
      additionalProperties: true
    SnapshotImportReport:
      type: object
      description: >
        What a snapshot could not carry into its definition. Everything here is
        advisory: the definition is still usable, and each entry names something
        the user may want to fix before building.


        An empty list is omitted rather than sent as [], so an absent field
        carries no claim in either direction: it does not assert that the check
        ran and found nothing.
      required:
        - pythonSatisfied
      properties:
        unresolvedNodes:
          type: array
          description: >-
            Packs the definition cannot install, by name — no fetchable remote
            in the snapshot, or a registry pin the registry disowned. This is a
            superset: every name in notInRegistry and registryPending also
            appears here, because a pack the snapshot attributed to the registry
            has no other source to fall back on. Render one or the other, not
            both.
          items:
            type: string
        notInRegistry:
          type: array
          description: >-
            Packs whose registry pin the registry does not have, by name. The
            pin is wrong; remove the pack or upload it privately.
          items:
            type: string
        registryPending:
          type: array
          description: >-
            Packs the registry has but has not finished publishing, by name. The
            pin is right and the import is worth retrying later.
          items:
            type: string
        skippedPins:
          type: array
          description: >-
            Packages left out because the build already decides them (the
            accelerator stack, ComfyUI's own packages, OS-specific wheels), by
            name.
          items:
            type: string
        unpinnablePins:
          type: array
          description: >-
            Packages with no PyPI version to write, by name — an editable or
            direct reference rather than a released version.
          items:
            type: string
        collidingNodes:
          type: array
          description: >-
            Packs left out because another pack already claimed the directory
            they would install into, by name. The folder is derived the way the
            cut derives it, from the registry id or the repository basename, so
            a fork and its upstream collide just as two registry ids differing
            only in case do. Cutting a release from a definition carrying both
            is refused, so importing both would hand the caller a build that
            cannot be built. The first pack to claim a folder is kept, the rest
            are named here, and none of them appear in nodes.
          items:
            type: string
        droppedComfyVersion:
          type: string
          description: >-
            The ComfyUI release the snapshot named and the import would not use,
            because it is not a git ref this can pass to the cut. Present so a
            caller can say which release was refused instead of showing an empty
            version field. Absent when the snapshot named a usable release, or
            named none at all.
        unverifiedPins:
          type: array
          description: >-
            Packs the registry never answered about, by name. Their pins are
            carried unchanged, and this says only that nothing confirmed them,
            so a registry outage cannot be mistaken for an import that verified
            clean. The cut remains the authority on a pin that cannot resolve.
          items:
            type: string
        localModels:
          type: array
          maxItems: 2000
          description: >-
            The model files the install had on disk, read from the export's
            top-level `models` list, sorted by folder then name and
            de-duplicated. Not a loss like the fields above: a definition cannot
            hold a model with no download source, so the list rides here for a
            caller to match against what Cloud can supply. An entry whose folder
            or name looks like a path on the machine is dropped. Absent when the
            export carried no usable list.
          items:
            $ref: '#/components/schemas/SnapshotLocalModel'
        localModelsTruncated:
          type: boolean
          description: >-
            True when localModels is not the whole library: either the export
            set its own `modelsTruncated: true` (Desktop cuts the list before
            sending it), or it listed more than an import keeps (2,000), in
            which case 2,000 are kept by taking from each folder in turn. Absent
            otherwise.
        pythonSatisfied:
          type: boolean
          description: >
            False when the chosen base image's Python does not match the one the
            snapshot's pins were resolved on, so a pin may reject the wheels
            that install worked with. True also when nothing could be compared.
    SnapshotNode:
      type: object
      description: >
        One custom node as the snapshot described it, before the definition
        decided what to do with it. Carried so a caller with its own node
        catalog can still place a pack the definition had to leave out, for
        example one naming a registry id with no pinnable version.
      required:
        - name
      properties:
        name:
          type: string
        cnrId:
          type: string
          description: The Comfy Registry id, for a pack installed from the registry.
        registryVersion:
          type: string
          description: >-
            A pinnable registry package version. Absent when the snapshot
            recorded none the builder can pin.
        repository:
          type: string
          description: >-
            The normalized https://github.com/{org}/{repo} the pack was cloned
            from.
        commit:
          type: string
          description: The commit the pack was checked out at.
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: string
          description: Machine-readable error code.
        message:
          type: string
          description: Human-readable detail.
    SnapshotLocalModel:
      type: object
      description: >-
        One model file on the install, never a path on the machine. The same
        idea as ImportBundleModel ({directory, filename}), which is what local
        ComfyUI uploads in an import bundle and is stored as sent. This is what
        the builder kept after checking a Desktop snapshot's list: the folder
        and name passed the path checks below and carry an optional size, so the
        limits are tighter and the field names follow the snapshot.
      required:
        - folder
        - name
      properties:
        folder:
          type: string
          maxLength: 64
          description: >-
            The ComfyUI model folder kind the file sits in (checkpoints, loras,
            or a pack's own such as ipadapter), as ComfyUI names it.
        name:
          type: string
          maxLength: 255
          description: >-
            The file's name relative to that folder, as a loader lists it, with
            "/" between subfolders (sdxl/foo.safetensors). Kept exactly as sent,
            leading and trailing spaces included, except that backslashes are
            turned into "/". At most 255 characters (Unicode code points, not
            bytes); a name with a control, line separator or bidi control
            character is dropped.
        size:
          type: integer
          format: int64
          minimum: 0
          description: >-
            The file's size in bytes. Absent when the export did not give a
            whole, non-negative number.
  responses:
    BadRequest:
      description: Invalid request
      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.