api

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2024 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	T_tag2img drawType = iota
	T_img2img
	T_superResolution
)

Variables

This section is empty.

Functions

func GetImgCfg

func GetImgCfg(photo []byte) (*db.Config, error)

func SliceEqualBCE

func SliceEqualBCE(a, b []*apiUrl) bool

Types

type API added in v0.2.3

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

func New

func New(apis []gconfig.Api, models []string) (*API, error)

func (*API) DrawFree added in v0.2.3

func (api *API) DrawFree() int

func (*API) DrawPoolCap added in v0.2.3

func (api *API) DrawPoolCap() int

func (*API) DrawWait added in v0.2.3

func (api *API) DrawWait() int

func (*API) GetWoker added in v0.2.3

func (api *API) GetWoker() (m *sync.Map, c chan *apiUrl, a []*apiUrl)

func (*API) Load added in v0.2.3

func (api *API) Load(apis []gconfig.Api)

func (*API) ModelAllowed added in v0.2.3

func (a *API) ModelAllowed(Model []Model) bool

func (*API) New added in v0.2.3

func (api *API) New(cfg *Config, initPhoto, ControlPhoto []byte) (*config, error)

func (*API) NewCtrlPhoto added in v0.2.3

func (api *API) NewCtrlPhoto(photo [][]byte, Processor string, ResSize int) (*ctrlPhotoCfg, error)

func (*API) NewCtrlPhotoWithBash64 added in v0.2.3

func (api *API) NewCtrlPhotoWithBash64(photo []string, Processor string, ResSize int) (*ctrlPhotoCfg, error)

func (*API) NewInterrogate added in v0.2.3

func (api *API) NewInterrogate(photo []byte) (*interrogateCfg, error)

func (*API) NewSuperResolution added in v0.2.3

func (api *API) NewSuperResolution(photo [][]byte, resize int) (*superResolutionCfg, error)

func (*API) NewSuperResolutionWithBase64 added in v0.2.3

func (api *API) NewSuperResolutionWithBase64(photo []string, multiplier int) (*superResolutionCfg, error)

type Config added in v0.2.3

type Config struct {
	ResizeMode        int      `json:"resize_mode,omitempty"`
	EnableHr          bool     `json:"enable_hr,omitempty"`
	HrScale           float64  `json:"hr_scale,omitempty"`
	HrUpscaler        string   `json:"hr_upscaler,omitempty"`
	HrSecondPassSteps int      `json:"hr_second_pass_steps,omitempty"`
	InitImages        []string `json:"init_images,omitempty"`
	DenoisingStrength float64  `json:"denoising_strength"`
	Styles            []string `json:"styles,omitempty"`
	Prompt            string   `json:"prompt"`
	Count             int      `json:"n_iter,omitempty"`
	Num               int      `json:"batch_size,omitempty"`
	Seed              uint32   `json:"seed"`
	Steps             int      `json:"steps"`
	Model             string   `json:"-"`
	Vae               string   `json:"-"`
	ClipSkip          int      `json:"-"`
	CfgScale          int      `json:"cfg_scale"`
	Width             int      `json:"width"`
	Height            int      `json:"height"`
	NegativePrompt    string   `json:"negative_prompt"`
	SamplerName       string   `json:"sampler_name"`
	SamplerIndex      string   `json:"sampler_index"`
	AlwaysonScripts   struct {
		Controlnet *struct {
			Args []ControlnetUnits `json:"args,omitempty"`
		} `json:"controlnet,omitempty"`
	} `json:"alwayson_scripts,omitempty"`
}

type ControlnetUnits

type ControlnetUnits struct {
	InputImage    string `json:"input_image,omitempty"`
	Mask          string `json:"mask,omitempty"`
	Module        string `json:"module,omitempty"`
	Model         string `json:"model,omitempty"`
	Weight        int    `json:"weight,omitempty"`
	ResizeMode    string `json:"resize_mode,omitempty"`
	Lowvram       bool   `json:"lowvram,omitempty"`
	ProcessorRes  int    `json:"processor_res,omitempty"`
	ThresholdA    int    `json:"threshold_a,omitempty"`
	ThresholdB    int    `json:"threshold_b,omitempty"`
	Guidance      int    `json:"guidance,omitempty"`
	GuidanceStart int    `json:"guidance_start,omitempty"`
	GuidanceEnd   int    `json:"guidance_end,omitempty"`
	Guessmode     bool   `json:"guessmode,omitempty"`
}

type InterrogateResoult

type InterrogateResoult struct {
	Err     error
	Resoult string
}

type Model

type Model struct {
	ModelName string `json:"model_name"`
}

type Resoult

type Resoult struct {
	Err     error
	Resoult [][]byte
}

type Status

type Status struct {
	Progress    float64 `json:"progress"`
	EtaRelative float64 `json:"eta_relative"`
}

Jump to

Keyboard shortcuts

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