获取执行历史(v2)
curl --request GET \
--url https://cloud.comfy.org/api/history_v2 \
--header 'X-API-Key: <api-key>'import requests
url = "https://cloud.comfy.org/api/history_v2"
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/history_v2', 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/history_v2",
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/history_v2"
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/history_v2")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://cloud.comfy.org/api/history_v2")
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{
"history": [
{
"prompt_id": "<string>",
"create_time": 123,
"workflow_id": "<string>",
"prompt": {
"priority": 123,
"prompt_id": "<string>",
"extra_data": {}
},
"outputs": {},
"status": {},
"meta": {}
}
]
}{
"code": "<string>",
"message": "<string>"
}{
"code": "<string>",
"message": "<string>"
}job
获取执行历史(v2)
deprecated
弃用。 请改用 /api/jobs。此端点保留以兼容ComfyUI,但将在未来版本中移除;尚未设定移除日期。
检索已认证用户的执行历史,支持分页。 返回轻量级历史格式,包含过滤后的提示数据(工作流已从extra_pnginfo中移除)。
GET
/
api
/
history_v2
获取执行历史(v2)
curl --request GET \
--url https://cloud.comfy.org/api/history_v2 \
--header 'X-API-Key: <api-key>'import requests
url = "https://cloud.comfy.org/api/history_v2"
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/history_v2', 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/history_v2",
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/history_v2"
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/history_v2")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://cloud.comfy.org/api/history_v2")
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{
"history": [
{
"prompt_id": "<string>",
"create_time": 123,
"workflow_id": "<string>",
"prompt": {
"priority": 123,
"prompt_id": "<string>",
"extra_data": {}
},
"outputs": {},
"status": {},
"meta": {}
}
]
}{
"code": "<string>",
"message": "<string>"
}{
"code": "<string>",
"message": "<string>"
}授权
API密钥认证。从您的用户设置中生成API密钥 位于https://platform.comfy.org/profile/api-keys。在X-API-Key头中传递密钥。
响应
成功:已检索执行历史
带历史数组的执行历史响应。 返回一个包含"history"键的对象,其中包含历史条目数组。 每个条目包括prompt_id属性以及执行数据。
按创建时间排序的历史条目数组(最新在前)
Show child attributes
Show child attributes
⌘I