curl --request POST \
--url https://cloud.comfy.org/api/assets/download \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"source_url": "https://huggingface.co/runwayml/stable-diffusion-v1-5/resolve/main/v1-5-pruned.safetensors",
"tags": [
"<string>"
],
"user_metadata": {},
"preview_id": "550e8400-e29b-41d4-a716-446655440000"
}
'import requests
url = "https://cloud.comfy.org/api/assets/download"
payload = {
"source_url": "https://huggingface.co/runwayml/stable-diffusion-v1-5/resolve/main/v1-5-pruned.safetensors",
"tags": ["<string>"],
"user_metadata": {},
"preview_id": "550e8400-e29b-41d4-a716-446655440000"
}
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({
source_url: 'https://huggingface.co/runwayml/stable-diffusion-v1-5/resolve/main/v1-5-pruned.safetensors',
tags: ['<string>'],
user_metadata: {},
preview_id: '550e8400-e29b-41d4-a716-446655440000'
})
};
fetch('https://cloud.comfy.org/api/assets/download', 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/download",
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([
'source_url' => 'https://huggingface.co/runwayml/stable-diffusion-v1-5/resolve/main/v1-5-pruned.safetensors',
'tags' => [
'<string>'
],
'user_metadata' => [
],
'preview_id' => '550e8400-e29b-41d4-a716-446655440000'
]),
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/download"
payload := strings.NewReader("{\n \"source_url\": \"https://huggingface.co/runwayml/stable-diffusion-v1-5/resolve/main/v1-5-pruned.safetensors\",\n \"tags\": [\n \"<string>\"\n ],\n \"user_metadata\": {},\n \"preview_id\": \"550e8400-e29b-41d4-a716-446655440000\"\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/download")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"source_url\": \"https://huggingface.co/runwayml/stable-diffusion-v1-5/resolve/main/v1-5-pruned.safetensors\",\n \"tags\": [\n \"<string>\"\n ],\n \"user_metadata\": {},\n \"preview_id\": \"550e8400-e29b-41d4-a716-446655440000\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://cloud.comfy.org/api/assets/download")
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 \"source_url\": \"https://huggingface.co/runwayml/stable-diffusion-v1-5/resolve/main/v1-5-pruned.safetensors\",\n \"tags\": [\n \"<string>\"\n ],\n \"user_metadata\": {},\n \"preview_id\": \"550e8400-e29b-41d4-a716-446655440000\"\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
}{
"task_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"message": "Download task created. Use task_id to track progress."
}{
"code": "<string>",
"message": "<string>"
}{
"code": "<string>",
"message": "<string>"
}{
"code": "<string>",
"message": "<string>"
}{
"code": "<string>",
"message": "<string>"
}대용량 파일의 배경 다운로드 시작
Huggingface 또는 Civitai에서 대용량 파일을 위한 배경 다운로드 작업을 시작합니다.
파일이 저장소에 이미 존재하는 경우, 에셋 레코드가 즉시 생성되어 반환됩니다 (200 OK). 파일이 존재하지 않는 경우, 배경 작업이 생성되고 작업 ID가 반환됩니다 (202 Accepted). 프론트엔드는 GET /api/tasks/를 사용하여 진행 상황을 추적할 수 있습니다.
curl --request POST \
--url https://cloud.comfy.org/api/assets/download \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"source_url": "https://huggingface.co/runwayml/stable-diffusion-v1-5/resolve/main/v1-5-pruned.safetensors",
"tags": [
"<string>"
],
"user_metadata": {},
"preview_id": "550e8400-e29b-41d4-a716-446655440000"
}
'import requests
url = "https://cloud.comfy.org/api/assets/download"
payload = {
"source_url": "https://huggingface.co/runwayml/stable-diffusion-v1-5/resolve/main/v1-5-pruned.safetensors",
"tags": ["<string>"],
"user_metadata": {},
"preview_id": "550e8400-e29b-41d4-a716-446655440000"
}
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({
source_url: 'https://huggingface.co/runwayml/stable-diffusion-v1-5/resolve/main/v1-5-pruned.safetensors',
tags: ['<string>'],
user_metadata: {},
preview_id: '550e8400-e29b-41d4-a716-446655440000'
})
};
fetch('https://cloud.comfy.org/api/assets/download', 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/download",
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([
'source_url' => 'https://huggingface.co/runwayml/stable-diffusion-v1-5/resolve/main/v1-5-pruned.safetensors',
'tags' => [
'<string>'
],
'user_metadata' => [
],
'preview_id' => '550e8400-e29b-41d4-a716-446655440000'
]),
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/download"
payload := strings.NewReader("{\n \"source_url\": \"https://huggingface.co/runwayml/stable-diffusion-v1-5/resolve/main/v1-5-pruned.safetensors\",\n \"tags\": [\n \"<string>\"\n ],\n \"user_metadata\": {},\n \"preview_id\": \"550e8400-e29b-41d4-a716-446655440000\"\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/download")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"source_url\": \"https://huggingface.co/runwayml/stable-diffusion-v1-5/resolve/main/v1-5-pruned.safetensors\",\n \"tags\": [\n \"<string>\"\n ],\n \"user_metadata\": {},\n \"preview_id\": \"550e8400-e29b-41d4-a716-446655440000\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://cloud.comfy.org/api/assets/download")
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 \"source_url\": \"https://huggingface.co/runwayml/stable-diffusion-v1-5/resolve/main/v1-5-pruned.safetensors\",\n \"tags\": [\n \"<string>\"\n ],\n \"user_metadata\": {},\n \"preview_id\": \"550e8400-e29b-41d4-a716-446655440000\"\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
}{
"task_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"message": "Download task created. Use task_id to track progress."
}{
"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 (huggingface.co 또는 civitai.com에서 가져와야 함)
"https://huggingface.co/runwayml/stable-diffusion-v1-5/resolve/main/v1-5-pruned.safetensors"
에셋의 선택적 태그 (예: ["model", "checkpoint"])
에셋에 첨부할 선택적 사용자 정의 메타데이터
다운로드된 에셋과 연결할 선택적 미리보기 에셋 ID
"550e8400-e29b-41d4-a716-446655440000"
응답
파일이 이미 스토리지에 존재함 - 에셋이 즉시 생성/반환됨
에셋의 고유 식별자
에셋 파일의 이름
에셋의 크기(바이트 단위)
에셋이 생성된 타임스탬프
에셋이 마지막으로 업데이트된 타임스탬프
이것이 새 에셋 생성(참)인지 아니면 기존 항목 반환(거짓)인지 여부
에셋 콘텐츠의 Blake3 해시
^blake3:[a-f0-9]{64}$에셋의 MIME 유형
에셋과 연결된 태그
에셋의 사용자 정의 메타데이터
에셋 미리보기/썸네일 URL
사용 가능한 경우 미리보기 에셋의 ID
이 에셋을 생성한 작업/프롬프트의 ID (사용 가능한 경우)
에셋이 마지막으로 액세스된 타임스탬프
이 에셋이 불변인지 여부 (수정 또는 삭제할 수 없음)