Documentation ¶
Index ¶
- Variables
- type AcceptedResponse
- type AcceptedResponseBody
- type AlwaysonScripts
- type ApiRequest
- type DownloadInfo
- type GenerateRequest
- type GenerationModel
- type Group
- type GrpcArgs
- type HRArgs
- type IngestArgs
- type LoraVersionReference
- type ModelDownloadRequest
- type ModelOptions
- type ModelVersionDetails
- type ModelVersionFile
- type ModelVersionReference
- type ModelVersionResponse
- type SharedArgs
- type WebuiRequest
- type WebuiResponse
Constants ¶
This section is empty.
Variables ¶
View Source
var (
QueueSize atomic.Int64
)
Functions ¶
This section is empty.
Types ¶
type AcceptedResponse ¶
type AcceptedResponse struct {
Body AcceptedResponseBody
}
func PostGenerate ¶
func PostGenerate(ctx context.Context, input *GenerateRequest) (*AcceptedResponse, error)
type AcceptedResponseBody ¶
type AlwaysonScripts ¶
type AlwaysonScripts struct { //add controlnet later GrpcClient GrpcArgs `json:"grpc_client" validate:"required"` }
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) GetLogTags ¶
func (req *ApiRequest) GetLogTags() string
func (*ApiRequest) LogWithTags ¶
func (req *ApiRequest) LogWithTags(ctx context.Context, msg ...string)
type DownloadInfo ¶
type DownloadInfo struct { Name string `json:"name" validate:"required"` // The name of the file without the extension Filename string `json:"filename" validate:"required"` // The name of the file with the extension Extension string `json:"ext" validate:"required"` // The extension type of the file DownloadUrl string `json:"downloadUrl" validate:"required,url"` // The url to download the file Type string `json:"type" validate:"oneof=ckpt lora lyco vae"` // The type of the file, should be one of the following: ckpt, lora, lyco }
func (*DownloadInfo) GetLogTags ¶
func (ref *DownloadInfo) GetLogTags() string
func (*DownloadInfo) LogWithTags ¶
func (ref *DownloadInfo) LogWithTags(ctx context.Context, msg ...string)
type GenerateRequest ¶
type GenerateRequest struct { Body struct { ApiRequest } }
type GenerationModel ¶
type GenerationModel struct { IngestArgs GroupId string `json:"group_id" validate:"omitempty"` Checkpoint *ModelVersionDetails `json:"checkpoint" validate:"required"` HrCheckpoint *ModelVersionDetails `json:"hr_checkpoint" validate:"omitempty"` Loras []ModelVersionDetails `json:"lora_models" validate:"omitempty"` HrLoras []ModelVersionDetails `json:"hr_models" validate:"omitempty"` }
func (*GenerationModel) GetLogTags ¶
func (req *GenerationModel) GetLogTags() string
func (*GenerationModel) LogWithTags ¶
func (req *GenerationModel) LogWithTags(ctx context.Context, msg ...string)
type GrpcArgs ¶
type GrpcArgs struct {
Args []IngestArgs `json:"args" validate:"required"`
}
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:"excluded_unless=EnableHr true"` HrSamplerName string `json:"hr_sampler_name,omitempty" validate:"excluded_unless=EnableHr true"` HrUpscaler string `json:"hr_upscaler,omitempty" validate:"excluded_unless=EnableHr true"` HrSecondPassSteps int32 `json:"hr_second_pass_steps,omitempty" validate:"excluded_unless=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:"excluded_unless=EnableHr true"` HrNegativePrompt string `json:"hr_negative_prompt,omitempty" validate:"excluded_unless=EnableHr true"` }
arguments to send when EnableHr is true
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 ModelDownloadRequest ¶
type ModelDownloadRequest struct { DownloadUrl string `json:"downloadUrl" validate:"required,url"` Filename string `json:"filename" validate:"required"` Type string `json:"type" validate:"oneof=ckpt lora lyco"` }
type ControlnetGenerationSend struct { GenerationSend EmbeddingModels []ModelVersionReference `json:"embedding_models,omitempty" validate:"omitempty"` ControlnetModels []ModelVersionReference `json:"controlnet_models,omitempty" validate:"omitempty"` }
Wrapper class to send to extras/model/download
type ModelOptions ¶
type ModelOptions struct {
SdModelCheckpoint string `json:"sd_model_checkpoint"`
}
type ModelVersionDetails ¶
type ModelVersionDetails struct { ModelVersionResponse Multiplier float32 `json:"multiplier" validate:"omitempty"` // Only used for Lora models Vae *DownloadInfo `json:"vae" validate:"omitempty"` // VAE file reference Model *DownloadInfo `json:"model" validate:"required"` // Model file reference }
func (*ModelVersionDetails) GetLogTags ¶
func (ref *ModelVersionDetails) GetLogTags() string
func (*ModelVersionDetails) LogWithTags ¶
func (req *ModelVersionDetails) LogWithTags(ctx context.Context, msg ...string)
type ModelVersionFile ¶
type ModelVersionReference ¶
type ModelVersionReference struct { ModelUuid string `json:"modelUuid" validate:"required,uuid"` VersionUuid 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 ModelVersionResponse ¶
type ModelVersionResponse struct { Uuid string `json:"uuid" validate:"required,uuid"` // Version uuid ModelUUID string `json:"modelUUID" validate:"required,uuid"` // Model uuid Name string `json:"name" validate:"required"` Files []ModelVersionFile `json:"files" validate:"required"` Type string `json:"type" validate:"oneof=LORA LoCon Checkpoint TextualInversion"` }
The response from /model/version/details/{uuid}
type WebuiRequest ¶
type WebuiRequest struct { SdModelCheckpoint string `json:"sd_model_checkpoint" validate:"required"` // String representation of ModelVersionReference to send to webui SendImage bool `json:"send_image" validate:"omitempty"` // should always be false AlwaysonScripts AlwaysonScripts `json:"alwayson_scripts" validate:"omitempty"` // additonal values, unstructured json, probably need real models for this }
sent to automatic1111 webui
func (*WebuiRequest) GetLogTags ¶
func (msg *WebuiRequest) GetLogTags() string
TODO: add prompt/negative prompt length
func (*WebuiRequest) LogWithTags ¶
func (req *WebuiRequest) LogWithTags(ctx context.Context, msg ...string)
func (*WebuiRequest) Validate ¶
func (req *WebuiRequest) Validate() error
type WebuiResponse ¶
type WebuiResponse struct {
Info string `json:"info,omitempty" validate:"omitempty"`
}
Click to show internal directories.
Click to hide internal directories.