prodia

package module
v0.61.0 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package prodia wraps Prodia's image generation REST API.

NewImageModel targets the synchronous POST /v2/job endpoint for text-to-image job types. image.Options.Model is the official job type discriminator, such as "inference.flux-fast.schnell.txt2img.v2"; the provider-only config is available under ImageRequestExtensionKey. Model, prompt, negative prompt, dimensions, and seed belong to Core; native duplicates are rejected. PNG, JPEG, and WebP output use the endpoint's standard Accept negotiation.

See https://docs.prodia.com/reference/inference/ for the full reference.

Index

Constants

View Source
const (
	ImageRequestExtensionKey = Provider + "/image_request"

	// DefaultBaseURL is Prodia's v2 inference endpoint.
	DefaultBaseURL = "https://inference.prodia.com/v2"
)
View Source
const (
	JobFlux2DevTextToImage        = "inference.flux-2.dev.txt2img.v1"
	JobFlux2FlexTextToImage       = "inference.flux-2.flex.txt2img.v1"
	JobFlux2Klein4BTextToImage    = "inference.flux-2.klein.4b.txt2img.v1"
	JobFlux2Klein9BTextToImage    = "inference.flux-2.klein.9b.txt2img.v1"
	JobFlux2MaxTextToImage        = "inference.flux-2.max.txt2img.v1"
	JobFlux2ProTextToImage        = "inference.flux-2.pro.txt2img.v1"
	JobFluxFastSchnellTextToImage = "inference.flux-fast.schnell.txt2img.v2"
	JobRecraftV4TextToImage       = "inference.recraft.v4.txt2img.v1"
)

Current official text-to-image job type identifiers.

View Source
const (
	Provider = "prodia"
)

Provider is the stable backend name for host-side attribution.

Variables

This section is empty.

Functions

This section is empty.

Types

type ImageModel

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

ImageModel wraps Prodia's /v2/job inference endpoint. Model id (image.Options.Model) carries the full Prodia type, e.g. "inference.flux.dev.txt2img.v1". Core owns the prompt, model, dimensions, negative prompt, and seed. The native config extension accepts provider-only options such as sampler and steps; duplicate Core fields are rejected.

func NewImageModel

func NewImageModel(ctx context.Context, config ImageModelConfig) (*ImageModel, error)

func (*ImageModel) Call

func (i *ImageModel) Call(ctx context.Context, req *image.Request) (*image.Response, error)

type ImageModelConfig

type ImageModelConfig struct {
	APIKey         string
	DefaultOptions image.Options
	BaseURL        string
	HTTPClient     *http.Client
}

func (ImageModelConfig) Validate

func (i ImageModelConfig) Validate() error

Jump to

Keyboard shortcuts

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