Documentation ¶
Index ¶
- Constants
- Variables
- func DefauleUC() string
- func ReplaceColon(s string) string
- func ReplaceString(src string) string
- type ConfigFunc
- func WithCache(cache cache.Cache) ConfigFunc
- func WithDefaultCfgScale(DefaultCfgScale int) ConfigFunc
- func WithDefaultNum(DefaultNum int) ConfigFunc
- func WithDefaultSteps(DefaultSteps int) ConfigFunc
- func WithDefaultUC(DefaultUC string) ConfigFunc
- func WithExtraModel(ExtraModel []gconfig.ExtraModel) ConfigFunc
- func WithGroup(Group string) ConfigFunc
- func WithGuide(Guide string) ConfigFunc
- func WithImgMaxSize(ImgMaxSize int) ConfigFunc
- func WithMaxHFSteps(MaxHFSteps int) ConfigFunc
- func WithMaxNum(MaxNum int) ConfigFunc
- func WithModels(models []gconfig.Model) ConfigFunc
- func WithModes(mode []string) ConfigFunc
- func WithOwnerID(id int64) ConfigFunc
- func WithWebhook(webhookHost string) ConfigFunc
- type ConfigFuncCorrentCfg
- func WithCtrlPhoto() ConfigFuncCorrentCfg
- func WithMode() ConfigFuncCorrentCfg
- func WithModel() ConfigFuncCorrentCfg
- func WithSeed() ConfigFuncCorrentCfg
- func WithStrength() ConfigFuncCorrentCfg
- func WithTag() ConfigFuncCorrentCfg
- func WithTransTag() ConfigFuncCorrentCfg
- func WithTransUc() ConfigFuncCorrentCfg
- func WithUc() ConfigFuncCorrentCfg
- type CorrectConfig
- type Handler
- func (h *Handler) Bot() *tgbotapi.BotAPI
- func (h *Handler) Cache() cache.Cache
- func (h *Handler) CorrectCfg(cfg *db.Config, u *UserInfo, c ...ConfigFuncCorrentCfg)
- func (h *Handler) DefaultConfig() *db.Config
- func (h *Handler) GroupIndex2ExtraModels(groupIndex int) []gconfig.ExtraModel
- func (h *Handler) HandleCallback(CallbackQuery *tgbotapi.CallbackQuery)
- func (h *Handler) HandleCmd(Message tgbotapi.Message)
- func (h *Handler) HandleMsg(Message *tgbotapi.Message)
- func (h *Handler) Index2ExtraModel(GroupIndex, LoraIndex int) gconfig.ExtraModel
- func (h *Handler) MODELFILETONAME(file string) (string, error)
- func (h *Handler) Name2Model(name string) (gconfig.Model, error)
- func (h *Handler) Name2Process(name string) (gconfig.ControlProcess, error)
- func (h *Handler) NewDrawConfig(cfg *db.Config, initPhoto, ControlPhoto []byte) *api.Config
- func (h *Handler) ParseCfgScalse(scale int) int
- func (h *Handler) ParseNum(num int) int
- func (h *Handler) ParsePreProcess(PreProcess string) string
- func (h *Handler) ParseProcess(Process string) string
- func (h *Handler) ParseSteps(steps int) int
- func (h *Handler) Run(ctx context.Context)
- func (h *Handler) SetCommand()
- func (h *Handler) WebhookEnabled() bool
- func (h *Handler) WebhookHandler() func(w http.ResponseWriter, r *http.Request)
- func (h *Handler) WebhookUriPath() string
- type Task
- type TaskType
- type UserHandler
- type UserInfo
- func (u *UserInfo) AddTask(types TaskType) (*Task, error)
- func (u *UserInfo) ChangeDefaultMODE(mode string) error
- func (u *UserInfo) ChangeDefaultNumber(num int) error
- func (u *UserInfo) ChangeDefaultScale(scale int) error
- func (u *UserInfo) ChangeDefaultSteps(steps int) error
- func (u *UserInfo) ChangeDefaultUC(uc string) error
- func (u *UserInfo) ChangeShare(share bool) error
- func (u *UserInfo) DefaultConfig() *db.Config
- func (u *UserInfo) LoadExtraLang(tag string) string
- func (u *UserInfo) LoadLang(tag string) string
- func (u *UserInfo) Passwd() string
- func (u *UserInfo) Permissions() permissions
- func (u *UserInfo) ProhibitString(bot *tgbotapi.BotAPI) string
- func (u *UserInfo) SetLang(langType string) error
- func (u *UserInfo) UseFree(n int)
Constants ¶
View Source
const ( MaxHFSteps = 20 MaxNum = 9 DefaultCfgScale = 9 DefaultSteps = 20 DefaultNum = 1 )
View Source
const ( T_Prohibit permissions = iota T_Guest T_Subscribe )
View Source
const (
GuestImgMaxSize = 737280
)
View Source
const MAXONEPAGEOBJ = MAXROW * 7
View Source
const MAXROW = 3
Variables ¶
View Source
var AllMode = [...]string{"DPM++ 2M Karras", "DPM++ 2M SDE Karras", "DPM++ SDE Karras", "Euler a", "DPM2", "DPM adaptive", "DPM2 a Karras", "DPM2 Karras", "DPM++ 2M", "DPM++ 2S a", "DPM++ 2S a Karras", "DPM++ SDE", "LMS Karras", "Euler", "DDIM", "Heun", "UniPC"}
View Source
var Ucmap = map[string]string{
"low quality": "cropped, worst quality, low quality, normal quality, jpeg artifacts, signature, watermark, username, blurry",
"bad anatomy": "bad anatomy, bad hands, error, missing fingers, extra digit, fewer digits",
}
Functions ¶
func ReplaceColon ¶ added in v0.2.3
func ReplaceString ¶ added in v0.2.3
Types ¶
type ConfigFunc ¶ added in v0.2.0
type ConfigFunc func(h *Handler)
func WithCache ¶ added in v0.2.0
func WithCache(cache cache.Cache) ConfigFunc
func WithDefaultCfgScale ¶ added in v0.2.3
func WithDefaultCfgScale(DefaultCfgScale int) ConfigFunc
func WithDefaultNum ¶ added in v0.2.3
func WithDefaultNum(DefaultNum int) ConfigFunc
func WithDefaultSteps ¶ added in v0.2.3
func WithDefaultSteps(DefaultSteps int) ConfigFunc
func WithDefaultUC ¶ added in v0.2.3
func WithDefaultUC(DefaultUC string) ConfigFunc
func WithExtraModel ¶ added in v0.2.3
func WithExtraModel(ExtraModel []gconfig.ExtraModel) ConfigFunc
func WithGroup ¶ added in v0.2.3
func WithGroup(Group string) ConfigFunc
func WithGuide ¶ added in v0.2.3
func WithGuide(Guide string) ConfigFunc
func WithImgMaxSize ¶ added in v0.2.3
func WithImgMaxSize(ImgMaxSize int) ConfigFunc
func WithMaxHFSteps ¶ added in v0.2.3
func WithMaxHFSteps(MaxHFSteps int) ConfigFunc
func WithMaxNum ¶ added in v0.2.3
func WithMaxNum(MaxNum int) ConfigFunc
func WithModels ¶ added in v0.2.3
func WithModels(models []gconfig.Model) ConfigFunc
func WithModes ¶ added in v0.2.3
func WithModes(mode []string) ConfigFunc
func WithOwnerID ¶ added in v0.2.0
func WithOwnerID(id int64) ConfigFunc
type ConfigFuncCorrentCfg ¶ added in v0.2.3
type ConfigFuncCorrentCfg func(*CorrectConfig)
func WithCtrlPhoto ¶ added in v0.2.3
func WithCtrlPhoto() ConfigFuncCorrentCfg
func WithMode ¶ added in v0.2.3
func WithMode() ConfigFuncCorrentCfg
func WithModel ¶ added in v0.2.3
func WithModel() ConfigFuncCorrentCfg
func WithSeed ¶ added in v0.2.3
func WithSeed() ConfigFuncCorrentCfg
func WithStrength ¶ added in v0.2.3
func WithStrength() ConfigFuncCorrentCfg
func WithTag ¶ added in v0.2.3
func WithTag() ConfigFuncCorrentCfg
func WithTransTag ¶ added in v0.2.3
func WithTransTag() ConfigFuncCorrentCfg
func WithTransUc ¶ added in v0.2.3
func WithTransUc() ConfigFuncCorrentCfg
func WithUc ¶ added in v0.2.3
func WithUc() ConfigFuncCorrentCfg
type CorrectConfig ¶ added in v0.2.3
type Handler ¶ added in v0.2.0
type Handler struct { Api *api.API DB *db.DB UserHandler *UserHandler Models []gconfig.Model MaxHFSteps, MaxNum, DefaultCfgScale, DefaultSteps, DefaultNum, ImgMaxSize int DefaultUC, DefaultMode string ControlPreProcess []gconfig.ControlPreProcess ControlProcess []gconfig.ControlProcess ExtraModel []gconfig.ExtraModel ExtraModelAllGroup []string // contains filtered or unexported fields }
func (*Handler) CorrectCfg ¶ added in v0.2.3
func (h *Handler) CorrectCfg(cfg *db.Config, u *UserInfo, c ...ConfigFuncCorrentCfg)
func (*Handler) DefaultConfig ¶ added in v0.2.3
func (*Handler) GroupIndex2ExtraModels ¶ added in v0.2.3
func (h *Handler) GroupIndex2ExtraModels(groupIndex int) []gconfig.ExtraModel
func (*Handler) HandleCallback ¶ added in v0.2.0
func (h *Handler) HandleCallback(CallbackQuery *tgbotapi.CallbackQuery)
func (*Handler) Index2ExtraModel ¶ added in v0.2.3
func (h *Handler) Index2ExtraModel(GroupIndex, LoraIndex int) gconfig.ExtraModel
func (*Handler) MODELFILETONAME ¶ added in v0.2.3
func (*Handler) Name2Model ¶ added in v0.2.3
func (*Handler) Name2Process ¶ added in v0.2.3
func (h *Handler) Name2Process(name string) (gconfig.ControlProcess, error)
func (*Handler) NewDrawConfig ¶ added in v0.2.3
func (*Handler) ParseCfgScalse ¶ added in v0.2.3
func (*Handler) ParsePreProcess ¶ added in v0.2.3
func (*Handler) ParseProcess ¶ added in v0.2.3
func (*Handler) ParseSteps ¶ added in v0.2.3
func (*Handler) SetCommand ¶ added in v0.2.0
func (h *Handler) SetCommand()
func (*Handler) WebhookEnabled ¶ added in v0.2.0
func (*Handler) WebhookHandler ¶ added in v0.2.0
func (h *Handler) WebhookHandler() func(w http.ResponseWriter, r *http.Request)
only Enable Webhook
func (*Handler) WebhookUriPath ¶ added in v0.2.0
type UserHandler ¶ added in v0.2.3
type UserHandler struct {
// contains filtered or unexported fields
}
func NewUserHandler ¶ added in v0.2.3
func NewUserHandler(handler *Handler, db *gorm.DB) *UserHandler
func (*UserHandler) LoadAndInitUser ¶ added in v0.2.3
type UserInfo ¶ added in v0.2.3
type UserInfo struct { UserInfo *db.UserInfo Subscribe *db.Subscribe ChatMember *tgbotapi.ChatMember LastUpdate time.Time // contains filtered or unexported fields }
func (*UserInfo) ChangeDefaultMODE ¶ added in v0.2.3
func (*UserInfo) ChangeDefaultNumber ¶ added in v0.2.3
func (*UserInfo) ChangeDefaultScale ¶ added in v0.2.3
func (*UserInfo) ChangeDefaultSteps ¶ added in v0.2.3
func (*UserInfo) ChangeDefaultUC ¶ added in v0.2.3
func (*UserInfo) ChangeShare ¶ added in v0.2.3
func (*UserInfo) DefaultConfig ¶ added in v0.2.3
func (*UserInfo) LoadExtraLang ¶ added in v0.2.3
func (*UserInfo) Permissions ¶ added in v0.2.3
func (u *UserInfo) Permissions() permissions
func (*UserInfo) ProhibitString ¶ added in v0.2.3
Source Files ¶
Click to show internal directories.
Click to hide internal directories.