imageflow

package
v1.21.2 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2026 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanupAssets

func CleanupAssets(maxAge time.Duration, deleteFiles bool) (int, error)

func Delete

func Delete(name string) error

func RecoverJobs

func RecoverJobs() error

func Save

func Save(wf *Workflow) error

func SaveAsset

func SaveAsset(asset Asset) error

func Validate

func Validate(wf *Workflow) error

Types

type Asset

type Asset struct {
	ID         string    `json:"id"`
	Workflow   string    `json:"workflow"`
	JobID      string    `json:"job_id"`
	Path       string    `json:"path"`
	ImageURL   string    `json:"image_url,omitempty"`
	Model      string    `json:"model,omitempty"`
	Mode       string    `json:"mode,omitempty"`
	Width      int       `json:"width,omitempty"`
	Height     int       `json:"height,omitempty"`
	Provider   string    `json:"provider,omitempty"`
	Prompt     string    `json:"prompt,omitempty"`
	Seed       int       `json:"seed,omitempty"`
	SourceNode string    `json:"source_node,omitempty"`
	SizeBytes  int64     `json:"size_bytes,omitempty"`
	Archived   bool      `json:"archived,omitempty"`
	CreatedAt  string    `json:"created_at"`
	Metadata   *Workflow `json:"metadata,omitempty"`
}

func ArchiveAsset

func ArchiveAsset(id string, archived bool) (Asset, bool, error)

func DeleteAsset

func DeleteAsset(id string, deleteFile bool) (Asset, bool, error)

func ListAssets

func ListAssets() ([]Asset, error)

type AuditEvent

type AuditEvent map[string]interface{}

func ReadAuditEvents

func ReadAuditEvents(limit int) ([]AuditEvent, error)

type Edge

type Edge struct {
	ID         string `json:"id"`
	Source     string `json:"source"`
	SourcePort string `json:"sourcePort,omitempty"`
	Target     string `json:"target"`
	TargetPort string `json:"targetPort,omitempty"`
}

type Job

type Job struct {
	ID        string          `json:"id"`
	Workflow  string          `json:"workflow"`
	Status    string          `json:"status"`
	CreatedAt string          `json:"created_at"`
	UpdatedAt string          `json:"updated_at"`
	Nodes     []NodeRunStatus `json:"nodes"`
	Logs      []string        `json:"logs"`
	Result    *RunResult      `json:"result,omitempty"`
	Error     string          `json:"error,omitempty"`
	Attempts  int             `json:"attempts,omitempty"`
	Priority  int             `json:"priority,omitempty"`
}

func CancelJob

func CancelJob(id string) (*Job, bool)

func GetJob

func GetJob(id string) (*Job, bool)

func ListJobs

func ListJobs() []Job

func RetryJob

func RetryJob(id string) (*Job, bool, error)

func StartJob

func StartJob(wf *Workflow) (*Job, error)

func StartJobWithOptions

func StartJobWithOptions(wf *Workflow, opts JobOptions) (*Job, error)

type JobOptions

type JobOptions struct {
	Priority int `json:"priority,omitempty"`
}

type LintIssue

type LintIssue struct {
	Level   string `json:"level"`
	NodeID  string `json:"node_id,omitempty"`
	EdgeID  string `json:"edge_id,omitempty"`
	Message string `json:"message"`
}

func LintWorkflow

func LintWorkflow(wf *Workflow) []LintIssue

type Metadata

type Metadata struct {
	CreatedAt string `json:"createdAt,omitempty"`
	UpdatedAt string `json:"updatedAt,omitempty"`
}

type Metrics

type Metrics struct {
	Jobs        QueueStats `json:"jobs"`
	Assets      int        `json:"assets"`
	Archived    int        `json:"archived_assets"`
	TotalBytes  int64      `json:"total_asset_bytes"`
	AuditEvents int        `json:"audit_events"`
}

func UsageMetrics

func UsageMetrics() Metrics

type ModelInfo

