curl --request POST \
--url https://cloud.comfy.org/api/assets/from-hash \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"hash": "<string>",
"tags": [
"<string>"
],
"name": "<string>",
"mime_type": "<string>",
"user_metadata": {}
}
'import requests
url = "https://cloud.comfy.org/api/assets/from-hash"
payload = {
"hash": "<string>",
"tags": ["<string>"],
"name": "<string>",
"mime_type": "<string>",
"user_metadata": {}
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
hash: '<string>',
tags: ['<string>'],
name: '<string>',
mime_type: '<string>',
user_metadata: {}
})
};
fetch('https://cloud.comfy.org/api/assets/from-hash', 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/from-hash",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'hash' => '<string>',
'tags' => [
'<string>'
],
'name' => '<string>',
'mime_type' => '<string>',
'user_metadata' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://cloud.comfy.org/api/assets/from-hash"
payload := strings.NewReader("{\n \"hash\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"name\": \"<string>\",\n \"mime_type\": \"<string>\",\n \"user_metadata\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://cloud.comfy.org/api/assets/from-hash")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"hash\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"name\": \"<string>\",\n \"mime_type\": \"<string>\",\n \"user_metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://cloud.comfy.org/api/assets/from-hash")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"hash\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"name\": \"<string>\",\n \"mime_type\": \"<string>\",\n \"user_metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"size": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"created_new": true,
"asset_hash": "<string>",
"mime_type": "<string>",
"tags": [
"<string>"
],
"user_metadata": {},
"preview_url": "<string>",
"preview_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"prompt_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"last_access_time": "2023-11-07T05:31:56Z",
"is_immutable": true
}{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"size": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"created_new": true,
"asset_hash": "<string>",
"mime_type": "<string>",
"tags": [
"<string>"
],
"user_metadata": {},
"preview_url": "<string>",
"preview_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"prompt_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"last_access_time": "2023-11-07T05:31:56Z",
"is_immutable": true
}{
"code": "<string>",
"message": "<string>"
}{
"code": "<string>",
"message": "<string>"
}{
"code": "<string>",
"message": "<string>"
}{
"code": "<string>",
"message": "<string>"
}기존 해시에서 에셋 참조 생성
클라우드 스토리지의 기존 해시를 사용하여 새 에셋 참조를 생성합니다. 기본 데이터가 이미 존재할 때 파일 콘텐츠를 다시 업로드하지 않아도 되므로, 대용량 파일이나 잘 알려진 에셋을 참조할 때 유용합니다. 사용자는 새 참조에 자신의 메타데이터와 태그를 제공합니다.
curl --request POST \
--url https://cloud.comfy.org/api/assets/from-hash \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"hash": "<string>",
"tags": [
"<string>"
],
"name": "<string>",
"mime_type": "<string>",
"user_metadata": {}
}
'import requests
url = "https://cloud.comfy.org/api/assets/from-hash"
payload = {
"hash": "<string>",
"tags": ["<string>"],
"name": "<string>",
"mime_type": "<string>",
"user_metadata": {}
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
hash: '<string>',
tags: ['<string>'],
name: '<string>',
mime_type: '<string>',
user_metadata: {}
})
};
fetch('https://cloud.comfy.org/api/assets/from-hash', 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/from-hash",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'hash' => '<string>',
'tags' => [
'<string>'
],
'name' => '<string>',
'mime_type' => '<string>',
'user_metadata' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://cloud.comfy.org/api/assets/from-hash"
payload := strings.NewReader("{\n \"hash\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"name\": \"<string>\",\n \"mime_type\": \"<string>\",\n \"user_metadata\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://cloud.comfy.org/api/assets/from-hash")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"hash\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"name\": \"<string>\",\n \"mime_type\": \"<string>\",\n \"user_metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://cloud.comfy.org/api/assets/from-hash")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"hash\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"name\": \"<string>\",\n \"mime_type\": \"<string>\",\n \"user_metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"size": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"created_new": true,
"asset_hash": "<string>",
"mime_type": "<string>",
"tags": [
"<string>"
],
"user_metadata": {},
"preview_url": "<string>",
"preview_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"prompt_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"last_access_time": "2023-11-07T05:31:56Z",
"is_immutable": true
}{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"size": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"created_new": true,
"asset_hash": "<string>",
"mime_type": "<string>",
"tags": [
"<string>"
],
"user_metadata": {},
"preview_url": "<string>",
"preview_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"prompt_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"last_access_time": "2023-11-07T05:31:56Z",
"is_immutable": true
}{
"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 헤더에 키를 전달하세요.
본문
기존 에셋의 해시. Blake3 (blake3:) 또는 SHA256 (sha256:) 형식을 지원합니다
^(blake3|sha256):[a-f0-9]{64}$에셋의 자유 형식 태그. 일반적인 유형은 "models", "input", "output", "temp" 등이 있지만, 모든 태그를 어떤 순서로든 사용할 수 있습니다.
1에셋 참조의 표시 이름 (선택 사항)
에셋의 MIME 유형 (예: "image/png", "video/mp4")
이 에셋 참조의 사용자 정의 메타데이터
응답
에셋 참조가 이미 존재함 (기존 항목 반환)
에셋의 고유 식별자
에셋 파일의 이름
에셋의 크기(바이트 단위)
에셋이 생성된 타임스탬프
에셋이 마지막으로 업데이트된 타임스탬프
이것이 새 에셋 생성(참)인지 아니면 기존 항목 반환(거짓)인지 여부
에셋 콘텐츠의 Blake3 해시
^blake3:[a-f0-9]{64}$에셋의 MIME 유형
에셋과 연결된 태그
에셋의 사용자 정의 메타데이터
에셋 미리보기/썸네일 URL
사용 가능한 경우 미리보기 에셋의 ID
이 에셋을 생성한 작업/프롬프트의 ID (사용 가능한 경우)
에셋이 마지막으로 액세스된 타임스탬프
이 에셋이 불변인지 여부 (수정 또는 삭제할 수 없음)