跳转到主要内容
GET
/
api
/
view
查看文件
curl --request GET \
  --url https://cloud.comfy.org/api/view \
  --header 'X-API-Key: <api-key>'
import requests

url = "https://cloud.comfy.org/api/view"

headers = {"X-API-Key": "<api-key>"}

response = requests.get(url, headers=headers)

print(response.text)
const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};

fetch('https://cloud.comfy.org/api/view', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://cloud.comfy.org/api/view",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"net/http"
"io"
)

func main() {

url := "https://cloud.comfy.org/api/view"

req, _ := http.NewRequest("GET", url, nil)

req.Header.Add("X-API-Key", "<api-key>")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.get("https://cloud.comfy.org/api/view")
.header("X-API-Key", "<api-key>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://cloud.comfy.org/api/view")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'

response = http.request(request)
puts response.read_body
"<string>"
{
"code": "<string>",
"message": "<string>"
}
{
"code": "<string>",
"message": "<string>"
}
{
"code": "<string>",
"message": "<string>"
}

授权

X-API-Key
string
header
必填

API密钥认证。从您的用户设置中生成API密钥 位于https://platform.comfy.org/profile/api-keys。在X-API-Key头中传递密钥。

查询参数

filename
string
必填

要查看的文件名

示例:

"ComfyUI_00004_.png"

subfolder
string

文件所在的子文件夹路径。 注意: 为 ComfyUI API 兼容性而接受,但在云端忽略。 云端使用内容寻址存储,其中资产仅按哈希存储。 子文件夹是客户端 UI 元数据,不用于存储查找。

示例:

"tests/foo/bar"

type
string

文件类型(例如,输出、输入、临时)。 注意: 在云端,outputtemp 文件都存储在同一个存储桶中。 类型参数用于兼容性,但存储位置由哈希决定。

示例:

"output"

fullpath
string

文件的完整路径(用于临时文件)

format
string

文件格式

frame_rate
integer

视频文件的帧率

workflow
string

工作流标识符

timestamp
integer

时间戳参数

示例:

"1234567890"

channel
string

从PNG图像中提取的图像通道。

  • 'rgb': 仅返回RGB通道(透明度设为完全不透明)
  • 'a' 或 'alpha': 返回透明度通道作为灰度图像
  • 如果未指定,则通过重定向返回原始图像不变
示例:

"rgb"

响应

成功 - 返回文件内容(当存在通道参数时使用)

处理后的PNG图像,包含提取的通道