From 01b16f892674e85144afaf0cb49f3fb0688ea13b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A1=9C=E8=8F=AF?= Date: Fri, 23 Jun 2023 18:39:21 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=BD=E9=AB=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- routers/params.go | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/routers/params.go b/routers/params.go index 0b94a1b..2e5f290 100644 --- a/routers/params.go +++ b/routers/params.go @@ -23,12 +23,28 @@ func ParamsListGet(w http.ResponseWriter, r *http.Request) { w.Write(utils.ToJSON(listview)) } +type Size struct { + Width int `json:"width"` + Height int `json:"height"` + AspectRatio string `json:"aspect_ratio"` +} + func ParamsModelsGet(w http.ResponseWriter, r *http.Request) { + var size_list []Size + size_list = append(size_list, Size{Width: 512, Height: 512, AspectRatio: "1:1"}) + size_list = append(size_list, Size{Width: 768, Height: 768, AspectRatio: "1:1"}) + size_list = append(size_list, Size{Width: 1024, Height: 768, AspectRatio: "4:3"}) + size_list = append(size_list, Size{Width: 1024, Height: 1024, AspectRatio: "1:1"}) + size_list = append(size_list, Size{Width: 1280, Height: 720, AspectRatio: "16:9"}) + size_list = append(size_list, Size{Width: 1280, Height: 1024, AspectRatio: "5:4"}) + size_list = append(size_list, Size{Width: 1920, Height: 1080, AspectRatio: "16:9"}) + size_list = append(size_list, Size{Width: 1920, Height: 1200, AspectRatio: "16:10"}) + params := make(map[string]interface{}) params["type"] = []string{"lora", "ckp", "hyper", "ti"} params["status"] = []string{"pending", "running", "finished", "failed"} params["base_model"] = []string{"SD1.5", "SD2"} - params["size"] = []string{"512x512", "768x768", "1024x768"} + params["size"] = size_list 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))