Documentation
¶
Overview ¶
Package rungraph shells out to render/comfy-run-graph.mjs — the generic "run an arbitrary ComfyUI graph + satisfy its node manifest" runner — through the same gpugen exec lifecycle imagegen uses (process-tree-kill, timeout, defer free-VRAM). The harness is 100% generic here: it passes the graph + manifest opaquely and reads back a node-addressed output envelope; it never interprets graph semantics.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Envelope ¶
type Envelope struct {
Outputs map[string][]OutFile `json:"outputs"`
ImagePath string `json:"image_path"`
UnverifiedModels []string `json:"unverified_models"`
// Typed DEFER (fix #4): the mjs now exits 0 and writes {deferred,code,ref,detail} to the
// result on any handled failure, so the code reaches the Go side as data (not a lost
// stderr line). runRunGraph turns Deferred==true into a pipeline defer carrying Code+Detail.
Deferred bool `json:"deferred"`
Code string `json:"code"`
Ref string `json:"ref"`
Detail string `json:"detail"`
}
func Run ¶
func Run(ctx context.Context, node, script, comfyDir string, p Params, timeout time.Duration, samp *gpugen.Sampling, extraEnv ...string) (Envelope, error)
Run executes the graph and returns the parsed output envelope. samp, when non-nil, turns on gpugen's passive per-render VRAM peak sampling (fleet footprints; nil = legacy path). A non-zero exit / timeout / missing result file surfaces as an error the caller maps to a DEFER.