从远程URL获取资产元数据
curl --request GET \
--url https://cloud.comfy.org/api/assets/remote-metadata \
--header 'X-API-Key: <api-key>'import requests
url = "https://cloud.comfy.org/api/assets/remote-metadata"
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/assets/remote-metadata', 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/assets/remote-metadata",
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/assets/remote-metadata"
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/assets/remote-metadata")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://cloud.comfy.org/api/assets/remote-metadata")
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{
"content_length": 4294967296,
"content_type": "application/octet-stream",
"filename": "realistic-vision-v5.safetensors",
"name": "Realistic Vision v5.0",
"tags": [
"models",
"checkpoint"
],
"preview_image": "data:image/jpeg;base64,/9j/4AAQSkZJRg...",
"validation": {
"is_valid": true,
"errors": [
{
"code": "FORMAT_NOT_ALLOWED",
"message": "File format \"PickleTensor\" is not allowed. Allowed formats: [SafeTensor]",
"field": "format"
}
],
"warnings": [
{
"code": "FORMAT_NOT_ALLOWED",
"message": "File format \"PickleTensor\" is not allowed. Allowed formats: [SafeTensor]",
"field": "format"
}
]
}
}{
"code": "<string>",
"message": "<string>"
}{
"code": "<string>",
"message": "<string>"
}{
"code": "<string>",
"message": "<string>"
}{
"code": "<string>",
"message": "<string>"
}asset
从远程URL获取资产元数据
从远程下载 URL 检索资产的元数据,而无需下载整个文件。 支持包括 CivitAI 和其他模型存储库在内的各种来源。 使用 HEAD 请求或 API 调用高效获取元数据。 此端点用于下载前预览元数据,而非获取现有资产的元数据。
GET
/
api
/
assets
/
remote-metadata
从远程URL获取资产元数据
curl --request GET \
--url https://cloud.comfy.org/api/assets/remote-metadata \
--header 'X-API-Key: <api-key>'import requests
url = "https://cloud.comfy.org/api/assets/remote-metadata"
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/assets/remote-metadata', 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/assets/remote-metadata",
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/assets/remote-metadata"
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/assets/remote-metadata")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://cloud.comfy.org/api/assets/remote-metadata")
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{
"content_length": 4294967296,
"content_type": "application/octet-stream",
"filename": "realistic-vision-v5.safetensors",
"name": "Realistic Vision v5.0",
"tags": [
"models",
"checkpoint"
],
"preview_image": "data:image/jpeg;base64,/9j/4AAQSkZJRg...",
"validation": {
"is_valid": true,
"errors": [
{
"code": "FORMAT_NOT_ALLOWED",
"message": "File format \"PickleTensor\" is not allowed. Allowed formats: [SafeTensor]",
"field": "format"
}
],
"warnings": [
{
"code": "FORMAT_NOT_ALLOWED",
"message": "File format \"PickleTensor\" is not allowed. Allowed formats: [SafeTensor]",
"field": "format"
}
]
}
}{
"code": "<string>",
"message": "<string>"
}{
"code": "<string>",
"message": "<string>"
}{
"code": "<string>",
"message": "<string>"
}{
"code": "<string>",
"message": "<string>"
}授权
API密钥认证。从您的用户设置中生成API密钥 位于https://platform.comfy.org/profile/api-keys。在X-API-Key头中传递密钥。
查询参数
从哪个下载 URL 检索元数据
示例:
"https://civitai.com/api/download/models/123456"
响应
元数据检索成功
资产的字节大小(-1 表示未知)
示例:
4294967296
资产的 MIME 类型
示例:
"application/octet-stream"
从来源建议的资产文件名
示例:
"realistic-vision-v5.safetensors"
从来源的资产显示名称或标题
示例:
"Realistic Vision v5.0"
来自来源的分类标签
示例:
["models", "checkpoint"]
作为 base64 编码的数据 URL 的预览图像
示例:
"data:image/jpeg;base64,/9j/4AAQSkZJRg..."
文件的验证结果
Show child attributes
Show child attributes
⌘I