Documentation ¶
Index ¶
- Variables
- func SendResults(ctx context.Context, gen *ApiRequest) error
- type ApiRequest
- func (g *ApiRequest) AddToQueue(ctx context.Context) error
- func (g *ApiRequest) CleanRequest() error
- func (req *ApiRequest) GetLogTags() string
- func (req *ApiRequest) LogWithTags(ctx context.Context, msg ...string)
- func (g *ApiRequest) MakeBatch() <-chan *ApiRequest
- func (g *ApiRequest) Validate() error
- type HRArgs
- type HRParams
- type ImageMetadata
- type ImageParams
- type ImageToImageParams
- type IngestArgs
- type LoraVersionReference
- type ModelReference
- type ModelVersionReference
- type SdApiRequest
- type SharedArgs
- type SharedParams
- type WebuiResponse
Constants ¶
This section is empty.
Variables ¶
View Source
var AddHeaders = utils.AuthedRequest
View Source
var (
QueueSize atomic.Int64
)
Functions ¶
func SendResults ¶
func SendResults(ctx context.Context, gen *ApiRequest) error
Types ¶
type ApiRequest ¶
type ApiRequest struct { WebuiResponse IngestArgs NIter int64 `json:"n_iter,omitempty" validate:"omitempty"` Hide bool `json:"hide" validate:"omitempty,boolean"` CheckpointModel *ModelVersionReference `json:"checkpoint_model" validate:"required_without=SdModelCheckpoint"` LoraModels []LoraVersionReference `json:"lora_models,omitempty" validate:"omitempty"` GroupId string `json:"group_id" validate:"required"` HrCheckpointModel *ModelVersionReference `json:"hr_checkpoint_model,omitempty" validate:"omitempty,required_if=EnableHr true"` HrLoraModels []LoraVersionReference `json:"hr_lora_models,omitempty" validate:"omitempty,dive,excluded_unless=EnableHr true"` }
Recived from frontend & sent to sd-api
func (*ApiRequest) AddToQueue ¶
func (g *ApiRequest) AddToQueue(ctx context.Context) error
func (*ApiRequest) CleanRequest ¶
func (g *ApiRequest) CleanRequest() error
clean the request, do this before putting on message queue, public to simplify mocking/testing a bit
func (*ApiRequest) GetLogTags ¶
func (req *ApiRequest) GetLogTags() string
func (*ApiRequest) LogWithTags ¶
func (req *ApiRequest) LogWithTags(ctx context.Context, msg ...string)
func (*ApiRequest) MakeBatch ¶
func (g *ApiRequest) MakeBatch() <-chan *ApiRequest
func (*ApiRequest) Validate ¶
func (g *ApiRequest) Validate() error
type HRArgs ¶
type HRArgs struct { EnableHr bool `json:"enable_hr" validate:"omitempty"` //man composition would simplify this declaration a lot, but probably make the code more confusing HrScale float32 `json:"hr_scale,omitempty" validate:"required_if=EnableHr true"` HrSamplerName string `json:"hr_sampler_name,omitempty" validate:"required_if=EnableHr true"` HrUpscaler string `json:"hr_upscaler,omitempty" validate:"required_if=EnableHr true"` HrSecondPassSteps int32 `json:"hr_second_pass_steps,omitempty" validate:"required_if=EnableHr true"` HrResizeX int32 `json:"hr_resize_x,omitempty" validate:"excluded_unless=EnableHr true"` HrResizeY int32 `json:"hr_resize_y,omitempty" validate:"excluded_unless=EnableHr true"` HrPrompt string `json:"hr_prompt,omitempty" validate:"required_if=EnableHr true"` HrNegativePrompt string `json:"hr_negative_prompt,omitempty" validate:"required_if=EnableHr true"` }
arguments to send when EnableHr is true
type ImageMetadata ¶
type ImageMetadata struct { AlwaysonScripts string `json:"alwayson_scripts"` ExtraGenerationParams string `json:"extra_generation_params"` Info string `json:"info"` ModelHash string `json:"model_hash"` OverrideSettings map[string]interface{} `json:"override_settings"` ScriptArgs []string `json:"script_args"` ScriptName string `json:"script_name"` }
type ImageParams ¶
type ImageParams struct { Id string `json:"id"` UserId string `json:"user_id"` BatchId string `json:"batch_id"` CfgScale float32 `json:"cfg_scale"` EnableHr bool `json:"enable_hr"` Filepath string `json:"filepath"` Hide bool `json:"hide"` RestoreFaces bool `json:"restore_faces"` Seed string `json:"seed"` SeedResizeFromH int32 `json:"seed_resize_from_h"` SeedResizeFromW int32 `json:"seed_resize_from_w"` Subseed string `json:"subseed"` Tiling bool `json:"tiling"` Type string `json:"type"` Height int32 `json:"height"` Width int32 `json:"width"` }
type ImageToImageParams ¶
type ImageToImageParams struct { DenoisingStrength float32 `json:"denoising_strength,omitempty"` FirstphaseHeight int32 `json:"firstphase_height,omitempty"` FirstphaseWidth int32 `json:"firstphase_width,omitempty"` InpaintFullRes bool `json:"inpaint_full_res,omitempty"` InpaintFullResPadding int32 `json:"inpaint_full_res_padding,omitempty"` InpaintingFill int32 `json:"inpainting_fill,omitempty"` InpaintingMaskInvert int32 `json:"inpainting_mask_invert,omitempty"` Mask []int32 `json:"mask,omitempty"` MaskBlur int32 `json:"mask_blur,omitempty"` }
type IngestArgs ¶
type IngestArgs struct { BatchId string `json:"batch_id" validate:"required,uuid"` UserId string `json:"user_id,omitempty" validate:"required,uuid"` // Generation Id, unneeded in request context Id string `json:"name,omitempty" validate:"required,uuid"` Type string `json:"type" validate:"oneof=txt2img img2img upscale"` }
type LoraVersionReference ¶
type LoraVersionReference struct { ModelVersionReference Multiplier float32 `json:"multiplier" validate:"required"` }
Lora Ref as passed from ui
type ModelReference ¶
type ModelVersionReference ¶
type ModelVersionReference struct { ModelId string `json:"modelUuid" validate:"required,uuid"` VersionId string `json:"versionUuid" validate:"required,uuid"` }
Generic ModelRef as passed from ui
func (*ModelVersionReference) GetLogTags ¶
func (ref *ModelVersionReference) GetLogTags() string
func (*ModelVersionReference) LogWithTags ¶
func (req *ModelVersionReference) LogWithTags(ctx context.Context, msg ...string)
type SdApiRequest ¶
type SdApiRequest struct { GroupId string `json:"group_id,omitempty" validate:"omitempty"` HrImageParams *HRParams `json:"hr_image_params,omitempty" validate:"omitempty"` Image ImageParams `json:"image" validate:"required"` ImageMetadata ImageMetadata `json:"image_metadata" validate:"required"` ImageToImageParams *ImageToImageParams `json:"image_to_image_params,omitempty" validate:"omitempty"` Models []ModelReference `json:"models"` }
Sent to rust-sd-api
func (*SdApiRequest) GetLogTags ¶
func (req *SdApiRequest) GetLogTags() string
func (*SdApiRequest) LogWithTags ¶
func (req *SdApiRequest) LogWithTags(ctx context.Context, msg ...string)
func (*SdApiRequest) Validate ¶
func (g *SdApiRequest) Validate() error
type WebuiResponse ¶
type WebuiResponse struct {
Info string `json:"info,omitempty" validate:"omitempty"`
}
Click to show internal directories.
Click to hide internal directories.