midjourney

package
v0.19.0 Latest Latest
Warning

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

Go to latest
Published: May 13, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package midjourney implements engine.Engine for MidJourney image generation via third-party proxy APIs (e.g. GoAPI at api.goapi.ai).

Image generation is async: POST /mj/v2/imagine creates a task, then POST /mj/v2/fetch polls for completion. Auth: X-API-Key: {key}, env MIDJOURNEY_API_KEY.

Index

Constants

This section is empty.

Variables

View Source
var ErrMissingPrompt = fmt.Errorf("midjourney: missing prompt in workflow graph")

Functions

func ConfigSchema

func ConfigSchema() []engine.ConfigField

ConfigSchema returns the configuration fields required by the MidJourney engine.

func DefaultProvider added in v0.15.0

func DefaultProvider() engine.Provider

DefaultProvider returns preset engine configurations for midjourney.

func ModelInfos added in v0.16.0

func ModelInfos() []engine.ModelInfo

ModelInfos returns i18n metadata for all MidJourney models.

func ModelsByCapability

func ModelsByCapability() map[string][]string

ModelsByCapability returns all known MidJourney models grouped by capability.

Types

type Config

type Config struct {
	APIKey            string
	BaseURL           string
	ProcessMode       string // "fast" or "relax"
	HTTPClient        *http.Client
	WaitForCompletion bool
	PollInterval      time.Duration
	OnProgress        epoll.OnProgress
}

Config configures the MidJourney proxy engine.

type Engine

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

Engine implements engine.Engine for MidJourney via a proxy API.

func New

func New(cfg Config) *Engine

New creates a MidJourney 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 MidJourney proxy 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