type ModelInfo struct {
	Provider         string `json:"provider"`
	Model            string `json:"model"`
	Quality          string `json:"quality"`
	OutputDir        string `json:"output_dir"`
	BaseURL          string `json:"base_url,omitempty"`
	APIKeyConfigured bool   `json:"api_key_configured"`
	ImageCapable     bool   `json:"image_capable"`
	Status           string `json:"status"`
	Message          string `json:"message"`
}

func AvailableModels

func AvailableModels() []ModelInfo

func ModelStatus

func ModelStatus() ModelInfo

type Node

type Node struct {
	ID       string                 `json:"id"`
	Type     string                 `json:"type"`
	Position Position               `json:"position"`
	Config   map[string]interface{} `json:"config"`
}

type NodeRunStatus

type NodeRunStatus struct {
	NodeID string `json:"node_id"`
	Type   string `json:"type"`
	Status string `json:"status"`
	Result string `json:"result,omitempty"`
}

type OptimizationSuggestion

type OptimizationSuggestion struct {
	Level   string `json:"level"`
	Message string `json:"message"`
}

func OptimizeWorkflow

func OptimizeWorkflow(wf *Workflow) []OptimizationSuggestion

type Position

type Position struct {
	X float64 `json:"x"`
	Y float64 `json:"y"`
}

type QueueStats

type QueueStats struct {
	Total     int `json:"total"`
	Queued    int `json:"queued"`
	Running   int `json:"running"`
	Success   int `json:"success"`
	Failed    int `json:"failed"`
	Canceled  int `json:"canceled"`
	MaxActive int `json:"max_active"`
}

func JobQueueStats

func JobQueueStats() QueueStats

type RunResult

type RunResult struct {
	Status    string   `json:"status"`
	Path      string   `json:"path,omitempty"`
	Paths     []string `json:"paths,omitempty"`
	ImageURL  string   `json:"image_url,omitempty"`
	ImageURLs []string `json:"image_urls,omitempty"`
	Model     string   `json:"model,omitempty"`
	Logs      []string `json:"logs"`
	Mode      string   `json:"mode,omitempty"`
	Cached    bool     `json:"cached,omitempty"`
}

func Run

func Run(wf *Workflow) (*RunResult, error)

func RunWithContext

func RunWithContext(ctx context.Context, wf *Workflow) (*RunResult, error)

type SharedWorkflow

type SharedWorkflow struct {
	Kind       string   `json:"kind"`
	Version    string   `json:"version"`
	ExportedAt string   `json:"exported_at"`
	Workflow   Workflow `json:"workflow"`
}

type Summary

type Summary struct {
	Name      string `json:"name"`
	Nodes     int    `json:"nodes"`
	Edges     int    `json:"edges"`
	UpdatedAt string `json:"updatedAt,omitempty"`
}

func List

func List() ([]Summary, error)

type Template

type Template struct {
	ID          string   `json:"id"`
	Name        string   `json:"name"`
	Description string   `json:"description"`
	Tags        []string `json:"tags"`
	Workflow    Workflow `json:"workflow"`
}

func BuiltinTemplates

func BuiltinTemplates() []Template

func TemplateByID

func TemplateByID(id string) (Template, bool)

type Workflow

type Workflow struct {
	Version  string   `json:"version"`
	Name     string   `json:"name"`
	Nodes    []Node   `json:"nodes"`
	Edges    []Edge   `json:"edges"`
	Metadata Metadata `json:"metadata"`
}

func ApplyParameters

func ApplyParameters(wf *Workflow, params map[string]interface{}) Workflow

func FixWorkflow

func FixWorkflow(wf *Workflow) (*Workflow, []string)

func Load

func Load(name string) (*Workflow, error)

func NewWorkflowFromPrompt

func NewWorkflowFromPrompt(name, instruction, prompt string) Workflow

type WorkflowExplanation

type WorkflowExplanation struct {
	Summary  string   `json:"summary"`
	Steps    []string `json:"steps"`
	Nodes    []string `json:"nodes"`
	Warnings []string `json:"warnings,omitempty"`
}

func ExplainWorkflow

func ExplainWorkflow(wf *Workflow) WorkflowExplanation

Jump to

Keyboard shortcuts

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