Documentation
¶
Index ¶
- func Base64File(fp string) (b64 string, err error)
- func Imgs2Files(imgs []string, dir string, id *uuid.UUID) (prefix string, err error)
- func Info2File(info, prefix string) (err error)
- func Version() string
- type Client
- func (client *Client) Img2Img(ctx context.Context, req *Img2ImgReq, exts ...Extension) (res *Img2ImgRes, err error)
- func (client *Client) Interrogate(ctx context.Context, req *InterrogateReq) (res *InterrogateRes, err error)
- func (client *Client) InterrogateCLIP(fp string) (res *InterrogateRes, err error)
- func (client *Client) InterrogateDeepDanBooru(fp string) (res *InterrogateRes, err error)
- func (client *Client) Interrogate_url() string
- func (client *Client) Txt2Img(ctx context.Context, req *Txt2ImgReq, exts ...Extension) (res *Txt2ImgRes, err error)
- func (client *Client) Txt2ImgPromot(prompt string, batchSize uint32) (res *Txt2ImgRes, err error)
- func (client *Client) ValidateControlnet(item *Controlnet) (err error)
- type Config
- type Controlnet
- type Extension
- type Extensions
- type Img2ImgReq
- type Img2ImgRes
- type InterrogateReq
- type InterrogateRes
- type SDError
- type SDErrorDetail
- type Txt2ImgReq
- type Txt2ImgRes
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Base64File ¶
func Imgs2Files ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func ClientFromViper ¶
func (*Client) Img2Img ¶
func (client *Client) Img2Img(ctx context.Context, req *Img2ImgReq, exts ...Extension) ( res *Img2ImgRes, err error)
func (*Client) Interrogate ¶
func (client *Client) Interrogate(ctx context.Context, req *InterrogateReq) ( res *InterrogateRes, err error)
Interrogate
func (*Client) InterrogateCLIP ¶
func (client *Client) InterrogateCLIP(fp string) (res *InterrogateRes, err error)
func (*Client) InterrogateDeepDanBooru ¶
func (client *Client) InterrogateDeepDanBooru(fp string) (res *InterrogateRes, err error)
func (*Client) Interrogate_url ¶
func (*Client) Txt2Img ¶
func (client *Client) Txt2Img(ctx context.Context, req *Txt2ImgReq, exts ...Extension) ( res *Txt2ImgRes, err error)
func (*Client) Txt2ImgPromot ¶
func (client *Client) Txt2ImgPromot(prompt string, batchSize uint32) (res *Txt2ImgRes, err error)
func (*Client) ValidateControlnet ¶
func (client *Client) ValidateControlnet(item *Controlnet) (err error)
type Config ¶
type Controlnet ¶
type Controlnet struct { InputImage string `json:"input_image,omitempty" mapstructure:"input_image"` // default="" Mask string `json:"mask,omitempty" mapstructure:"mask"` // default="" Module string `json:"module,omitempty" mapstructure:"module"` // default="none" Model string `json:"model,omitempty" mapstructure:"model"` // default="none" Guessmode bool `json:"guessmode,omitempty" mapstructure:"guessmode"` // default=true Lowvram bool `json:"lowvram,omitempty" mapstructure:"lowvram"` // default: false Weight float64 `json:"weight,omitempty" mapstructure:"weight"` // default=1.0 // enum: 0=Just Resize, 1=Scale to Fit (Inner Fit), 2=Envelope (Outer Fit) // default=1, "Scale to Fit (Inner Fit)" ResizeMode uint `json:"resize_mode,omitempty" mapstructure:"resize_mode"` ProcessorRes int `json:"enabled,omitempty" mapstructure:"resize_mode"` // default=64 GuidanceStart float64 `json:"guidance_start,omitempty" mapstructure:"guidance_start"` // default=0.0 GuidanceEnd float64 `json:"guidance_end,omitempty" mapstructure:"guidance_end"` // default=1.0 }
func (*Controlnet) Key ¶
func (item *Controlnet) Key() string
func (*Controlnet) Value ¶
func (item *Controlnet) Value() map[string]any
type Extensions ¶
type Extensions struct {
Controlnet *Controlnet `json:"controlnet,omitempty"`
}
func (*Extensions) HasControlnetImg ¶
func (exts *Extensions) HasControlnetImg() bool
func (*Extensions) List ¶
func (exts *Extensions) List() (results []Extension)
type Img2ImgReq ¶
type Img2ImgReq struct { Prompt string `json:"prompt,omitempty"` NegativePrompt string `json:"negative_prompt,omitempty"` InitImages []string `json:"init_images,omitempty"` // ResizeMode uint `json:"resize_mode,omitempty"` // default 0, Just resize SamplerName string `json:"sampler_name,omitempty"` // default "Euler a", sampling method Steps uint `json:"steps,omitempty"` // default 20, sampling steps RestoreFaces bool `json:"restore_faces,omitempty"` // default: false, Restore faces Tiling bool `json:"tiling,omitempty"` // default: false, Tiling Width uint32 `json:"width,omitempty"` // default 512 Height uint32 `json:"height,omitempty"` // default 512 CfgScale float64 `json:"cfg_scale,omitempty"` // default 7.0 DenoisingStrength float64 `json:"denoising_strength,omitempty"` // default 0.75 BatchSize uint32 `json:"batch_size,omitempty"` // default 1 // NIter uint32 `json:"n_iter,omitempty"` // default 1 AlwaysonScripts map[string]any `json:"alwayson_scripts,omitempty"` // extensions }
func (*Img2ImgReq) Validate ¶
func (req *Img2ImgReq) Validate() (err error)
type Img2ImgRes ¶
type InterrogateReq ¶
func (*InterrogateReq) Validate ¶
func (req *InterrogateReq) Validate() (err error)
type InterrogateRes ¶
type InterrogateRes struct {
Caption string `json:"caption"`
}
type SDError ¶
type SDError struct {
Detail []SDErrorDetail `json:"detail"`
}
type SDErrorDetail ¶
type Txt2ImgReq ¶
type Txt2ImgReq struct { Prompt string `json:"prompt,omitempty"` NegativePrompt string `json:"negative_prompt,omitempty"` SamplerName string `json:"sampler_name,omitempty"` // default "Euler a", sampling method Steps uint `json:"steps,omitempty"` // default 20, sampling steps RestoreFaces bool `json:"restore_faces,omitempty"` // default false, Restore faces Tiling bool `json:"tiling,omitempty"` // default false, Tiling // EnableHr bool `json:"enable_hr,omitempty"` // default false, Hires. fix Width uint32 `json:"width,omitempty"` // default 512 Height uint32 `json:"height,omitempty"` // default 512 BatchSize uint32 `json:"batch_size,omitempty"` // default 1 // NIter uint32 `json:"n_iter,omitempty"` // default 1 CfgScale float64 `json:"cfg_scale,omitempty"` // default 7.0 AlwaysonScripts map[string]any `json:"alwayson_scripts,omitempty"` // extensions }
func (*Txt2ImgReq) Validate ¶
func (req *Txt2ImgReq) Validate() (err error)
type Txt2ImgRes ¶
Click to show internal directories.
Click to hide internal directories.