사용자 데이터 파일 업로드 또는 업데이트
curl --request POST \
--url https://cloud.comfy.org/api/userdata/{file} \
--header 'Content-Type: application/octet-stream' \
--header 'X-API-Key: <api-key>' \
--data '"<string>"'import requests
url = "https://cloud.comfy.org/api/userdata/{file}"
payload = "<string>"
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/octet-stream"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/octet-stream'},
body: JSON.stringify('<string>')
};
fetch('https://cloud.comfy.org/api/userdata/{file}', 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/userdata/{file}",
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('<string>'),
CURLOPT_HTTPHEADER => [
"Content-Type: application/octet-stream",
"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/userdata/{file}"
payload := strings.NewReader("\"<string>\"")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/octet-stream")
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/userdata/{file}")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/octet-stream")
.body("\"<string>\"")
.asString();require 'uri'
require 'net/http'
url = URI("https://cloud.comfy.org/api/userdata/{file}")
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/octet-stream'
request.body = "\"<string>\""
response = http.request(request)
puts response.read_body{
"path": "<string>",
"size": 123,
"modified": "2023-11-07T05:31:56Z"
}"<string>""<string>""<string>""<string>""<string>"user
사용자 데이터 파일 업로드 또는 업데이트
사용자 데이터 디렉토리에 파일을 업로드합니다. 선택적 쿼리 파라미터를 통해 덮어쓰기 동작 및 응답 세부 정보를 제어할 수 있습니다.
POST
/
api
/
userdata
/
{file}
사용자 데이터 파일 업로드 또는 업데이트
curl --request POST \
--url https://cloud.comfy.org/api/userdata/{file} \
--header 'Content-Type: application/octet-stream' \
--header 'X-API-Key: <api-key>' \
--data '"<string>"'import requests
url = "https://cloud.comfy.org/api/userdata/{file}"
payload = "<string>"
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/octet-stream"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/octet-stream'},
body: JSON.stringify('<string>')
};
fetch('https://cloud.comfy.org/api/userdata/{file}', 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/userdata/{file}",
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('<string>'),
CURLOPT_HTTPHEADER => [
"Content-Type: application/octet-stream",
"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/userdata/{file}"
payload := strings.NewReader("\"<string>\"")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/octet-stream")
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/userdata/{file}")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/octet-stream")
.body("\"<string>\"")
.asString();require 'uri'
require 'net/http'
url = URI("https://cloud.comfy.org/api/userdata/{file}")
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/octet-stream'
request.body = "\"<string>\""
response = http.request(request)
puts response.read_body{
"path": "<string>",
"size": 123,
"modified": "2023-11-07T05:31:56Z"
}"<string>""<string>""<string>""<string>""<string>"인증
API 키 인증. 계정 설정에서 API 키를 생성하세요. https://platform.comfy.org/profile/api-keys 에서 생성할 수 있습니다. X-API-Key 헤더에 키를 전달하세요.
경로 매개변수
대상 파일 경로 (필요한 경우 URL 인코딩).
쿼리 매개변수
"거짓"이면 기존 파일 덮어쓰기를 방지합니다. 기본값은 "참"입니다.
사용 가능한 옵션:
true, false "참"이면 자세한 파일 정보를 반환하고, "거짓"이면 상대 경로만 반환합니다.
사용 가능한 옵션:
true, false 본문
application/octet-stream
The body is of type file.
⌘I