rungraph

package
v0.22.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 18, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

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.

type OutFile

type OutFile struct {
	Path   string `json:"path"`
	Type   string `json:"type"`
	Kind   string `json:"kind"`
	Width  int    `json:"width"`
	Height int    `json:"height"`
}

type Params

type Params struct {
	GraphPath, ManifestPath, OutDir, ResultPath, ReserveVram string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL