DEBUG 宽高更正
This commit is contained in:
@@ -154,12 +154,8 @@ func (model *Model) Inference(image_list []Image, callback func(Image)) {
|
|||||||
datx["n_iter"] = len(image_list) // 生成图像数量
|
datx["n_iter"] = len(image_list) // 生成图像数量
|
||||||
datx["steps"] = img.Steps // 迭代步数
|
datx["steps"] = img.Steps // 迭代步数
|
||||||
datx["cfg_scale"] = img.CfgScale // 提示词引导系数 (CFG Scale)
|
datx["cfg_scale"] = img.CfgScale // 提示词引导系数 (CFG Scale)
|
||||||
if img.Width > 0 {
|
datx["width"] = img.Width // 图片宽度
|
||||||
datx["width"] = img.Width // 图片宽度
|
datx["height"] = img.Height // 图片高度
|
||||||
}
|
|
||||||
if img.Height > 0 {
|
|
||||||
datx["height"] = img.Height // 图片高度
|
|
||||||
}
|
|
||||||
if img.SamplerName == "" {
|
if img.SamplerName == "" {
|
||||||
datx["sampler_name"] = img.SamplerName // 采样器名称
|
datx["sampler_name"] = img.SamplerName // 采样器名称
|
||||||
}
|
}
|
||||||
@@ -186,8 +182,6 @@ func (model *Model) Inference(image_list []Image, callback func(Image)) {
|
|||||||
image_list[index].Path = "data/images/" + filename + ".webp"
|
image_list[index].Path = "data/images/" + filename + ".webp"
|
||||||
image_list[index].Hash = filename
|
image_list[index].Hash = filename
|
||||||
image_list[index].Type = "image/webp"
|
image_list[index].Type = "image/webp"
|
||||||
image_list[index].Width = 512
|
|
||||||
image_list[index].Height = 512
|
|
||||||
image_list[index].Format = "webp"
|
image_list[index].Format = "webp"
|
||||||
image_list[index].Status = "success"
|
image_list[index].Status = "success"
|
||||||
image_list[index].Progress = 100
|
image_list[index].Progress = 100
|
||||||
|
@@ -169,6 +169,12 @@ func ImagesPost(w http.ResponseWriter, r *http.Request) {
|
|||||||
if template.CfgScale > 20 {
|
if template.CfgScale > 20 {
|
||||||
template.CfgScale = 20
|
template.CfgScale = 20
|
||||||
}
|
}
|
||||||
|
if template.Width <= 0 {
|
||||||
|
template.Width = 512
|
||||||
|
}
|
||||||
|
if template.Height <= 0 {
|
||||||
|
template.Height = 512
|
||||||
|
}
|
||||||
if template.ModelID <= 0 {
|
if template.ModelID <= 0 {
|
||||||
w.WriteHeader(http.StatusBadRequest)
|
w.WriteHeader(http.StatusBadRequest)
|
||||||
w.Write([]byte("model_id 参数不能为空"))
|
w.Write([]byte("model_id 参数不能为空"))
|
||||||
|
Reference in New Issue
Block a user