curl --request POST \
--url https://platformapi.comfy.org/builder/v1/workflows/resolve \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"workflow": {}
}'import requests
url = "https://platformapi.comfy.org/builder/v1/workflows/resolve"
payload = { "workflow": {} }
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({workflow: {}})
};
fetch('https://platformapi.comfy.org/builder/v1/workflows/resolve', 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/workflows/resolve",
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([
'workflow' => [
]
]),
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/workflows/resolve"
payload := strings.NewReader("{\n \"workflow\": {}\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/workflows/resolve")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"workflow\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://platformapi.comfy.org/builder/v1/workflows/resolve")
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 \"workflow\": {}\n}"
response = http.request(request)
puts response.read_body{
"definition": {},
"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>"
]
},
"format": "api"
}{
"error": "<string>",
"message": "<string>"
}Read a ComfyUI workflow as a build definition
Turns a workflow file into the definition it maps to, without writing anything. A workflow is a much poorer input than a Desktop snapshot: it records what a graph refers to, never what was installed. There are no versions in it, no Python, and no pip state, so everything here is a name resolved against something else, and everything that could not be resolved is named in the report rather than dropped.
Both export dialects are accepted, the API format and the UI format, and which one was read is reported. Every distinct node class is looked up against the Comfy Registry to find the pack that provides it. Many classes usually resolve to one pack, and that pack is installed once.
A class from a pack Cloud does not install is missing from the class map. When the UI export stamps such a class with a registry pack (cnr_id, read without regard to case), the stamp decides its pack. A class stamped with the id of a pack already going in is attached to that pack without asking the registry. Otherwise the registry’s class index is asked about up to three of the pack’s stamped classes, and once it names the stamped pack for one, the pack goes in and its other stamped classes follow without being asked about. A stamped pack the registry records under the repository of a pack already going in is attached to that pack rather than installed twice. A stamp nothing confirms leaves its classes in unresolvedClasses, or in uncheckedClasses when the registry did not answer. The check proves that the file and the index agree, not who wrote the class: the registry lets any publisher list any class name, so a publisher can make its own pack confirm for a name it chose. Packs that entered the definition this way are listed in packsFromStamps, and every class a stamp attributed, however it got there, in classesFromStamps. The class map never placed those classes, so Comfy Cloud cannot be assumed to have them. A file that stamps many packs has only the first 16 (by registry id) looked up; the classes of the rest are reported in uncheckedClasses.
A class the map lacks with no registry stamp, which is every class in an API-format export, is looked up in the registry’s class index (the first 16 by name). When the index names a pack already going in, by id or repository, the class is attached to it and listed in classesFromStamps. When it names another pack, nothing is added: the class stays in unresolvedClasses and its unknownClasses entry carries that pack as suggestedPack. A class stamped with only a GitHub repository (aux_id) counts the index’s answer only when it names that repository, and is otherwise offered the repository itself. A class the index gave no answer for (the registry did not reply in time, or the class is past the first 16) is listed in uncheckedClasses, since nothing said no pack publishes it. A registry stamp the class index cannot confirm, on a pack the registry has, is offered as that pack. A class that runs only in the browser (KJNodes GetNode and SetNode, Easy-Use getNode and setNode, rgthree’s group, label, reroute and bypass helpers) still needs its pack, whose script registers it in the editor: the pack goes in like a mapped class’s pack, and the class is listed in classesFromStamps when Comfy Cloud does not install that pack. Such a class stamped with another pack follows its stamp instead. When the registry’s class index names another pack for the same name (GetNode and SetNode), an unstamped class is placed only in its pack already going in, and is otherwise offered that pack as suggestedPack (browserRegistration) and stays in unresolvedClasses. ComfyUI’s own notes, reroute and primitive install nothing and are not reported.
A class Comfy Cloud hides (labelled in Cloud’s supported-nodes config and left out of its node list) is not in the class map. Cloud’s config names its pack, so the class goes into that pack, stamped or not, and the pack is added when nothing else brought it in. A hidden ComfyUI built-in installs nothing. Either way the class is listed in classesFromStamps, since Cloud does not run it.
Two things a workflow cannot supply. It names no version, so a pack is pinned to the registry’s newest published release and pinnedToLatest says when that happened; the same file resolved weeks apart can therefore differ. It names no model source, only a filename that existed on someone else’s disk, so models never enter the definition and are returned in the report for the caller to resolve and add.
A registry that cannot be reached leaves its classes in uncheckedClasses rather than in unresolvedClasses. Nothing about a network fault says a pack is missing, and reporting one as the other would tell a person to delete nodes that are perfectly fine.
A 400 carries the identifier a caller branches on, never the wording: INVALID_REQUEST when no workflow was sent, INVALID_WORKFLOW when the payload is not a workflow or holds no nodes, and WORKFLOW_TOO_LARGE when it names more node classes than one import may carry.
Use POST /v1/builds/from-workflow to create the build in one call instead.
curl --request POST \
--url https://platformapi.comfy.org/builder/v1/workflows/resolve \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"workflow": {}
}'import requests
url = "https://platformapi.comfy.org/builder/v1/workflows/resolve"
payload = { "workflow": {} }
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({workflow: {}})
};
fetch('https://platformapi.comfy.org/builder/v1/workflows/resolve', 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/workflows/resolve",
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([
'workflow' => [
]
]),
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/workflows/resolve"
payload := strings.NewReader("{\n \"workflow\": {}\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/workflows/resolve")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"workflow\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://platformapi.comfy.org/builder/v1/workflows/resolve")
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 \"workflow\": {}\n}"
response = http.request(request)
puts response.read_body{
"definition": {},
"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>"
]
},
"format": "api"
}{
"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.
レスポンス
The workflow was read. A report naming models is the normal outcome, not a failure: resolving them to sources is the caller's next step.
The user's environment choices (nodes, models, base version). Free-form for MVP, except that a field named like a known one in another case (customnodes for customNodes) is rejected: create and update refuse one they bring in, and check and cut refuse it wherever it sits. A public custom node declares an https github.com repository URL plus an optional gitRef (absent means the default branch); a private one references an uploaded blobId; exactly one of the two per node. A model declares a type (the ComfyUI model folder it lands in, e.g. checkpoints, loras, vae) plus exactly one source, a public sourceUri (https) or a private blobId, and an optional filename and sha256; the built release records each model so it can be placed at deploy time (models are not baked into the image). A CivitAI sourceUri is saved without its token query parameter and any user:password@ part, since a deployment downloads CivitAI links with the platform's own token, so a saved definition can read back without them. A CivitAI sourceUri (civitai.com or civitai.red, with or without www.) should be a download link (https://civitai.com/api/download/models/) or a model page link (https://civitai.com/models/), since a deployment can download no other CivitAI link: create and update warn on any other, and check and cut refuse it. An optional baseImage names the curated base image (the CUDA/Python/torch runtime the build is built on) by id; omitted means the default, and an unrecognized id is rejected (only images we build are selectable, never an arbitrary ref). pipDependencies is a requirements.txt string (one requirement per line). A version pin (numpy<2.5) is applied as an override in the single dependency resolution, so it beats every other declaration of that package; it forces a version rather than adding a package, so use it to correct versions your nodes already bring in, and the build warns about a pin nothing else requires. A direct reference to an https wheel (nunchaku @ https://host/nunchaku-1.0.1-cp311-cp311-linux_x86_64.whl) is instead a root of the resolution and adds that package, which is how an engine published only as a wheel outside PyPI gets in; an optional #sha256= fragment on the address is verified at install. Local paths, file: URLs, git+ references and addresses carrying credentials are dropped with a warning, and so is an address for a package a version pin in the same blob also names, whatever markers either line carries, because the pin would replace the address in the resolution. modelPolicy, partnerNodePolicy and customNodePolicy are allow/deny lists for which models, partner nodes and custom nodes the build permits: each is an object with a mode of "allowlist" (allow only the list) or "blocklist" (allow all except the list) plus a list of string ids. An optional uiOrigin string records which client flow authored the definition; the platform currently writes "desktop-snapshot" or "comfyui-bundle". It is attribution only: stored and read back as sent, never validated, and it changes nothing about the build (the worker reports it, truncated to 64 characters, as ui_origin on its build analytics events).