diff --git a/models/Image.go b/models/Image.go index 3b4745d..6e4e909 100644 --- a/models/Image.go +++ b/models/Image.go @@ -41,29 +41,6 @@ type Image struct { UpdatedAt time.Time `json:"updated_at" gorm:"autoUpdateTime"` } -//// 参数校验 -//func (img *Image) ParameterCheck() (err error) { -// if img.NumInferenceSteps <= 0 { -// img.NumInferenceSteps = 20 -// } -// if img.NumInferenceSteps > 500 { -// img.NumInferenceSteps = 500 -// } -// if img.GuidanceScale <= 0 { -// img.GuidanceScale = 1 -// } -// if img.GuidanceScale > 20 { -// img.GuidanceScale = 20 -// } -// if img.Scheduler == "" { -// img.Scheduler = "DDIM" -// } -// if img.Seed == "" { -// img.Seed = "0" -// } -// return -//} - // 将图片输出为指定尺寸的 webp 格式(默认使用 Lanczos 缩放算法) func (img *Image) ToWebP(width int, height int, fit string) ([]byte, error) { // 從絕對路徑讀原始圖片 diff --git a/routers/params.go b/routers/params.go index 4a4f7c2..0b94a1b 100644 --- a/routers/params.go +++ b/routers/params.go @@ -29,6 +29,7 @@ func ParamsModelsGet(w http.ResponseWriter, r *http.Request) { params["status"] = []string{"pending", "running", "finished", "failed"} params["base_model"] = []string{"SD1.5", "SD2"} params["size"] = []string{"512x512", "768x768", "1024x768"} + params["sampler_name"] = []string{"Euler a", "Euler", "LMS", "Heun", "DPM2", "DPM2 a", "DPM++ 2S a", "DPM++ 2M", "DPM++ SDE", "DPM++ 2M SDE", "DPM fast", "DDIM"} w.Header().Set("Content-Type", "application/json; charset=utf-8") w.Write(utils.ToJSON(params)) }