luma

package
v0.42.0 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package luma implements engine.Engine for the Luma Dream Machine API.

Both video and image generation are async: POST /dream-machine/v1/generations creates a task, GET /dream-machine/v1/generations/{id} polls for completion. Auth: Authorization: Bearer {key}, env LUMA_API_KEY.

Index

Constants

View Source
const (
	// Video models.
	ModelRay2      = "ray-2"
	ModelRayFlash2 = "ray-flash-2"
	// Image models.
	ModelPhoton1      = "photon-1"
	ModelPhotonFlash1 = "photon-flash-1"
)

Model constants.

Variables

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

Functions

func ConfigSchema

func ConfigSchema() []engine.ConfigField

ConfigSchema returns the configuration fields required by the Luma engine.

func DefaultProvider added in v0.15.0

func DefaultProvider() engine.Provider

DefaultProvider returns preset engine configurations for luma.

func ModelInfos added in v0.16.0

func ModelInfos() []engine.ModelInfo

ModelInfos returns i18n metadata for all Luma models.

func ModelsByCapability

func ModelsByCapability() map[string][]string

ModelsByCapability returns all known Luma 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 Luma engine.

type Engine

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

Engine implements engine.Engine for Luma.

func New

func New(cfg Config) *Engine

New creates a Luma 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 a video or image via the Luma 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