sdapi

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: May 8, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func VersionCheckGetStr

func VersionCheckGetStr(ctx context.Context, stableDiffusionApiHost string) (res string, updateNeededOrError bool)

Types

type RenderReq

type RenderReq struct {
	EnableHR          bool                   `json:"enable_hr"`
	DenoisingStrength float32                `json:"denoising_strength"`
	HRScale           float32                `json:"hr_scale"`
	HRUpscaler        string                 `json:"hr_upscaler"`
	HRSecondPassSteps int                    `json:"hr_second_pass_steps"`
	HRSamplerName     string                 `json:"hr_sampler_name"`
	HRPrompt          string                 `json:"hr_prompt"`
	HRNegativePrompt  string                 `json:"hr_negative_prompt"`
	Prompt            string                 `json:"prompt"`
	Seed              uint32                 `json:"seed"`
	SamplerName       string                 `json:"sampler_name"`
	BatchSize         int                    `json:"batch_size"`
	NIter             int                    `json:"n_iter"`
	Steps             int                    `json:"steps"`
	CFGScale          float64                `json:"cfg_scale"`
	Width             int                    `json:"width"`
	Height            int                    `json:"height"`
	NegativePrompt    string                 `json:"negative_prompt"`
	OverrideSettings  map[string]interface{} `json:"override_settings"`
	SendImages        bool                   `json:"send_images"`
}

type SdAPIType

type SdAPIType struct {
	SdHost string
}

func (*SdAPIType) GetEmbeddings

func (a *SdAPIType) GetEmbeddings(ctx context.Context) (embs []string, err error)

func (*SdAPIType) GetLoRAs

func (a *SdAPIType) GetLoRAs(ctx context.Context) (loras []string, err error)

func (*SdAPIType) GetModels

func (a *SdAPIType) GetModels(ctx context.Context) (models []string, err error)

func (*SdAPIType) GetProgress

func (a *SdAPIType) GetProgress(ctx context.Context) (progressPercent int, eta time.Duration, err error)

func (*SdAPIType) GetSamplers

func (a *SdAPIType) GetSamplers(ctx context.Context) (samplers []string, err error)

func (*SdAPIType) GetUpscalers

func (a *SdAPIType) GetUpscalers(ctx context.Context) (upscalers []string, err error)

func (*SdAPIType) GetVAEs

func (a *SdAPIType) GetVAEs(ctx context.Context) (vaes []string, err error)

func (*SdAPIType) Interrupt

func (a *SdAPIType) Interrupt(ctx context.Context) error

func (*SdAPIType) Render

func (a *SdAPIType) Render(ctx context.Context, p reqparams.ReqParams, _ []byte) (imgs [][]byte, err error)

func (*SdAPIType) Upscale

func (a *SdAPIType) Upscale(ctx context.Context, p reqparams.ReqParams, imageData []byte) (imgs [][]byte, err error)

type UpscaleReq

type UpscaleReq struct {
	ResizeMode                     int     `json:"resize_mode,omitempty"`
	ShowExtrasResults              bool    `json:"show_extras_results,omitempty"`
	GFPGANVisibility               float32 `json:"gfpgan_visibility,omitempty"`
	CodeFormerVisibility           float32 `json:"codeformer_visibility,omitempty"`
	CodeFormerWeight               float32 `json:"codeformer_weight,omitempty"`
	UpscalingResize                float32 `json:"upscaling_resize,omitempty"`
	UpscalingResizeWidth           int     `json:"upscaling_resize_w,omitempty"`
	UpscalingResizeHeight          int     `json:"upscaling_resize_h,omitempty"`
	UpscalingResizeWidthHeightCrop bool    `json:"upscaling_crop,omitempty"`
	Upscaler1                      string  `json:"upscaler_1,omitempty"`
	Upscaler2                      string  `json:"upscaler_2,omitempty"`
	Upscaler2Visibility            float32 `json:"extras_upscaler_2_visibility,omitempty"`
	UpscaleFirst                   bool    `json:"upscale_first,omitempty"`
	Image                          string  `json:"image"`
}

Jump to

Keyboard shortcuts

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