> ## Documentation Index
> Fetch the complete documentation index at: https://dripart-feat-openapi-i18n.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# 查看文件

> 从 ComfyUI 文件系统中检索并查看文件。
该端点通常用于查看已生成的图像或其他输出文件。




## OpenAPI

````yaml /openapi/cloud.zh.yaml get /api/view
openapi: 3.0.3
info:
  title: Comfy Cloud API
  description: >
    <警告>

    **实验性API：** 此API是实验性的，可能会更改。

    端点、请求/响应格式和行为可能在未经通知的情况下修改。

    </警告>


    用于Comfy Cloud的API - 在云基础设施上运行ComfyUI工作流。


    此API允许您以编程方式与Comfy Cloud交互，包括：

    - 提交和管理工作流

    - 上传和下载文件

    - 监控作业状态和进度


    ## 云端与OSS ComfyUI兼容性


    Comfy Cloud实现了与OSS ComfyUI相同的API接口以实现最大兼容性，

    但某些字段为了兼容性被接受，但处理方式不同或被忽略：


    | 字段 | 端点 | 云端行为 |

    |-------|-----------|----------------|

    | `subfolder` | `/api/view`, `/api/upload/*` | **忽略** -
    云端使用内容寻址存储（基于哈希）。在响应中返回用于客户端组织。 |

    | `type` (input/output/temp) | `/api/view`, `/api/upload/*` | 部分使用 -
    所有文件使用基于标签的组织存储，而非目录结构。 |

    | `overwrite` | `/api/upload/*` | **忽略** - 内容寻址存储意味着相同内容始终具有相同哈希。 |

    | `number`, `front` | `/api/prompt` | **忽略** - 云端使用自己的每个用户公平队列调度。 |

    | `split`, `full_info` | `/api/userdata` | **忽略** - 云端始终返回完整文件元数据。 |


    这些字段保留在API模式中，以便与现有ComfyUI客户端和工作流进行即插即用兼容。
  version: 1.0.0
  license:
    name: GNU General Public License v3.0
    url: https://github.com/Comfy-Org/ComfyUI/blob/master/LICENSE
servers:
  - url: https://cloud.comfy.org
    description: Comfy Cloud API
security:
  - ApiKeyAuth: []
tags:
  - name: workflow
    description: |
      提交工作流执行并管理执行队列。
      这是在云端运行ComfyUI工作流的主要方式。
  - name: job
    description: |
      监控任务状态、查看执行历史和管理运行中的任务。
      任务通过POST /api/prompt提交工作流时创建。
  - name: asset
    description: |
      上传、下载和管理持久资产（图像、模型、输出）。
      资产提供持久存储，支持标签和元数据。
  - name: file
    description: |
      与传统本地ComfyUI兼容的传统文件上传和下载端点。
      对于新的集成，请考虑使用资产API。
  - name: model
    description: |
      浏览可用的AI模型。模型已预加载到云端基础设施上。
  - name: node
    description: |
      获取可用ComfyUI节点及其输入/输出的信息。
      对构建动态工作流界面很有用。
  - name: user
    description: |
      用户账户信息和个人数据存储。
  - name: system
    description: |
      服务器状态、健康检查和系统信息。
paths:
  /api/view:
    get:
      tags:
        - file
      summary: 查看文件
      description: |
        从 ComfyUI 文件系统中检索并查看文件。
        该端点通常用于查看已生成的图像或其他输出文件。
      operationId: viewFile
      parameters:
        - name: filename
          in: query
          required: true
          description: 要查看的文件名
          schema:
            type: string
            example: ComfyUI_00004_.png
        - name: subfolder
          in: query
          required: false
          description: |
            文件所在的子文件夹路径。
            **注意：** 为 ComfyUI API 兼容性而接受，但在**云端**被**忽略**。
            云端使用内容寻址存储，其中资产仅按哈希存储。
            子文件夹是客户端 UI 元数据，不用于存储查找。
          schema:
            type: string
            example: tests/foo/bar
        - name: type
          in: query
          required: false
          description: |
            文件类型（例如，输出、输入、临时）。
            **注意：** 在云端，`output` 和 `temp` 文件都存储在同一个存储桶中。
            类型参数用于兼容性，但存储位置由哈希决定。
          schema:
            type: string
            example: output
        - name: fullpath
          in: query
          required: false
          description: 文件的完整路径（用于临时文件）
          schema:
            type: string
        - name: format
          in: query
          required: false
          description: 文件格式
          schema:
            type: string
        - name: frame_rate
          in: query
          required: false
          description: 视频文件的帧率
          schema:
            type: integer
        - name: workflow
          in: query
          required: false
          description: 工作流标识符
          schema:
            type: string
        - name: timestamp
          in: query
          required: false
          description: 时间戳参数
          schema:
            type: integer
            example: '1234567890'
        - name: channel
          in: query
          required: false
          description: |
            从PNG图像中提取的图像通道。
            - 'rgb': 仅返回RGB通道（透明度设为完全不透明）
            - 'a' 或 'alpha': 返回透明度通道作为灰度图像
            - 如果未指定，则通过重定向返回原始图像不变
          schema:
            type: string
            example: rgb
      responses:
        '200':
          description: 成功 - 返回文件内容（当存在通道参数时使用）
          content:
            image/png:
              schema:
                type: string
                format: binary
                description: 处理后的PNG图像，包含提取的通道
        '302':
          description: 重定向到GCS签名URL
          headers:
            Location:
              description: 访问GCS中文件的签名URL
              schema:
                type: string
        '400':
          description: 无效的请求参数
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: 文件未找到或未经授权
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: 内部服务器错误
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    ErrorResponse:
      type: object
      required:
        - code
        - message
      properties:
        code:
          type: string
        message:
          type: string
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: |
        API密钥认证。从您的用户设置中生成API密钥
        位于https://platform.comfy.org/profile/api-keys。在X-API-Key头中传递密钥。

````