diff --git a/api/core/types/task.go b/api/core/types/task.go
index 444e25c0..d822faee 100644
--- a/api/core/types/task.go
+++ b/api/core/types/task.go
@@ -74,7 +74,7 @@ type SdTaskParams struct {
// DallTask DALL-E task
type DallTask struct {
ClientId string `json:"client_id"`
- JobId uint `json:"job_id"`
+ Id uint `json:"id"`
UserId uint `json:"user_id"`
Prompt string `json:"prompt"`
N int `json:"n"`
diff --git a/api/handler/dalle_handler.go b/api/handler/dalle_handler.go
index 8636b167..d52ccf4e 100644
--- a/api/handler/dalle_handler.go
+++ b/api/handler/dalle_handler.go
@@ -72,10 +72,21 @@ func (h *DallJobHandler) Image(c *gin.Context) {
idValue, _ := c.Get(types.LoginUserID)
userId := utils.IntValue(utils.InterfaceToString(idValue), 0)
+ task := types.DallTask{
+ ClientId: data.ClientId,
+ UserId: uint(userId),
+ Prompt: data.Prompt,
+ Quality: data.Quality,
+ Size: data.Size,
+ Style: data.Style,
+ Power: h.App.SysConfig.DallPower,
+ TranslateModelId: h.App.SysConfig.TranslateModelId,
+ }
job := model.DallJob{
- UserId: uint(userId),
- Prompt: data.Prompt,
- Power: h.App.SysConfig.DallPower,
+ UserId: uint(userId),
+ Prompt: data.Prompt,
+ Power: task.Power,
+ TaskInfo: utils.JsonEncode(task),
}
res := h.DB.Create(&job)
if res.Error != nil {
@@ -83,17 +94,8 @@ func (h *DallJobHandler) Image(c *gin.Context) {
return
}
- h.dallService.PushTask(types.DallTask{
- ClientId: data.ClientId,
- JobId: job.Id,
- UserId: uint(userId),
- Prompt: data.Prompt,
- Quality: data.Quality,
- Size: data.Size,
- Style: data.Style,
- Power: job.Power,
- TranslateModelId: h.App.SysConfig.TranslateModelId,
- })
+ task.Id = job.Id
+ h.dallService.PushTask(task)
resp.SUCCESS(c)
}
diff --git a/api/handler/function_handler.go b/api/handler/function_handler.go
index b39ea6ff..a4dcd005 100644
--- a/api/handler/function_handler.go
+++ b/api/handler/function_handler.go
@@ -212,7 +212,7 @@ func (h *FunctionHandler) Dall3(c *gin.Context) {
}
content, err := h.dallService.Image(types.DallTask{
- JobId: job.Id,
+ Id: job.Id,
UserId: user.Id,
Prompt: job.Prompt,
N: 1,
diff --git a/api/handler/mj_handler.go b/api/handler/mj_handler.go
index 9edacca9..532134be 100644
--- a/api/handler/mj_handler.go
+++ b/api/handler/mj_handler.go
@@ -152,10 +152,23 @@ func (h *MidJourneyHandler) Image(c *gin.Context) {
resp.ERROR(c, "error with generate task id: "+err.Error())
return
}
+ task := types.MjTask{
+ ClientId: data.ClientId,
+ TaskId: taskId,
+ Type: types.TaskType(data.TaskType),
+ Prompt: data.Prompt,
+ NegPrompt: data.NegPrompt,
+ Params: params,
+ UserId: userId,
+ ImgArr: data.ImgArr,
+ Mode: h.App.SysConfig.MjMode,
+ TranslateModelId: h.App.SysConfig.TranslateModelId,
+ }
job := model.MidJourneyJob{
Type: data.TaskType,
UserId: userId,
TaskId: taskId,
+ TaskInfo: utils.JsonEncode(task),
Progress: 0,
Prompt: fmt.Sprintf("%s %s", data.Prompt, params),
Power: h.App.SysConfig.MjPower,
@@ -175,19 +188,8 @@ func (h *MidJourneyHandler) Image(c *gin.Context) {
return
}
- h.mjService.PushTask(types.MjTask{
- Id: job.Id,
- ClientId: data.ClientId,
- TaskId: taskId,
- Type: types.TaskType(data.TaskType),
- Prompt: data.Prompt,
- NegPrompt: data.NegPrompt,
- Params: params,
- UserId: userId,
- ImgArr: data.ImgArr,
- Mode: h.App.SysConfig.MjMode,
- TranslateModelId: h.App.SysConfig.TranslateModelId,
- })
+ task.Id = job.Id
+ h.mjService.PushTask(task)
// update user's power
err = h.userService.DecreasePower(job.UserId, job.Power, model.PowerLog{
@@ -226,10 +228,21 @@ func (h *MidJourneyHandler) Upscale(c *gin.Context) {
idValue, _ := c.Get(types.LoginUserID)
userId := utils.IntValue(utils.InterfaceToString(idValue), 0)
taskId, _ := h.snowflake.Next(true)
+ task := types.MjTask{
+ ClientId: data.ClientId,
+ Type: types.TaskUpscale,
+ UserId: userId,
+ ChannelId: data.ChannelId,
+ Index: data.Index,
+ MessageId: data.MessageId,
+ MessageHash: data.MessageHash,
+ Mode: h.App.SysConfig.MjMode,
+ }
job := model.MidJourneyJob{
Type: types.TaskUpscale.String(),
UserId: userId,
TaskId: taskId,
+ TaskInfo: utils.JsonEncode(task),
Progress: 0,
Power: h.App.SysConfig.MjActionPower,
CreatedAt: time.Now(),
@@ -239,17 +252,8 @@ func (h *MidJourneyHandler) Upscale(c *gin.Context) {
return
}
- h.mjService.PushTask(types.MjTask{
- Id: job.Id,
- ClientId: data.ClientId,
- Type: types.TaskUpscale,
- UserId: userId,
- ChannelId: data.ChannelId,
- Index: data.Index,
- MessageId: data.MessageId,
- MessageHash: data.MessageHash,
- Mode: h.App.SysConfig.MjMode,
- })
+ task.Id = job.Id
+ h.mjService.PushTask(task)
// update user's power
err := h.userService.DecreasePower(job.UserId, job.Power, model.PowerLog{
@@ -280,11 +284,22 @@ func (h *MidJourneyHandler) Variation(c *gin.Context) {
idValue, _ := c.Get(types.LoginUserID)
userId := utils.IntValue(utils.InterfaceToString(idValue), 0)
taskId, _ := h.snowflake.Next(true)
+ task := types.MjTask{
+ Type: types.TaskVariation,
+ ClientId: data.ClientId,
+ UserId: userId,
+ Index: data.Index,
+ ChannelId: data.ChannelId,
+ MessageId: data.MessageId,
+ MessageHash: data.MessageHash,
+ Mode: h.App.SysConfig.MjMode,
+ }
job := model.MidJourneyJob{
Type: types.TaskVariation.String(),
ChannelId: data.ChannelId,
UserId: userId,
TaskId: taskId,
+ TaskInfo: utils.JsonEncode(task),
Progress: 0,
Power: h.App.SysConfig.MjActionPower,
CreatedAt: time.Now(),
@@ -294,17 +309,8 @@ func (h *MidJourneyHandler) Variation(c *gin.Context) {
return
}
- h.mjService.PushTask(types.MjTask{
- Id: job.Id,
- Type: types.TaskVariation,
- ClientId: data.ClientId,
- UserId: userId,
- Index: data.Index,
- ChannelId: data.ChannelId,
- MessageId: data.MessageId,
- MessageHash: data.MessageHash,
- Mode: h.App.SysConfig.MjMode,
- })
+ task.Id = job.Id
+ h.mjService.PushTask(task)
err := h.userService.DecreasePower(job.UserId, job.Power, model.PowerLog{
Type: types.PowerConsume,
diff --git a/api/handler/prompt_handler.go b/api/handler/prompt_handler.go
index 7e719803..e5275b52 100644
--- a/api/handler/prompt_handler.go
+++ b/api/handler/prompt_handler.go
@@ -18,6 +18,7 @@ import (
"geekai/utils/resp"
"github.com/gin-gonic/gin"
"gorm.io/gorm"
+ "strings"
)
// 提示词生成 handler
@@ -57,3 +58,39 @@ func (h *PromptHandler) Lyric(c *gin.Context) {
resp.SUCCESS(c, content)
}
+
+// Image 生成 AI 绘画提示词
+func (h *PromptHandler) Image(c *gin.Context) {
+ var data struct {
+ Prompt string `json:"prompt"`
+ }
+ if err := c.ShouldBindJSON(&data); err != nil {
+ resp.ERROR(c, types.InvalidArgs)
+ return
+ }
+ content, err := utils.OpenAIRequest(h.DB, fmt.Sprintf(service.ImagePromptOptimizeTemplate, data.Prompt), h.App.SysConfig.TranslateModelId)
+ if err != nil {
+ resp.ERROR(c, err.Error())
+ return
+ }
+
+ resp.SUCCESS(c, strings.Trim(content, `"`))
+}
+
+// Video 生成视频提示词
+func (h *PromptHandler) Video(c *gin.Context) {
+ var data struct {
+ Prompt string `json:"prompt"`
+ }
+ if err := c.ShouldBindJSON(&data); err != nil {
+ resp.ERROR(c, types.InvalidArgs)
+ return
+ }
+ content, err := utils.OpenAIRequest(h.DB, fmt.Sprintf(service.VideoPromptTemplate, data.Prompt), h.App.SysConfig.TranslateModelId)
+ if err != nil {
+ resp.ERROR(c, err.Error())
+ return
+ }
+
+ resp.SUCCESS(c, strings.Trim(content, `"`))
+}
diff --git a/api/handler/suno_handler.go b/api/handler/suno_handler.go
index a153c049..06bb5fa1 100644
--- a/api/handler/suno_handler.go
+++ b/api/handler/suno_handler.go
@@ -89,13 +89,29 @@ func (h *SunoHandler) Create(c *gin.Context) {
data.Prompt = fmt.Sprintf("%s\n%s", song.Prompt, refSong.Prompt)
}
}
+ task := types.SunoTask{
+ ClientId: data.ClientId,
+ UserId: int(h.GetLoginUserId(c)),
+ Type: data.Type,
+ Title: data.Title,
+ RefTaskId: data.RefTaskId,
+ RefSongId: data.RefSongId,
+ ExtendSecs: data.ExtendSecs,
+ Prompt: data.Prompt,
+ Tags: data.Tags,
+ Model: data.Model,
+ Instrumental: data.Instrumental,
+ SongId: data.SongId,
+ AudioURL: data.AudioURL,
+ }
// 插入数据库
job := model.SunoJob{
- UserId: int(h.GetLoginUserId(c)),
+ UserId: task.UserId,
Prompt: data.Prompt,
Instrumental: data.Instrumental,
ModelName: data.Model,
+ TaskInfo: utils.JsonEncode(task),
Tags: data.Tags,
Title: data.Title,
Type: data.Type,
@@ -115,26 +131,13 @@ func (h *SunoHandler) Create(c *gin.Context) {
}
// 创建任务
- h.sunoService.PushTask(types.SunoTask{
- ClientId: data.ClientId,
- Id: job.Id,
- UserId: job.UserId,
- Type: job.Type,
- Title: job.Title,
- RefTaskId: data.RefTaskId,
- RefSongId: data.RefSongId,
- ExtendSecs: data.ExtendSecs,
- Prompt: job.Prompt,
- Tags: data.Tags,
- Model: data.Model,
- Instrumental: data.Instrumental,
- SongId: data.SongId,
- AudioURL: data.AudioURL,
- })
+ task.Id = job.Id
+ h.sunoService.PushTask(task)
// update user's power
err = h.userService.DecreasePower(job.UserId, job.Power, model.PowerLog{
Type: types.PowerConsume,
+ Model: job.ModelName,
Remark: fmt.Sprintf("Suno 文生歌曲,%s", job.ModelName),
CreatedAt: time.Now(),
})
diff --git a/api/handler/video_handler.go b/api/handler/video_handler.go
index 42731164..10967f62 100644
--- a/api/handler/video_handler.go
+++ b/api/handler/video_handler.go
@@ -80,13 +80,21 @@ func (h *VideoHandler) LumaCreate(c *gin.Context) {
StartImgURL: data.FirstFrameImg,
EndImgURL: data.EndFrameImg,
}
+ task := types.VideoTask{
+ ClientId: data.ClientId,
+ UserId: userId,
+ Type: types.VideoLuma,
+ Prompt: data.Prompt,
+ Params: params,
+ TranslateModelId: h.App.SysConfig.TranslateModelId,
+ }
// 插入数据库
job := model.VideoJob{
- UserId: userId,
- Type: types.VideoLuma,
- Prompt: data.Prompt,
- Power: h.App.SysConfig.LumaPower,
- Params: utils.JsonEncode(params),
+ UserId: userId,
+ Type: types.VideoLuma,
+ Prompt: data.Prompt,
+ Power: h.App.SysConfig.LumaPower,
+ TaskInfo: utils.JsonEncode(task),
}
tx := h.DB.Create(&job)
if tx.Error != nil {
@@ -95,15 +103,8 @@ func (h *VideoHandler) LumaCreate(c *gin.Context) {
}
// 创建任务
- h.videoService.PushTask(types.VideoTask{
- ClientId: data.ClientId,
- Id: job.Id,
- UserId: userId,
- Type: types.VideoLuma,
- Prompt: data.Prompt,
- Params: params,
- TranslateModelId: h.App.SysConfig.TranslateModelId,
- })
+ task.Id = job.Id
+ h.videoService.PushTask(task)
// update user's power
err = h.userService.DecreasePower(job.UserId, job.Power, model.PowerLog{
diff --git a/api/main.go b/api/main.go
index 17fb87ba..f9c87c84 100644
--- a/api/main.go
+++ b/api/main.go
@@ -521,6 +521,8 @@ func main() {
fx.Invoke(func(s *core.AppServer, h *handler.PromptHandler) {
group := s.Engine.Group("/api/prompt")
group.POST("/lyric", h.Lyric)
+ group.POST("/image", h.Image)
+ group.POST("/video", h.Video)
}),
fx.Invoke(func(s *core.AppServer, db *gorm.DB) {
go func() {
diff --git a/api/service/dalle/service.go b/api/service/dalle/service.go
index 1d29a731..4e9c2504 100644
--- a/api/service/dalle/service.go
+++ b/api/service/dalle/service.go
@@ -59,6 +59,20 @@ func (s *Service) PushTask(task types.DallTask) {
}
func (s *Service) Run() {
+ // 将数据库中未提交的人物加载到队列
+ var jobs []model.DallJob
+ s.db.Where("progress", 0).Find(&jobs)
+ for _, v := range jobs {
+ var task types.DallTask
+ err := utils.JsonDecode(v.TaskInfo, &task)
+ if err != nil {
+ logger.Errorf("decode task info with error: %v", err)
+ continue
+ }
+ task.Id = v.Id
+ s.PushTask(task)
+ }
+
logger.Info("Starting DALL-E job consumer...")
go func() {
for {
@@ -69,15 +83,15 @@ func (s *Service) Run() {
continue
}
logger.Infof("handle a new DALL-E task: %+v", task)
- s.clientIds[task.JobId] = task.ClientId
+ s.clientIds[task.Id] = task.ClientId
_, err = s.Image(task, false)
if err != nil {
logger.Errorf("error with image task: %v", err)
- s.db.Model(&model.DallJob{Id: task.JobId}).UpdateColumns(map[string]interface{}{
+ s.db.Model(&model.DallJob{Id: task.Id}).UpdateColumns(map[string]interface{}{
"progress": service.FailTaskProgress,
"err_msg": err.Error(),
})
- s.notifyQueue.RPush(service.NotifyMessage{ClientId: task.ClientId, UserId: int(task.UserId), JobId: int(task.JobId), Message: service.TaskStatusFailed})
+ s.notifyQueue.RPush(service.NotifyMessage{ClientId: task.ClientId, UserId: int(task.UserId), JobId: int(task.Id), Message: service.TaskStatusFailed})
}
}
}()
@@ -177,7 +191,7 @@ func (s *Service) Image(task types.DallTask, sync bool) (string, error) {
// update the api key last use time
s.db.Model(&apiKey).UpdateColumn("last_used_at", time.Now().Unix())
// update task progress
- err = s.db.Model(&model.DallJob{Id: task.JobId}).UpdateColumns(map[string]interface{}{
+ err = s.db.Model(&model.DallJob{Id: task.Id}).UpdateColumns(map[string]interface{}{
"progress": 100,
"org_url": res.Data[0].Url,
"prompt": prompt,
@@ -186,10 +200,10 @@ func (s *Service) Image(task types.DallTask, sync bool) (string, error) {
return "", fmt.Errorf("err with update database: %v", err)
}
- s.notifyQueue.RPush(service.NotifyMessage{ClientId: task.ClientId, UserId: int(task.UserId), JobId: int(task.JobId), Message: service.TaskStatusFailed})
+ s.notifyQueue.RPush(service.NotifyMessage{ClientId: task.ClientId, UserId: int(task.UserId), JobId: int(task.Id), Message: service.TaskStatusFailed})
var content string
if sync {
- imgURL, err := s.downloadImage(task.JobId, int(task.UserId), res.Data[0].Url)
+ imgURL, err := s.downloadImage(task.Id, int(task.UserId), res.Data[0].Url)
if err != nil {
return "", fmt.Errorf("error with download image: %v", err)
}
diff --git a/api/service/mj/service.go b/api/service/mj/service.go
index 3a22a51e..249c2f87 100644
--- a/api/service/mj/service.go
+++ b/api/service/mj/service.go
@@ -46,6 +46,21 @@ func NewService(redisCli *redis.Client, db *gorm.DB, client *Client, manager *os
}
func (s *Service) Run() {
+ // 将数据库中未提交的人物加载到队列
+ var jobs []model.MidJourneyJob
+ s.db.Where("task_id", "").Where("progress", 0).Find(&jobs)
+ for _, v := range jobs {
+ var task types.MjTask
+ err := utils.JsonDecode(v.TaskInfo, &task)
+ if err != nil {
+ logger.Errorf("decode task info with error: %v", err)
+ continue
+ }
+ task.Id = v.Id
+ s.clientIds[task.Id] = task.ClientId
+ s.PushTask(task)
+ }
+
logger.Info("Starting MidJourney job consumer for service")
go func() {
for {
diff --git a/api/service/suno/service.go b/api/service/suno/service.go
index 9e293b3e..21e713b8 100644
--- a/api/service/suno/service.go
+++ b/api/service/suno/service.go
@@ -58,22 +58,17 @@ func (s *Service) PushTask(task types.SunoTask) {
func (s *Service) Run() {
// 将数据库中未提交的人物加载到队列
var jobs []model.SunoJob
- s.db.Where("task_id", "").Find(&jobs)
+ s.db.Where("task_id", "").Where("progress", 0).Find(&jobs)
for _, v := range jobs {
- s.PushTask(types.SunoTask{
- Id: v.Id,
- Channel: v.Channel,
- UserId: v.UserId,
- Type: v.Type,
- Title: v.Title,
- RefTaskId: v.RefTaskId,
- RefSongId: v.RefSongId,
- Prompt: v.Prompt,
- Tags: v.Tags,
- Model: v.ModelName,
- Instrumental: v.Instrumental,
- ExtendSecs: v.ExtendSecs,
- })
+ var task types.SunoTask
+ err := utils.JsonDecode(v.TaskInfo, &task)
+ if err != nil {
+ logger.Errorf("decode task info with error: %v", err)
+ continue
+ }
+ task.Id = v.Id
+ s.PushTask(task)
+ s.clientIds[v.TaskId] = task.ClientId
}
logger.Info("Starting Suno job consumer...")
go func() {
diff --git a/api/service/types.go b/api/service/types.go
index ad9ef493..3ff32979 100644
--- a/api/service/types.go
+++ b/api/service/types.go
@@ -90,3 +90,29 @@ const LyricPromptTemplate = `
尾声:
{{歌词内容}}
`
+
+const VideoPromptTemplate = `
+As an expert in video generation prompts, please create a detailed descriptive prompt for the following video concept. The description should include the setting, character appearance, actions, overall atmosphere, and camera angles. Please make it as detailed and vivid as possible to help ensure that every aspect of the video is accurately captured.
+
+Please remember that regardless of the user’s input, the final output must be in English.
+
+# Details to Include
+
+- Describe the overall visual style of the video (e.g., animated, realistic, retro tone, etc.)
+- Identify key characters or objects in the video and describe their appearance, attire, and expressions
+- Describe the environment of the scene, including weather, lighting, colors, and important details
+- Explain the behavior and interactions of the characters
+- Include any unique camera angles, movements, or special effects
+
+# Output Format
+Provide the prompt in paragraph form, ensuring that the description is detailed enough for a video generation system to recreate the envisioned scene. Include the beginning, middle, and end of the scene to convey a complete storyline.
+
+# Example
+**User Input:**
+“A small cat basking in the sun on a balcony.”
+
+**Generated Prompt:**
+On a bright spring afternoon, an orange-striped kitten lies lazily on a balcony, basking in the warm sunlight. The iron railings around the balcony cast soft shadows that dance gently with the light. The cat’s eyes are half-closed, exuding a sense of contentment and tranquility in its surroundings. In the distance, a few fluffy white clouds drift slowly across the blue sky. The camera initially focuses on the cat’s face, capturing the delicate details of its fur, and then gradually zooms out to reveal the full balcony scene, immersing viewers in a moment of calm and relaxation.
+
+The theme of the creation is:【%s】
+`
diff --git a/api/service/video/luma.go b/api/service/video/luma.go
index f5eba330..ff164998 100644
--- a/api/service/video/luma.go
+++ b/api/service/video/luma.go
@@ -60,20 +60,15 @@ func (s *Service) Run() {
var jobs []model.VideoJob
s.db.Where("task_id", "").Where("progress", 0).Find(&jobs)
for _, v := range jobs {
- var params types.VideoParams
- if err := utils.JsonDecode(v.Params, ¶ms); err != nil {
- logger.Errorf("unmarshal params failed: %v", err)
+ var task types.VideoTask
+ err := utils.JsonDecode(v.TaskInfo, &task)
+ if err != nil {
+ logger.Errorf("decode task info with error: %v", err)
continue
}
- s.PushTask(types.VideoTask{
- Id: v.Id,
- Channel: v.Channel,
- UserId: v.UserId,
- Type: v.Type,
- TaskId: v.TaskId,
- Prompt: v.Prompt,
- Params: params,
- })
+ task.Id = v.Id
+ s.PushTask(task)
+ s.clientIds[v.Id] = task.ClientId
}
logger.Info("Starting Video job consumer...")
go func() {
diff --git a/api/store/model/dalle_job.go b/api/store/model/dalle_job.go
index de7a13a0..f22f7426 100644
--- a/api/store/model/dalle_job.go
+++ b/api/store/model/dalle_job.go
@@ -6,6 +6,7 @@ type DallJob struct {
Id uint `gorm:"primarykey;column:id"`
UserId uint
Prompt string
+ TaskInfo string // 原始任务信息
ImgURL string
OrgURL string
Publish bool
diff --git a/api/store/model/mj_job.go b/api/store/model/mj_job.go
index b4e03a6c..feb0471c 100644
--- a/api/store/model/mj_job.go
+++ b/api/store/model/mj_job.go
@@ -7,6 +7,7 @@ type MidJourneyJob struct {
Type string
UserId int
TaskId string
+ TaskInfo string // 原始任务信息
ChannelId string
MessageId string
ReferenceId string
diff --git a/api/store/model/suno_job.go b/api/store/model/suno_job.go
index abbbd631..ecc0de09 100644
--- a/api/store/model/suno_job.go
+++ b/api/store/model/suno_job.go
@@ -9,6 +9,7 @@ type SunoJob struct {
Title string
Type int
TaskId string
+ TaskInfo string // 原始任务信息
RefTaskId string // 续写的任务id
Tags string // 歌曲风格和标签
Instrumental bool // 是否生成纯音乐
diff --git a/api/store/model/video_job.go b/api/store/model/video_job.go
index 5dc7cb3e..b3bbb08e 100644
--- a/api/store/model/video_job.go
+++ b/api/store/model/video_job.go
@@ -8,6 +8,7 @@ type VideoJob struct {
Channel string // 频道
Type string // luma,runway,cog
TaskId string
+ TaskInfo string // 原始任务信息
Prompt string // 提示词
PromptExt string // 优化后提示词
CoverURL string // 封面图 URL
@@ -18,7 +19,6 @@ type VideoJob struct {
ErrMsg string // 错误信息
RawData string // 原始数据 json
Power int // 消耗算力
- Params string // 任务参数
CreatedAt time.Time
}
diff --git a/api/store/vo/video_job.go b/api/store/vo/video_job.go
index 3582c667..b7530132 100644
--- a/api/store/vo/video_job.go
+++ b/api/store/vo/video_job.go
@@ -1,7 +1,5 @@
package vo
-import "geekai/core/types"
-
type VideoJob struct {
Id uint `json:"id"`
UserId int `json:"user_id"`
@@ -18,6 +16,5 @@ type VideoJob struct {
ErrMsg string `json:"err_msg"` // 错误信息
RawData map[string]interface{} `json:"raw_data"` // 原始数据 json
Power int `json:"power"` // 消耗算力
- Params types.VideoParams `json:"params"` // 任务参数
CreatedAt int64 `json:"created_at"`
}
diff --git a/database/update-v4.1.7.sql b/database/update-v4.1.7.sql
index 4233bd26..b33b7f8c 100644
--- a/database/update-v4.1.7.sql
+++ b/database/update-v4.1.7.sql
@@ -1 +1,5 @@
-ALTER TABLE `chatgpt_sd_jobs` ADD `task_info` TEXT NOT NULL COMMENT '任务详情' AFTER `task_id`;
\ No newline at end of file
+ALTER TABLE `chatgpt_sd_jobs` ADD `task_info` TEXT NOT NULL COMMENT '任务详情' AFTER `task_id`;
+ALTER TABLE `chatgpt_mj_jobs` ADD `task_info` TEXT NOT NULL COMMENT '任务详情' AFTER `task_id`;
+ALTER TABLE `chatgpt_dall_jobs` ADD `task_info` TEXT NOT NULL COMMENT '任务详情' AFTER `prompt`;
+ALTER TABLE `chatgpt_suno_jobs` ADD `task_info` TEXT NOT NULL COMMENT '任务详情' AFTER `task_id`;
+ALTER TABLE `chatgpt_video_jobs` CHANGE `params` `task_info` TEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '原始任务信息' AFTER `task_id`;
\ No newline at end of file
diff --git a/web/src/assets/css/image-mj.styl b/web/src/assets/css/image-mj.styl
index 61845709..7e5f13c1 100644
--- a/web/src/assets/css/image-mj.styl
+++ b/web/src/assets/css/image-mj.styl
@@ -473,8 +473,13 @@
padding 30px
}
}
- }
+ .generate-btn {
+ .iconfont {
+ margin-right 5px
+ }
+ }
+ }
}
.mj-list-item-prompt {
diff --git a/web/src/assets/iconfont/iconfont.css b/web/src/assets/iconfont/iconfont.css
index 9871d1bb..57f915d2 100644
--- a/web/src/assets/iconfont/iconfont.css
+++ b/web/src/assets/iconfont/iconfont.css
@@ -1,8 +1,8 @@
@font-face {
font-family: "iconfont"; /* Project id 4125778 */
- src: url('iconfont.woff2?t=1728891448746') format('woff2'),
- url('iconfont.woff?t=1728891448746') format('woff'),
- url('iconfont.ttf?t=1728891448746') format('truetype');
+ src: url('iconfont.woff2?t=1731289567907') format('woff2'),
+ url('iconfont.woff?t=1731289567907') format('woff'),
+ url('iconfont.ttf?t=1731289567907') format('truetype');
}
.iconfont {
@@ -13,6 +13,14 @@
-moz-osx-font-smoothing: grayscale;
}
+.icon-linggan:before {
+ content: "\e641";
+}
+
+.icon-chuangzuo:before {
+ content: "\e6cc";
+}
+
.icon-call:before {
content: "\e769";
}
diff --git a/web/src/assets/iconfont/iconfont.js b/web/src/assets/iconfont/iconfont.js
index 1cdb9982..ff1c4172 100644
--- a/web/src/assets/iconfont/iconfont.js
+++ b/web/src/assets/iconfont/iconfont.js
@@ -1 +1 @@
-window._iconfont_svg_string_4125778='',(a=>{var l=(c=(c=document.getElementsByTagName("script"))[c.length-1]).getAttribute("data-injectcss"),c=c.getAttribute("data-disable-injectsvg");if(!c){var h,t,i,o,z,m=function(l,c){c.parentNode.insertBefore(l,c)};if(l&&!a.__iconfont__svg__cssinject__){a.__iconfont__svg__cssinject__=!0;try{document.write("")}catch(l){console&&console.log(l)}}h=function(){var l,c=document.createElement("div");c.innerHTML=a._iconfont_svg_string_4125778,(c=c.getElementsByTagName("svg")[0])&&(c.setAttribute("aria-hidden","true"),c.style.position="absolute",c.style.width=0,c.style.height=0,c.style.overflow="hidden",c=c,(l=document.body).firstChild?m(c,l.firstChild):l.appendChild(c))},document.addEventListener?~["complete","loaded","interactive"].indexOf(document.readyState)?setTimeout(h,0):(t=function(){document.removeEventListener("DOMContentLoaded",t,!1),h()},document.addEventListener("DOMContentLoaded",t,!1)):document.attachEvent&&(i=h,o=a.document,z=!1,s(),o.onreadystatechange=function(){"complete"==o.readyState&&(o.onreadystatechange=null,p())})}function p(){z||(z=!0,i())}function s(){try{o.documentElement.doScroll("left")}catch(l){return void setTimeout(s,50)}p()}})(window);
\ No newline at end of file
+window._iconfont_svg_string_4125778='',(a=>{var l=(c=(c=document.getElementsByTagName("script"))[c.length-1]).getAttribute("data-injectcss"),c=c.getAttribute("data-disable-injectsvg");if(!c){var h,t,i,o,z,m=function(l,c){c.parentNode.insertBefore(l,c)};if(l&&!a.__iconfont__svg__cssinject__){a.__iconfont__svg__cssinject__=!0;try{document.write("")}catch(l){console&&console.log(l)}}h=function(){var l,c=document.createElement("div");c.innerHTML=a._iconfont_svg_string_4125778,(c=c.getElementsByTagName("svg")[0])&&(c.setAttribute("aria-hidden","true"),c.style.position="absolute",c.style.width=0,c.style.height=0,c.style.overflow="hidden",c=c,(l=document.body).firstChild?m(c,l.firstChild):l.appendChild(c))},document.addEventListener?~["complete","loaded","interactive"].indexOf(document.readyState)?setTimeout(h,0):(t=function(){document.removeEventListener("DOMContentLoaded",t,!1),h()},document.addEventListener("DOMContentLoaded",t,!1)):document.attachEvent&&(i=h,o=a.document,z=!1,s(),o.onreadystatechange=function(){"complete"==o.readyState&&(o.onreadystatechange=null,p())})}function p(){z||(z=!0,i())}function s(){try{o.documentElement.doScroll("left")}catch(l){return void setTimeout(s,50)}p()}})(window);
\ No newline at end of file
diff --git a/web/src/assets/iconfont/iconfont.json b/web/src/assets/iconfont/iconfont.json
index e32aad7f..fc973f80 100644
--- a/web/src/assets/iconfont/iconfont.json
+++ b/web/src/assets/iconfont/iconfont.json
@@ -5,6 +5,20 @@
"css_prefix_text": "icon-",
"description": "",
"glyphs": [
+ {
+ "icon_id": "15330210",
+ "name": "创意灵感",
+ "font_class": "linggan",
+ "unicode": "e641",
+ "unicode_decimal": 58945
+ },
+ {
+ "icon_id": "39170417",
+ "name": "创作",
+ "font_class": "chuangzuo",
+ "unicode": "e6cc",
+ "unicode_decimal": 59084
+ },
{
"icon_id": "11231556",
"name": "打电话",
diff --git a/web/src/assets/iconfont/iconfont.ttf b/web/src/assets/iconfont/iconfont.ttf
index 14ee893b..d2528705 100644
Binary files a/web/src/assets/iconfont/iconfont.ttf and b/web/src/assets/iconfont/iconfont.ttf differ
diff --git a/web/src/assets/iconfont/iconfont.woff b/web/src/assets/iconfont/iconfont.woff
index ee2f117c..550b27bb 100644
Binary files a/web/src/assets/iconfont/iconfont.woff and b/web/src/assets/iconfont/iconfont.woff differ
diff --git a/web/src/assets/iconfont/iconfont.woff2 b/web/src/assets/iconfont/iconfont.woff2
index aba9800a..3dc3c3da 100644
Binary files a/web/src/assets/iconfont/iconfont.woff2 and b/web/src/assets/iconfont/iconfont.woff2 differ
diff --git a/web/src/views/Dalle.vue b/web/src/views/Dalle.vue
index f1c039e3..897ba203 100644
--- a/web/src/views/Dalle.vue
+++ b/web/src/views/Dalle.vue
@@ -59,10 +59,17 @@
:autosize="{ minRows: 4, maxRows: 6 }"
type="textarea"
ref="promptRef"
- placeholder="请在此输入绘画提示词,系统会自动翻译中文提示词,高手请直接输入英文提示词"
+ placeholder="请在此输入绘画提示词,您也可以点击下面的提示词助手生成绘画提示词"
/>
+