跳转到主要内容
GET
/
api
/
assets
/
remote-metadata
Get asset metadata from remote 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>"
}

授权

X-API-Key
string
header
必填

API key authentication. Generate an API key from your account settings at https://platform.comfy.org/profile/api-keys. Pass the key in the X-API-Key header.

查询参数

url
string<uri>
必填

Download URL to retrieve metadata from

示例:

"https://civitai.com/api/download/models/123456"

响应

Metadata retrieved successfully

content_length
integer<int64>
必填

Size of the asset in bytes (-1 if unknown)

示例:

4294967296

content_type
string

MIME type of the asset

示例:

"application/octet-stream"

filename
string

Suggested filename for the asset from source

示例:

"realistic-vision-v5.safetensors"

name
string

Display name or title for the asset from source

示例:

"Realistic Vision v5.0"

tags
string[]

Tags for categorization from source

示例:
["models", "checkpoint"]
preview_image
string

Preview image as base64-encoded data URL

示例:

"data:image/jpeg;base64,/9j/4AAQSkZJRg..."

validation
object

Validation results for the file