Versions in this module Expand all Collapse all v0 v0.3.0 Jan 29, 2024 v0.2.3 Aug 1, 2023 Changes in this version + const DefaultCfgScale + const DefaultNum + const DefaultSteps + const MaxHFSteps + const MaxNum + const T_Guest + const T_Prohibit + const T_Subscribe + var AllMode = [...]string + var Ucmap = map[string]string + func DefauleUC() string + func ReplaceColon(s string) string + func ReplaceString(src string) string type 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 + type ConfigFuncCorrentCfg func(*CorrectConfig) + 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 struct + CtrlPhoto bool + Mode bool + Model bool + Seed bool + Strength bool + Tag bool + TransTag bool + TransUc bool + Uc bool type Handler + Api *api.API + ControlPreProcess []gconfig.ControlPreProcess + ControlProcess []gconfig.ControlProcess + DB *db.DB + DefaultCfgScale int + DefaultMode string + DefaultNum int + DefaultSteps int + DefaultUC string + ExtraModel []gconfig.ExtraModel + ExtraModelAllGroup []string + ImgMaxSize int + MaxHFSteps int + MaxNum int + Models []gconfig.Model + UserHandler *UserHandler + 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) 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 + type Task struct + func GetTask(userID int64, types TaskType) (*Task, error) + func (t *Task) Set(key string, value any) + func (t *Task) Value(key string) any + func (task *Task) Down() + func (task *Task) ID() int64 + func (task *Task) Type() TaskType + type TaskType uint + const T_CtrlPhoto + const T_Draw + const T_GuessTag + const T_SuperResolution + type UserHandler struct + func NewUserHandler(handler *Handler, db *gorm.DB) *UserHandler + func (uh *UserHandler) LoadAndInitUser(bot *tgbotapi.BotAPI, userID int64) (u *UserInfo, err error) + func (uh *UserHandler) LoadUser(bot *tgbotapi.BotAPI, userID int64) (u *UserInfo, err error) + type UserInfo struct + ChatMember *tgbotapi.ChatMember + LastUpdate time.Time + Subscribe *db.Subscribe + UserInfo *db.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) v0.2.2 Jun 22, 2023 v0.2.1 Jun 21, 2023 v0.2.0 Jun 21, 2023 Changes in this version + type ConfigFunc func(h *Handler) + func WithCache(cache cache.Cache) ConfigFunc + func WithOwnerID(id int64) ConfigFunc + func WithWebhook(webhookHost string) ConfigFunc + type Handler struct + func New(tgToken string, configs ...ConfigFunc) (*Handler, error) + func (h *Handler) Bot() *tgbotapi.BotAPI + func (h *Handler) Cache() cache.Cache + func (h *Handler) HandleCallback(CallbackQuery *tgbotapi.CallbackQuery) + func (h *Handler) HandleCmd(Message tgbotapi.Message) + func (h *Handler) HandleMsg(Message *tgbotapi.Message) + 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 v0.1.1 Jun 21, 2023 v0.1.0 Jun 20, 2023 Changes in this version + const GuestImgMaxSize + const MAXONEPAGEOBJ + const MAXROW + func HandleCallback(bot *tgbotapi.BotAPI, CallbackQuery *tgbotapi.CallbackQuery) + func HandleCmd(bot *tgbotapi.BotAPI, Message tgbotapi.Message) + func HandleMsg(bot *tgbotapi.BotAPI, Message *tgbotapi.Message) + type Config struct + ControlPhotoID string + PrePhotoID string + func (c *Config) Fomate2TgHTML() []byte + func (c *Config) Fomate2TgMdV2() []byte + func (cfg *Config) CorrectCfg(u *user.UserInfo, gTag, gUc, transTag, transUc, gSeed bool)