flux

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package flux implements engine.Engine for Black Forest Labs FLUX API.

Image generation is async: POST /v1/{model} creates a task, then GET /v1/get_result?id={id} polls for completion. Auth: X-Key: {key}, env BFL_API_KEY.

Index

Constants

View Source
const (
	ModelProUltra = "flux-pro-1.1-ultra"
	ModelPro11    = "flux-pro-1.1"
	ModelPro      = "flux-pro"
	ModelDev      = "flux-dev"
)

Model constants.

Variables

View Source
var (
	ErrMissingPrompt = errors.New("flux: missing prompt in workflow graph")
)

Functions

func ConfigSchema

func ConfigSchema() []engine.ConfigField

ConfigSchema returns the configuration fields required by the FLUX engine.

func ModelsByCapability

func ModelsByCapability() map[string][]string

ModelsByCapability returns all known FLUX models grouped by capability.

Types

type Config

type Config struct {
	APIKey            string
	BaseURL           string
	Model             string
	HTTPClient        *http.Client
	WaitForCompletion bool
	PollInterval      time.Duration
	OnProgress        epoll.OnProgress
}

Config configures the FLUX engine.

type Engine

type Engine struct {
	// contains filtered or unexported fields
}

Engine implements engine.Engine for FLUX.

func New

func New(cfg Config) *Engine

New creates a FLUX engine instance.

func (*Engine) Capabilities

func (e *Engine) Capabilities() engine.Capability

Capabilities implements engine.Describer.

func (*Engine) Execute

func (e *Engine) Execute(ctx context.Context, g workflow.Graph) (engine.Result, error)

Execute generates an image via the FLUX API.

func (*Engine) Resume

func (e *Engine) Resume(ctx context.Context, remoteID string) (engine.Result, error)

Resume implements engine.Resumer — resumes polling a previously submitted task.

Jump to

Keyboard shortcuts

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