Commit 8f7aadb9 authored by brent's avatar brent

task type add type enum

parent 2feca4dc
......@@ -2020,7 +2020,7 @@ func (server *TaskController) Enumeration() {
}
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{
Id: int(value),
Desc: value.String(),
......
......@@ -22,7 +22,8 @@ type ExampleType struct {
Title string `json:"title"`
Input struct {
Prompt string `json:"prompt,omitempty"`
Image string `json:"image,omitempty"`
Url string `json:"url,omitempty"`
//Mask string `json:"mask,omitempty"`
} `json:"input"`
Output struct {
Text string `json:"text,omitempty"`
......@@ -226,6 +227,7 @@ const (
TXTTOIMG ModelType = iota + 1
TXTTOTXT
TXTTOVIDEO
IMGTOTXT
)
func (m ModelType) String() string {
......@@ -236,6 +238,8 @@ func (m ModelType) String() string {
return "txt2txt"
case TXTTOVIDEO:
return "txt2video"
case IMGTOTXT:
return "txt2video"
default:
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