curl --request POST \
--url https://platformapi.comfy.org/builder/v1/builds/from-workflow \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"workflow": {},
"description": "<string>"
}
'import requests
url = "https://platformapi.comfy.org/builder/v1/builds/from-workflow"
payload = {
"name": "<string>",
"workflow": {},
"description": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>', workflow: {}, description: '<string>'})
};
fetch('https://platformapi.comfy.org/builder/v1/builds/from-workflow', 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://platformapi.comfy.org/builder/v1/builds/from-workflow",
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([
'name' => '<string>',
'workflow' => [
],
'description' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://platformapi.comfy.org/builder/v1/builds/from-workflow"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"workflow\": {},\n \"description\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://platformapi.comfy.org/builder/v1/builds/from-workflow")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"workflow\": {},\n \"description\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://platformapi.comfy.org/builder/v1/builds/from-workflow")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"workflow\": {},\n \"description\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"build": {
"id": "<string>",
"name": "<string>",
"workspaceId": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"description": "<string>",
"definition": {},
"numModels": 123,
"numAllowedModels": 123,
"numCustomNodes": 123,
"numPartnerNodes": 123,
"sizeBytes": 123,
"numUnsizedItems": 123,
"importReport": {
"pythonSatisfied": true,
"unresolvedNodes": [
"<string>"
],
"notInRegistry": [
"<string>"
],
"registryPending": [
"<string>"
],
"skippedPins": [
"<string>"
],
"unpinnablePins": [
"<string>"
],
"collidingNodes": [
"<string>"
],
"droppedComfyVersion": "<string>",
"unverifiedPins": [
"<string>"
],
"localModels": [
{
"folder": "<string>",
"name": "<string>",
"size": 1
}
],
"localModelsTruncated": true
},
"workflowImportReport": {
"comfyVersionRequired": true,
"pinnedToLatest": true,
"unresolvedClasses": [
"<string>"
],
"uncheckedClasses": [
"<string>"
],
"packsWithoutVersion": [
"<string>"
],
"collidingPacks": [
"<string>"
],
"models": [
{
"filename": "<string>",
"status": "matched",
"raw": "<string>",
"directories": [
"<string>"
],
"suggestions": [
{
"filename": "<string>",
"score": 123,
"directory": "<string>"
}
],
"usedBy": [
"<string>"
]
}
],
"unknownClasses": [
{
"classType": "<string>",
"status": "suggested",
"suggestions": [
{
"packId": "<string>",
"nearestClass": "<string>",
"score": 123
}
],
"suggestedPack": {
"source": "classIndex",
"packId": "<string>",
"name": "<string>",
"repository": "<string>"
}
}
],
"partnerClasses": {},
"packsFromStamps": [
"<string>"
],
"classesFromStamps": [
"<string>"
]
},
"warnings": [
{
"field": "<string>",
"reason": "<string>"
}
]
},
"report": {
"comfyVersionRequired": true,
"pinnedToLatest": true,
"unresolvedClasses": [
"<string>"
],
"uncheckedClasses": [
"<string>"
],
"packsWithoutVersion": [
"<string>"
],
"collidingPacks": [
"<string>"
],
"models": [
{
"filename": "<string>",
"status": "matched",
"raw": "<string>",
"directories": [
"<string>"
],
"suggestions": [
{
"filename": "<string>",
"score": 123,
"directory": "<string>"
}
],
"usedBy": [
"<string>"
]
}
],
"unknownClasses": [
{
"classType": "<string>",
"status": "suggested",
"suggestions": [
{
"packId": "<string>",
"nearestClass": "<string>",
"score": 123
}
],
"suggestedPack": {
"source": "classIndex",
"packId": "<string>",
"name": "<string>",
"repository": "<string>"
}
}
],
"partnerClasses": {},
"packsFromStamps": [
"<string>"
],
"classesFromStamps": [
"<string>"
]
}
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"reason": "no_credit_balance",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}Create a build from a ComfyUI workflow
Reads the workflow exactly as POST /v1/workflows/resolve does, then creates the build from what it read. For a caller that has a workflow file and wants an environment, rather than one that wants to show a person what the workflow means first.
The report is returned twice and both copies are the same object: once at the top level, and once as the created build’s own workflowImportReport, which is stored so a caller that hands the user off to the build page does not have to carry the warnings across that gap. The stored copy is cleared the first time the definition is saved.
The build this creates installs the workflow’s custom nodes and no models, because a workflow carries no model sources. A caller that wants the models too resolves them separately and saves them into the definition before cutting.
A 400 carries the identifier a caller branches on, never the wording: INVALID_REQUEST when the name or the workflow is missing, INVALID_WORKFLOW when the payload is not a workflow or what it maps to cannot be stored as a definition, and WORKFLOW_TOO_LARGE when it names more node classes than one import may carry.
Subject to the same subscription and per-workspace limits as POST /v1/builds. Cutting a version is a separate call.
curl --request POST \
--url https://platformapi.comfy.org/builder/v1/builds/from-workflow \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"workflow": {},
"description": "<string>"
}
'import requests
url = "https://platformapi.comfy.org/builder/v1/builds/from-workflow"
payload = {
"name": "<string>",
"workflow": {},
"description": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>', workflow: {}, description: '<string>'})
};
fetch('https://platformapi.comfy.org/builder/v1/builds/from-workflow', 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://platformapi.comfy.org/builder/v1/builds/from-workflow",
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([
'name' => '<string>',
'workflow' => [
],
'description' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://platformapi.comfy.org/builder/v1/builds/from-workflow"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"workflow\": {},\n \"description\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://platformapi.comfy.org/builder/v1/builds/from-workflow")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"workflow\": {},\n \"description\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://platformapi.comfy.org/builder/v1/builds/from-workflow")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"workflow\": {},\n \"description\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"build": {
"id": "<string>",
"name": "<string>",
"workspaceId": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"description": "<string>",
"definition": {},
"numModels": 123,
"numAllowedModels": 123,
"numCustomNodes": 123,
"numPartnerNodes": 123,
"sizeBytes": 123,
"numUnsizedItems": 123,
"importReport": {
"pythonSatisfied": true,
"unresolvedNodes": [
"<string>"
],
"notInRegistry": [
"<string>"
],
"registryPending": [
"<string>"
],
"skippedPins": [
"<string>"
],
"unpinnablePins": [
"<string>"
],
"collidingNodes": [
"<string>"
],
"droppedComfyVersion": "<string>",
"unverifiedPins": [
"<string>"
],
"localModels": [
{
"folder": "<string>",
"name": "<string>",
"size": 1
}
],
"localModelsTruncated": true
},
"workflowImportReport": {
"comfyVersionRequired": true,
"pinnedToLatest": true,
"unresolvedClasses": [
"<string>"
],
"uncheckedClasses": [
"<string>"
],
"packsWithoutVersion": [
"<string>"
],
"collidingPacks": [
"<string>"
],
"models": [
{
"filename": "<string>",
"status": "matched",
"raw": "<string>",
"directories": [
"<string>"
],
"suggestions": [
{
"filename": "<string>",
"score": 123,
"directory": "<string>"
}
],
"usedBy": [
"<string>"
]
}
],
"unknownClasses": [
{
"classType": "<string>",
"status": "suggested",
"suggestions": [
{
"packId": "<string>",
"nearestClass": "<string>",
"score": 123
}
],
"suggestedPack": {
"source": "classIndex",
"packId": "<string>",
"name": "<string>",
"repository": "<string>"
}
}
],
"partnerClasses": {},
"packsFromStamps": [
"<string>"
],
"classesFromStamps": [
"<string>"
]
},
"warnings": [
{
"field": "<string>",
"reason": "<string>"
}
]
},
"report": {
"comfyVersionRequired": true,
"pinnedToLatest": true,
"unresolvedClasses": [
"<string>"
],
"uncheckedClasses": [
"<string>"
],
"packsWithoutVersion": [
"<string>"
],
"collidingPacks": [
"<string>"
],
"models": [
{
"filename": "<string>",
"status": "matched",
"raw": "<string>",
"directories": [
"<string>"
],
"suggestions": [
{
"filename": "<string>",
"score": 123,
"directory": "<string>"
}
],
"usedBy": [
"<string>"
]
}
],
"unknownClasses": [
{
"classType": "<string>",
"status": "suggested",
"suggestions": [
{
"packId": "<string>",
"nearestClass": "<string>",
"score": 123
}
],
"suggestedPack": {
"source": "classIndex",
"packId": "<string>",
"name": "<string>",
"repository": "<string>"
}
}
],
"partnerClasses": {},
"packsFromStamps": [
"<string>"
],
"classesFromStamps": [
"<string>"
]
}
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"reason": "no_credit_balance",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}授权
请求体
A ComfyUI workflow, in either export dialect. The API format is a flat object of node id to node, each carrying class_type and its values under inputs. The UI format carries a nodes array with positional widgets_values alongside a links array, which is what identifies it, and may hold reusable groups under definitions.subgraphs that are expanded when read.
Read rather than validated field by field: the node classes and model filenames are taken out, and everything else is ignored. A payload that matches neither dialect is a 400.