Any ComfyUI workflow runs as a job, from the inputs its catalog entry declares
CI / test (push) Successful in 9m7s
CI / test (push) Successful in 9m7s
A model's catalog entry now says what its workflow takes and makes:
comfyui.inputs, each a placeholder of its name with a type (text, int,
float, bool, choice, image, mask, audio, video, file), bounds, choices
and a default; and comfyui.output, which gains video, audio and files
beside pictures and meshes. POST /v1/workflows/runs with {model, inputs}
checks a request against them before a job is written — a required input
left out, an unknown one, a number out of bounds, a song sent as a
picture, another owner's file id are each refused with what was wrong —
and the job worker replays it to a replica, where the files go into
ComfyUI's input directory, the workflow is filled and run, and the first
file of the model's output kind is the job's result. /v1/models lists
each ComfyUI model's workflow, so a client can build its form.
A PNG result carries the licence in an iTXt chunk, as a GLB does in
asset.extras. A file whose server named no type is typed by its name
before its bytes, so a WAV is audio/wav, not audio/wave.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
b43e66c95e
commit
b6bfc33ef7
20 files changed
+1660
-44
No files matched your search
@@ -258,9 +258,51 @@ type TokenCount struct {
|
||||
|
||||
// License is the terms what a model makes comes under.
|
||||
type License struct {
|
||||
// ID is SPDX where there is one, else the licence's own short name.
|
||||
ID string `json:"id,omitempty"`
|
||||
Name string `json:"name"`
|
||||
URL string `json:"url,omitempty"`
|
||||
Notice string `json:"notice,omitempty"`
|
||||
// Commercial is whether the output may be used commercially; absent is
|
||||
// not said.
|
||||
Commercial *bool `json:"commercial,omitempty"`
|
||||
// ExcludedRegions are ISO 3166 codes, EU for the union, where it grants
|
||||
// nothing.
|
||||
ExcludedRegions []string `json:"excluded_regions,omitempty"`
|
||||
RevenueCapUSD int64 `json:"revenue_cap_usd,omitempty"`
|
||||
Attribution string `json:"attribution,omitempty"`
|
||||
}
|
||||
|
||||
// WorkflowInfo is what a ComfyUI model takes and makes, for a run at
|
||||
// /v1/workflows/runs.
|
||||
type WorkflowInfo struct {
|
||||
// Output is pictures, meshes, video, audio or files.
|
||||
Output string `json:"output"`
|
||||
Inputs []WorkflowInput `json:"inputs"`
|
||||
}
|
||||
|
||||
// WorkflowInput is one input a workflow takes.
|
||||
type WorkflowInput struct {
|
||||
Name string `json:"name"`
|
||||
// Type is text, int, float, bool, choice, image, mask, audio, video or
|
||||
// file; the last five are sent as base64, a data URL, or a file's id.
|
||||
Type string `json:"type"`
|
||||
Required bool `json:"required,omitempty"`
|
||||
Default any `json:"default,omitempty"`
|
||||
Min *float64 `json:"min,omitempty"`
|
||||
Max *float64 `json:"max,omitempty"`
|
||||
Choices []string `json:"choices,omitempty"`
|
||||
MaxMB int `json:"max_mb,omitempty"`
|
||||
Doc string `json:"doc,omitempty"`
|
||||
}
|
||||
|
||||
// RunRequest asks a ComfyUI model to run its workflow.
|
||||
type RunRequest struct {
|
||||
Model string `json:"model"`
|
||||
// Inputs are by name, as the model's workflow lists them in /v1/models.
|
||||
Inputs map[string]any `json:"inputs"`
|
||||
// Seed is the workflow's {{seed}}, where it has one; random otherwise.
|
||||
Seed *int64 `json:"seed,omitempty"`
|
||||
}
|
||||
|
||||
// ModelInfo is a model a key may use.
|
||||
@@ -276,9 +318,11 @@ type ModelInfo struct {
|
||||
ContextLength int `json:"context_length,omitempty"`
|
||||
MaxOutputTokens int `json:"max_output_tokens,omitempty"`
|
||||
Description string `json:"description,omitempty"`
|
||||
// Capabilities: tools, vision, embeddings, images, meshes.
|
||||
// Capabilities: tools, vision, embeddings, images, meshes, workflows.
|
||||
Capabilities map[string]bool `json:"capabilities"`
|
||||
License *License `json:"license,omitempty"`
|
||||
// Workflow is what a ComfyUI model takes and makes.
|
||||
Workflow *WorkflowInfo `json:"workflow,omitempty"`
|
||||
}
|
||||
|
||||
// ModelList is the models a key may use.
|
||||
|
||||
Reference in new issue
Block a user