package sd

import logger2 "chatplus/logger"

var logger = logger2.GetLogger()

type TaskInfo struct {
	SessionId   string
	JobId       int
	TaskId      string
	Data        []interface{}
	EventData   interface{}
	FnIndex     int
	SessionHash string
}

type CBReq struct {
	SessionId string
	JobId     int
	TaskId    string
	ImageName string
	ImageData string
	Progress  int
	Seed      int64
	Success   bool
	Message   string
}

var ParamKeys = map[string]int{
	"task_id":         0,
	"prompt":          1,
	"negative_prompt": 2,
	"steps":           4,
	"sampler":         5,
	"face_fix":        6,
	"cfg_scale":       10,
	"seed":            11,
	"height":          17,
	"width":           18,
	"hd_fix":          19,
	"hd_redraw_rate":  20, //高清修复重绘幅度
	"hd_scale":        21, // 高清修复放大倍数
	"hd_scale_alg":    22, // 高清修复放大算法
	"hd_sample_num":   23, // 高清修复采样次数
}

const Text2ImgParamTemplate = `[
"task(p1lk3n41saygmr8)",
"a tiger sit on the window",
"",
[],
20,
"Euler a",
false,
false,
1,
1,
7,
-1,
-1,
0,
0,
0,
false,
128,
128,
false,
0.7,
2,
"Latent",
0,
0,
0,
[],
"None",
false,
"MultiDiffusion",
false,
10,
1,
1,
64,
false,
true,
1024,
1024,
96,
96,
48,
1,
"None",
2,
false,
false,
false,
false,
false,
0.4,
0.4,
0.2,
0.2,
"",
"",
"Background",
0.2,
-1,
false,
0.4,
0.4,
0.2,
0.2,
"",
"",
"Background",
0.2,
-1,
false,
0.4,
0.4,
0.2,
0.2,
"",
"",
"Background",
0.2,
-1,
false,
0.4,
0.4,
0.2,
0.2,
"",
"",
"Background",
0.2,
-1,
false,
0.4,
0.4,
0.2,
0.2,
"",
"",
"Background",
0.2,
-1,
false,
0.4,
0.4,
0.2,
0.2,
"",
"",
"Background",
0.2,
-1,
false,
0.4,
0.4,
0.2,
0.2,
"",
"",
"Background",
0.2,
-1,
false,
0.4,
0.4,
0.2,
0.2,
"",
"",
"Background",
0.2,
-1,
false,
false,
true,
true,
false,
1536,
96,
false,
false,
"LoRA",
"None",
1,
1,
"LoRA",
"None",
1,
1,
"LoRA",
"None",
1,
1,
"LoRA",
"None",
1,
1,
"LoRA",
"None",
1,
1,
null,
"Refresh models",
null,
null,
null,
null,
false,
false,
"positive",
"comma",
0,
false,
false,
"",
"Seed",
"",
"Nothing",
"",
"Nothing",
"",
true,
false,
false,
false,
0,
null,
false,
null,
false,
null,
false,
null,
false,
50,
[],
"",
"",
""
]`
