liblib

package
v0.33.0 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2026 License: MIT Imports: 20 Imported by: 0

Documentation

Overview

Package liblib implements engine.Engine for the LibLibAI open API.

LibLib uses HMAC-SHA1 signature authentication with AccessKey/SecretKey. Generation is async: POST a submit endpoint → poll POST /api/generate/webui/status until generateStatus == 5 (success) or 6/7 (failure). Base URL: https://openapi.liblibai.cloud

Index

Constants

View Source
const (
	TemplateText2ImgUltra = "5d7e67009b344550bc1aa6ccbfa1d7f4"
	TemplateText2Img      = "e10adc3949ba59abbe56e057f20f883e"
	TemplateImg2ImgUltra  = "07e00af4fc464c7ab55ff906f8acf1b7"
	TemplateImg2Img       = "9c7d531dc75f476aa833b3d452b8f7ad"
	TemplateKontext       = "fe9928fde1b4491c9b360dd24aa2b115"
	TemplateKlingText2Vid = "61cd8b60d340404394f2a545eeaf197a"
	TemplateKlingImg2Vid  = "180f33c6748041b48593030156d2a71d"
)

Well-known templateUUIDs for built-in endpoints.

Variables

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

Functions

func ConfigSchema

func ConfigSchema() []engine.ConfigField

ConfigSchema returns the configuration fields for the LibLib engine.

func DefaultProvider added in v0.15.0

func DefaultProvider() engine.Provider

DefaultProvider returns preset engine configurations for liblib.

func ModelInfos added in v0.16.0

func ModelInfos() []engine.ModelInfo

ModelInfos returns i18n metadata for the LibLibAI platform. LibLibAI models are user-configured ComfyUI workflows; this registers a platform-level entry for discovery purposes.

func ModelsByCapability

func ModelsByCapability() map[string][]string

ModelsByCapability returns known LibLib model capabilities.

Types

type Config

type Config struct {
	AccessKey         string
	SecretKey         string
	BaseURL           string // default: https://openapi.liblibai.cloud
	Endpoint          string // submit URI path, e.g. "/api/generate/webui/text2img/ultra"
	TemplateUUID      string // required template UUID for the generation type
	HTTPClient        *http.Client
	WaitForCompletion bool
	PollInterval      time.Duration // default: 5s
	OnProgress        epoll.OnProgress
}

Config configures the LibLib engine.

type Engine

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

Engine implements engine.Engine for LibLib.

func New

func New(cfg Config) *Engine

New creates a LibLib 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 content via the LibLib 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