Documentation
¶
Index ¶
- func ApplyParameters(client *client.ComfyClient, options *ComfyOptions, graph *graphapi.Graph, ...) (bool, error)
- func CloneRepo(repoURL, repoPath string, showoutput bool) (*git.Repository, error)
- func CopyFile(src, dst string) (int64, error)
- func DownloadFile(url string, targetPath string, max_redirects int, ...) error
- func ExpectImage(reader *bufio.Reader) (image.Image, error)
- func FindAvailableEphemeralPort() (int, error)
- func GetWorkflowsAsync(options *ComfyOptions, workflowpath string, parameters []CLIParameter) chan interface{}
- func HandleDataOutput(client *client.ComfyClient, options *ComfyOptions, ...)
- func ListFiles(path string, topOnly bool, relative bool) ([]string, error)
- func LoadData(path string) (*[]byte, error)
- func OneOf(values []string, default_index int) (string, error)
- func OutputInlineToStd(data *[]byte, name string, width int, height int)
- func ProcessQueue(options *ComfyOptions, workflowpath string, parameters []CLIParameter) (bool, error)
- func ProcessWorkerQueue(worker *WorkflowQueueProcessor, options *ComfyOptions, ...)
- func ReadAndDeserializeJSON(dst interface{}, jsonInput string) error
- func SaveData(data *[]byte, path string) error
- func ScanJsonFromReader(r io.Reader, scanner *bufio.Scanner) (interface{}, *bufio.Scanner, error)
- func SetGenericPropertValue(c *client.ComfyClient, options *ComfyOptions, prop graphapi.Property, ...) (bool, error)
- func SetfileUploadPropertyValue(c *client.ComfyClient, options *ComfyOptions, prop graphapi.Property, ...) (bool, error)
- func StopFileServer(fs *FileServer) error
- func TestParametersHasPipeLoop(options *ComfyOptions, parameters []CLIParameter) (bool, error)
- func ToJson(obj interface{}, purty bool) (string, error)
- func UnionStringSlices(s1 []string, s2 []string) []string
- func YesNo(prompt string, default_yes bool) (bool, error)
- type CLIParameter
- type ComfyOptions
- type FileServer
- type FileServerOptions
- type Workflow
- type WorkflowQueueDataOutputItems
- type WorkflowQueueProcessor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyParameters ¶
func ApplyParameters(client *client.ComfyClient, options *ComfyOptions, graph *graphapi.Graph, simple_api *graphapi.SimpleAPI, parameters []CLIParameter) (bool, error)
func CloneRepo ¶ added in v0.5.0
func CloneRepo(repoURL, repoPath string, showoutput bool) (*git.Repository, error)
func DownloadFile ¶
func DownloadFile(url string, targetPath string, max_redirects int, feedback kinda.CreateEnvironmentOptions) error
downloadFile downloads a file from the specified URL and saves it to the given target path. It also handles redirects with custom logic.
func ExpectImage ¶
ExpectImage tries to read an image from the given reader and returns it.
func FindAvailableEphemeralPort ¶
FindAvailableEphemeralPort finds an available ephemeral port on the local loopback device. It returns the port number if found, or an error otherwise.
func GetWorkflowsAsync ¶ added in v0.6.0
func GetWorkflowsAsync(options *ComfyOptions, workflowpath string, parameters []CLIParameter) chan interface{}
GetWorkflowsAsync returns a channel of WorkflowQueueProcessor that can be used to get the workflows asynchronously nil is returned if there was an error creating the client
func HandleDataOutput ¶ added in v0.6.0
func HandleDataOutput(client *client.ComfyClient, options *ComfyOptions, output map[string][]client.DataOutput)
func OneOf ¶
OneOf - given a list of options, prompt the user to select one, if default is -1 then there is no default selection
func ProcessQueue ¶
func ProcessQueue(options *ComfyOptions, workflowpath string, parameters []CLIParameter) (bool, error)
func ProcessWorkerQueue ¶ added in v0.6.0
func ProcessWorkerQueue(worker *WorkflowQueueProcessor, options *ComfyOptions, parameters []CLIParameter, workers chan *WorkflowQueueProcessor, workitem int, dataitems chan WorkflowQueueDataOutputItems)
func ReadAndDeserializeJSON ¶
func ScanJsonFromReader ¶
func SetGenericPropertValue ¶
func SetGenericPropertValue(c *client.ComfyClient, options *ComfyOptions, prop graphapi.Property, value interface{}) (bool, error)
func SetfileUploadPropertyValue ¶
func SetfileUploadPropertyValue(c *client.ComfyClient, options *ComfyOptions, prop graphapi.Property, value interface{}) (bool, error)
func StopFileServer ¶ added in v0.6.0
func StopFileServer(fs *FileServer) error
func TestParametersHasPipeLoop ¶ added in v0.6.0
func TestParametersHasPipeLoop(options *ComfyOptions, parameters []CLIParameter) (bool, error)
func UnionStringSlices ¶
create a slice of strings that contains all the unique strings from s1 and s2
Types ¶
type CLIParameter ¶
type CLIParameter struct {
NodeID int // -1 for unset
NodeTitle string // empty for unset
API bool // is true if the parameter is an API parameter
Name string // the name of the parameter
Value string // the value of the parameter
}
func ParseParameters ¶
func ParseParameters(params []string) []CLIParameter
type ComfyOptions ¶
type ComfyOptions struct {
Host []string
Port []int
Json bool
PrettyJson bool
API string
APIValues string
GraphOutPath string
InlineImages bool
NoSaveData bool
DataToStdout bool
HomePath string
RecipesPath string
RecipesRepos string
Yes bool // Automatically answer yes on prompted questions
GetVersion bool
OutputNodes string
// path to a file to read from stdin
StdinFile string
// API sub command options
APIValuesOnly bool // only output the values of the API nodes
Stdin *bufio.Reader
Clients []*client.ComfyClient
JsonScanner *bufio.Scanner
JsonScannerMutex *sync.Mutex
}
func (*ComfyOptions) ApplyEnvironment ¶
func (o *ComfyOptions) ApplyEnvironment()
func (*ComfyOptions) GetStdinReader ¶
func (o *ComfyOptions) GetStdinReader() *bufio.Reader
func (*ComfyOptions) SetStdinReader ¶ added in v0.6.0
func (o *ComfyOptions) SetStdinReader(r *bufio.Reader)
type FileServer ¶ added in v0.6.0
type FileServer struct {
Server *http.Server
Port int
RootPath string
StoragePath string
AuthToken string
CertFile string
KeyFile string
SelfSigned bool
}
func StartFileServer ¶ added in v0.6.0
func StartFileServer(options FileServerOptions) (*FileServer, error)
type FileServerOptions ¶ added in v0.6.0
type Workflow ¶ added in v0.6.0
type Workflow struct {
ClientIndex int
Client *client.ComfyClient
Graph *graphapi.Graph
SimpleAPI *graphapi.SimpleAPI
}
func ClientWithWorkflow ¶
func ClientWithWorkflow(client_index int, options *ComfyOptions, workflowpath string, parameters []CLIParameter, callbacks *client.ComfyClientCallbacks, applyparams bool) (*Workflow, bool, *[]string, error)
func GetFullWorkflow ¶
func GetFullWorkflow(client_index int, options *ComfyOptions, workflow string, cb *client.ComfyClientCallbacks) (*Workflow, *[]string, error)
type WorkflowQueueDataOutputItems ¶ added in v0.6.0
type WorkflowQueueDataOutputItems struct {
WorkItem int
Outputs []map[string][]client.DataOutput
Client *client.ComfyClient
}
type WorkflowQueueProcessor ¶ added in v0.6.0
func GetWorkflows ¶ added in v0.6.0
func GetWorkflows(options *ComfyOptions, workflowpath string, parameters []CLIParameter) []*WorkflowQueueProcessor