Commit 8f7aadb9 authored by brent's avatar brent

task type add type enum

parent 2feca4dc
...@@ -2020,7 +2020,7 @@ func (server *TaskController) Enumeration() { ...@@ -2020,7 +2020,7 @@ func (server *TaskController) Enumeration() {
} }
var types []*models.EnumType var types []*models.EnumType
for _, value := range [...]models.ModelType{models.TXTTOIMG, models.TXTTOTXT, models.TXTTOVIDEO} { for _, value := range [...]models.ModelType{models.TXTTOIMG, models.TXTTOTXT, models.TXTTOVIDEO, models.IMGTOTXT} {
typeData := models.EnumType{ typeData := models.EnumType{
Id: int(value), Id: int(value),
Desc: value.String(), Desc: value.String(),
......
...@@ -22,7 +22,8 @@ type ExampleType struct { ...@@ -22,7 +22,8 @@ type ExampleType struct {
Title string `json:"title"` Title string `json:"title"`
Input struct { Input struct {
Prompt string `json:"prompt,omitempty"` Prompt string `json:"prompt,omitempty"`
Image string `json:"image,omitempty"` Url string `json:"url,omitempty"`
//Mask string `json:"mask,omitempty"`
} `json:"input"` } `json:"input"`
Output struct { Output struct {
Text string `json:"text,omitempty"` Text string `json:"text,omitempty"`
...@@ -226,6 +227,7 @@ const ( ...@@ -226,6 +227,7 @@ const (
TXTTOIMG ModelType = iota + 1 TXTTOIMG ModelType = iota + 1
TXTTOTXT TXTTOTXT
TXTTOVIDEO TXTTOVIDEO
IMGTOTXT
) )
func (m ModelType) String() string { func (m ModelType) String() string {
...@@ -236,6 +238,8 @@ func (m ModelType) String() string { ...@@ -236,6 +238,8 @@ func (m ModelType) String() string {
return "txt2txt" return "txt2txt"
case TXTTOVIDEO: case TXTTOVIDEO:
return "txt2video" return "txt2video"
case IMGTOTXT:
return "txt2video"
default: default:
return "未知类型" return "未知类型"
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment