随机数种子

This commit is contained in:
2023-06-23 02:31:45 +08:00
parent 8e874f7d0f
commit fa2102af38
3 changed files with 4 additions and 4 deletions

View File

@@ -30,7 +30,7 @@ type Image struct {
NumInferenceSteps int `json:"num_inference_steps"` // 推理步数(minimum: 1; maximum: 500)
CfgScale int `json:"cfg_scale"` // 引导比例(minimum: 1; maximum: 20)
Scheduler string `json:"scheduler"` // 调度器(DDIM|K_EULER|DPMSolverMultistep|K_EULER_ANCESTRAL|PNDM|KLMS)
Seed string `json:"seed"` // 随机种子(minimum: 0; maximum: 2147483647)
Seed int `json:"seed"` // 随机种子(minimum: 0; maximum: 2147483647)
FromImage int `json:"from_image"` // 来源图片(如果是从图片生成的, 则记录来源图片的ID)
Task string `json:"task"` // 任务编号(uuid)
Status string `json:"status"` // 任务状态(queued|running|finished|failed)

View File

@@ -101,7 +101,7 @@ func (model *Model) Inference(image_list []Image, callback func(Image)) {
//HrNegativePrompt string `json:"hr_negative_prompt"`
Prompt string `json:"prompt"`
//Styles []string `json:"styles"`
//Seed int `json:"seed"`
Seed int `json:"seed"`
//Subseed int `json:"subseed"`
//SubseedStrength int `json:"subseed_strength"`
//SeedResizeFromH int `json:"seed_resize_from_h"`
@@ -147,7 +147,7 @@ func (model *Model) Inference(image_list []Image, callback func(Image)) {
//HrNegativePrompt: "",
Prompt: image_list[0].Prompt,
//Styles: []string{},
//Seed: -1,
Seed: image_list[0].Seed,
//Subseed: -1,
//SubseedStrength: 0,
//SeedResizeFromH: -1,

View File

@@ -109,7 +109,7 @@ func ImagesPost(w http.ResponseWriter, r *http.Request) {
Steps int `json:"steps"` // 推理步数
CfgScale int `json:"cfg_scale"` // 引导比例
Scheduler string `json:"scheduler"` // 调度器
Seed string `json:"seed"` // 随机种子(单张图生成时使用)
Seed int `json:"seed"` // 随机种子(单张图生成时使用)
NIter int `json:"n_iter"` // 生成数量
ModelID int `json:"model_id"` // 模型ID
}{}