diff --git a/api/handler/mj_handler.go b/api/handler/mj_handler.go index 35d94cab..f70075ea 100644 --- a/api/handler/mj_handler.go +++ b/api/handler/mj_handler.go @@ -80,6 +80,7 @@ func (h *MidJourneyHandler) Image(c *gin.Context) { var data struct { SessionId string `json:"session_id"` Prompt string `json:"prompt"` + NegPrompt string `json:"neg_prompt"` Rate string `json:"rate"` Model string `json:"model"` Chaos int `json:"chaos"` @@ -87,6 +88,8 @@ func (h *MidJourneyHandler) Image(c *gin.Context) { Seed int64 `json:"seed"` Stylize int `json:"stylize"` Img string `json:"img"` + Tile bool `json:"tile"` + Quality float32 `json:"quality"` Weight float32 `json:"weight"` } if err := c.ShouldBindJSON(&data); err != nil { @@ -119,6 +122,15 @@ func (h *MidJourneyHandler) Image(c *gin.Context) { if data.Raw { prompt += " --style raw" } + if data.Quality > 0 { + prompt += fmt.Sprintf(" --q %.2f", data.Quality) + } + if data.NegPrompt != "" { + prompt += fmt.Sprintf(" --no %s", data.NegPrompt) + } + if data.Tile { + prompt += " --tile " + } if data.Model != "" && !strings.Contains(prompt, "--v") && !strings.Contains(prompt, "--niji") { prompt += fmt.Sprintf(" %s", data.Model) } diff --git a/web/public/images/mj-niji.png b/web/public/images/mj/mj-niji.png similarity index 100% rename from web/public/images/mj-niji.png rename to web/public/images/mj/mj-niji.png diff --git a/web/public/images/mj3.jpg b/web/public/images/mj/mj-v4.jpg similarity index 100% rename from web/public/images/mj3.jpg rename to web/public/images/mj/mj-v4.jpg diff --git a/web/public/images/mj1.jpg b/web/public/images/mj/mj-v5.1.jpg similarity index 100% rename from web/public/images/mj1.jpg rename to web/public/images/mj/mj-v5.1.jpg diff --git a/web/public/images/mj-normal.png b/web/public/images/mj/mj-v5.2.png similarity index 100% rename from web/public/images/mj-normal.png rename to web/public/images/mj/mj-v5.2.png diff --git a/web/public/images/mj2.jpg b/web/public/images/mj/mj-v5.jpg similarity index 100% rename from web/public/images/mj2.jpg rename to web/public/images/mj/mj-v5.jpg diff --git a/web/public/images/nj1.jpg b/web/public/images/mj/nj1.jpg similarity index 100% rename from web/public/images/nj1.jpg rename to web/public/images/mj/nj1.jpg diff --git a/web/public/images/nj2.jpg b/web/public/images/mj/nj2.jpg similarity index 100% rename from web/public/images/nj2.jpg rename to web/public/images/mj/nj2.jpg diff --git a/web/public/images/nj3.jpg b/web/public/images/mj/nj3.jpg similarity index 100% rename from web/public/images/nj3.jpg rename to web/public/images/mj/nj3.jpg diff --git a/web/public/images/nj4.jpg b/web/public/images/mj/nj4.jpg similarity index 100% rename from web/public/images/nj4.jpg rename to web/public/images/mj/nj4.jpg diff --git a/web/public/images/16_9.png b/web/public/images/mj/rate_16_9.png similarity index 100% rename from web/public/images/16_9.png rename to web/public/images/mj/rate_16_9.png diff --git a/web/public/images/1_1.png b/web/public/images/mj/rate_1_1.png similarity index 100% rename from web/public/images/1_1.png rename to web/public/images/mj/rate_1_1.png diff --git a/web/public/images/1_2.png b/web/public/images/mj/rate_1_2.png similarity index 100% rename from web/public/images/1_2.png rename to web/public/images/mj/rate_1_2.png diff --git a/web/public/images/2_1.png b/web/public/images/mj/rate_2_1.png similarity index 100% rename from web/public/images/2_1.png rename to web/public/images/mj/rate_2_1.png diff --git a/web/public/images/3_4.png b/web/public/images/mj/rate_3_4.png similarity index 100% rename from web/public/images/3_4.png rename to web/public/images/mj/rate_3_4.png diff --git a/web/public/images/4_3.png b/web/public/images/mj/rate_4_3.png similarity index 100% rename from web/public/images/4_3.png rename to web/public/images/mj/rate_4_3.png diff --git a/web/public/images/9_16.png b/web/public/images/mj/rate_9_16.png similarity index 100% rename from web/public/images/9_16.png rename to web/public/images/mj/rate_9_16.png diff --git a/web/src/assets/css/image-mj.css b/web/src/assets/css/image-mj.css index 494eba13..d421a77e 100644 --- a/web/src/assets/css/image-mj.css +++ b/web/src/assets/css/image-mj.css @@ -35,7 +35,6 @@ } .page-mj .inner .mj-box .mj-params .param-line .el-icon { position: relative; - top: 3px; } .page-mj .inner .mj-box .mj-params .param-line .grid-content { background-color: #383838; @@ -43,26 +42,62 @@ padding: 8px 14px; display: flex; cursor: pointer; + margin-bottom: 10px; } .page-mj .inner .mj-box .mj-params .param-line .grid-content:hover { background-color: #585858; } +.page-mj .inner .mj-box .mj-params .param-line .grid-content .icon { + width: 20px; + height: 20px; + margin-bottom: 5px; +} .page-mj .inner .mj-box .mj-params .param-line .grid-content .shape { width: 16px; height: 16px; - margin-right: 5px; + margin-bottom: 5px; border: 1px solid #c4c4c4; border-radius: 3px; } -.page-mj .inner .mj-box .mj-params .param-line .grid-content .shape.vertical { - width: 12px; - height: 20px; +.page-mj .inner .mj-box .mj-params .param-line .grid-content .shape.size9-16 { + width: 9px; + height: 16px; } -.page-mj .inner .mj-box .mj-params .param-line .grid-content .shape.horizontal { - height: 12px; - width: 20px; +.page-mj .inner .mj-box .mj-params .param-line .grid-content .shape.size16-9 { + height: 9px; + width: 16px; position: relative; - top: 3px; + margin: 4px 0 7px; +} +.page-mj .inner .mj-box .mj-params .param-line .grid-content .shape.size3-4 { + width: 12px; + height: 16px; +} +.page-mj .inner .mj-box .mj-params .param-line .grid-content .shape.size4-3 { + height: 12px; + width: 16px; + position: relative; + margin: 4px 0 4px; +} +.page-mj .inner .mj-box .mj-params .param-line .grid-content .shape.size2-3 { + width: 11px; + height: 16px; +} +.page-mj .inner .mj-box .mj-params .param-line .grid-content .shape.size3-2 { + height: 11px; + width: 16px; + position: relative; + margin: 4px 0 5px; +} +.page-mj .inner .mj-box .mj-params .param-line .grid-content .shape.size1-2 { + width: 8px; + height: 16px; +} +.page-mj .inner .mj-box .mj-params .param-line .grid-content .shape.size2-1 { + height: 8px; + width: 16px; + position: relative; + margin: 4px 0 8px; } .page-mj .inner .mj-box .mj-params .param-line .grid-content.active { color: #47fff1; @@ -76,6 +111,7 @@ border: 1px solid #454545; border-radius: 5px; padding: 10px; + margin-bottom: 10px; display: flex; flex-flow: column; align-items: center; @@ -98,10 +134,20 @@ } .page-mj .inner .mj-box .mj-params .param-line .form-item-inner { display: flex; + align-items: center; +} +.page-mj .inner .mj-box .mj-params .param-line .form-item-inner .el-select { + --el-select-input-focus-border-color: #47fff1; + --el-input-focus-border-color: #47fff1; +} +.page-mj .inner .mj-box .mj-params .param-line .form-item-inner .el-input__wrapper { + background: #383838; +} +.page-mj .inner .mj-box .mj-params .param-line .form-item-inner .el-input__inner { + color: #fff; } .page-mj .inner .mj-box .mj-params .param-line .form-item-inner .el-icon { margin-left: 10px; - margin-top: 2px; } .page-mj .inner .mj-box .mj-params .param-line .img-uploader .el-upload { border: 1px dashed var(--el-border-color); @@ -123,19 +169,11 @@ text-align: center; } .page-mj .inner .mj-box .mj-params .param-line.pt { + display: flex; + align-items: center; padding-top: 5px; padding-bottom: 5px; } -.page-mj .inner .mj-box .submit-btn { - padding: 10px 15px 0 15px; - text-align: center; -} -.page-mj .inner .mj-box .submit-btn .el-button { - width: 100%; -} -.page-mj .inner .mj-box .submit-btn .el-button span { - color: #2d3a4b; -} .page-mj .inner .el-form .el-form-item__label { color: #fff; } @@ -149,6 +187,86 @@ color: #fff; overflow-x: hidden; } +.page-mj .inner .task-list-box .task-list-inner .el-tabs { + --el-tabs-header-height: 55px; +} +.page-mj .inner .task-list-box .task-list-inner .el-tabs__item { + color: #fff; + font-size: 18px; +} +.page-mj .inner .task-list-box .task-list-inner .title-tabs .el-tabs__item.is-active { + color: #47fff1; + font-size: 18px; +} +.page-mj .inner .task-list-box .task-list-inner .title-tabs .el-tabs__active-bar { + background-color: #47fff1; +} +.page-mj .inner .task-list-box .task-list-inner .title-tabs .el-tabs__content { + padding: 10px 0; +} +.page-mj .inner .task-list-box .task-list-inner .el-textarea { + --el-input-focus-border-color: #47fff1; +} +.page-mj .inner .task-list-box .task-list-inner .el-textarea__inner { + background: transparent; + color: #fff; +} +.page-mj .inner .task-list-box .task-list-inner .el-input__wrapper { + background: transparent; + padding: 5px; +} +.page-mj .inner .task-list-box .task-list-inner .text { + margin-bottom: 10px; + color: #6b778c; + font-size: 15px; +} +.page-mj .inner .task-list-box .task-list-inner .param-line.pt { + padding-top: 5px; + padding-bottom: 5px; +} +.page-mj .inner .task-list-box .task-list-inner .form-item-inner { + display: flex; + align-items: center; +} +.page-mj .inner .task-list-box .task-list-inner .form-item-inner .el-icon { + margin-left: 10px; +} +.page-mj .inner .task-list-box .task-list-inner .el-form-item__label { + color: #fff; +} +.page-mj .inner .task-list-box .task-list-inner .img-uploader .el-upload { + border: 1px dashed var(--el-border-color); + border-radius: 6px; + cursor: pointer; + position: relative; + overflow: hidden; + width: 300px; + transition: var(--el-transition-duration-fast); + margin-bottom: 20px; +} +.page-mj .inner .task-list-box .task-list-inner .img-uploader .el-upload:hover { + border-color: var(--el-color-primary); +} +.page-mj .inner .task-list-box .task-list-inner .img-uploader .el-upload .el-icon.uploader-icon { + font-size: 28px; + color: #8c939d; + width: 100%; + height: 120px; + text-align: center; +} +.page-mj .inner .task-list-box .task-list-inner .submit-btn { + display: flex; + margin: 20px 0; +} +.page-mj .inner .task-list-box .task-list-inner .submit-btn .el-button { + width: 200px; +} +.page-mj .inner .task-list-box .task-list-inner .submit-btn .text-info { + width: 100%; + display: flex; + justify-content: right; + align-items: center; +} .page-mj .inner .task-list-box .running-job-list .job-item { width: 100%; padding: 2px; @@ -253,5 +371,4 @@ margin-left: 10px; cursor: pointer; position: relative; - top: 2px; } diff --git a/web/src/assets/css/image-mj.styl b/web/src/assets/css/image-mj.styl index ad3cabc5..47ad2fe6 100644 --- a/web/src/assets/css/image-mj.styl +++ b/web/src/assets/css/image-mj.styl @@ -54,7 +54,7 @@ background-color #585858 } - .icon{ + .icon { width 20px height 20px margin-bottom 5px @@ -162,17 +162,20 @@ .form-item-inner { display flex align-items: center - + .el-select { --el-select-input-focus-border-color: #47FFF1; --el-input-focus-border-color: #47FFF1; } + .el-input__wrapper { background: #383838; } + .el-input__inner { color: #fff } + .el-icon { margin-left 10px } @@ -211,19 +214,6 @@ padding-bottom 5px } } - - .submit-btn { - padding 10px 15px 0 15px - text-align center - - .el-button { - width 100% - - span { - color #2D3A4B - } - } - } } .el-form { diff --git a/web/src/assets/css/image-sd.css b/web/src/assets/css/image-sd.css index 6799e825..9bd76f37 100644 --- a/web/src/assets/css/image-sd.css +++ b/web/src/assets/css/image-sd.css @@ -72,6 +72,86 @@ color: #fff; overflow-x: hidden; } +.page-sd .inner .task-list-box .task-list-inner .el-tabs { + --el-tabs-header-height: 55px; +} +.page-sd .inner .task-list-box .task-list-inner .el-tabs__item { + color: #fff; + font-size: 18px; +} +.page-sd .inner .task-list-box .task-list-inner .title-tabs .el-tabs__item.is-active { + color: #47fff1; + font-size: 18px; +} +.page-sd .inner .task-list-box .task-list-inner .title-tabs .el-tabs__active-bar { + background-color: #47fff1; +} +.page-sd .inner .task-list-box .task-list-inner .title-tabs .el-tabs__content { + padding: 10px 0; +} +.page-sd .inner .task-list-box .task-list-inner .el-textarea { + --el-input-focus-border-color: #47fff1; +} +.page-sd .inner .task-list-box .task-list-inner .el-textarea__inner { + background: transparent; + color: #fff; +} +.page-sd .inner .task-list-box .task-list-inner .el-input__wrapper { + background: transparent; + padding: 5px; +} +.page-sd .inner .task-list-box .task-list-inner .text { + margin-bottom: 10px; + color: #6b778c; + font-size: 15px; +} +.page-sd .inner .task-list-box .task-list-inner .param-line.pt { + padding-top: 5px; + padding-bottom: 5px; +} +.page-sd .inner .task-list-box .task-list-inner .form-item-inner { + display: flex; + align-items: center; +} +.page-sd .inner .task-list-box .task-list-inner .form-item-inner .el-icon { + margin-left: 10px; +} +.page-sd .inner .task-list-box .task-list-inner .el-form-item__label { + color: #fff; +} +.page-sd .inner .task-list-box .task-list-inner .img-uploader .el-upload { + border: 1px dashed var(--el-border-color); + border-radius: 6px; + cursor: pointer; + position: relative; + overflow: hidden; + width: 300px; + transition: var(--el-transition-duration-fast); + margin-bottom: 20px; +} +.page-sd .inner .task-list-box .task-list-inner .img-uploader .el-upload:hover { + border-color: var(--el-color-primary); +} +.page-sd .inner .task-list-box .task-list-inner .img-uploader .el-upload .el-icon.uploader-icon { + font-size: 28px; + color: #8c939d; + width: 100%; + height: 120px; + text-align: center; +} +.page-sd .inner .task-list-box .task-list-inner .submit-btn { + display: flex; + margin: 20px 0; +} +.page-sd .inner .task-list-box .task-list-inner .submit-btn .el-button { + width: 200px; +} +.page-sd .inner .task-list-box .task-list-inner .submit-btn .text-info { + width: 100%; + display: flex; + justify-content: right; + align-items: center; +} .page-sd .inner .task-list-box .running-job-list .job-item { width: 100%; padding: 2px; diff --git a/web/src/assets/css/task-list.styl b/web/src/assets/css/task-list.styl index 67ff20e3..92000098 100644 --- a/web/src/assets/css/task-list.styl +++ b/web/src/assets/css/task-list.styl @@ -8,24 +8,29 @@ .el-tabs { --el-tabs-header-height: 55px; } + .el-tabs__item { color: #fff; font-size: 18px; } + .title-tabs .el-tabs__item.is-active { - color: #47FFF1; - font-size: 18px; + color: #47FFF1; + font-size: 18px; } + .title-tabs .el-tabs__active-bar { - background-color: #47FFF1; + background-color: #47FFF1; } + .title-tabs .el-tabs__content { padding: 10px 0; } .el-textarea { - --el-input-focus-border-color: #47FFF1; + --el-input-focus-border-color: #47FFF1; } + .el-textarea__inner { background: transparent; color: #fff; @@ -36,8 +41,8 @@ padding 5px } - .text{ - margin-bottom: 10px; + .text { + margin-bottom: 10px; color: #6b778c; font-size: 15px } @@ -85,16 +90,20 @@ } } - .submit-btn{ - margin: 20px 0 + .submit-btn { + display flex + margin: 20px 0 - .el-icon.submit-icon { - font-size: 28px - width 100% - height: 100px - text-align: center - margin-right: 10px - } + .el-button { + width 200px + } + + .text-info { + width 100% + display flex + justify-content right + align-items center + } } } diff --git a/web/src/views/Home.vue b/web/src/views/Home.vue index f1099960..971ed1c3 100644 --- a/web/src/views/Home.vue +++ b/web/src/views/Home.vue @@ -1,58 +1,59 @@ - - - - - - - - - - - - - - - - - {{ item.title }} - - - - - - - - - - - + + + + + + + + + + + + + + + + + + {{ item.title }} + + + + + + + + + + + @@ -85,9 +86,9 @@ const changeNav = (item) => { } .nav-items { - margin-top: 20px; - padding-left: 10px; - padding-right: 10px; + margin-top: 20px; + padding-left: 10px; + padding-right: 10px; li { margin-bottom 15px @@ -116,13 +117,14 @@ const changeNav = (item) => { color #47fff1 } - .title{ - font-size: 12px - padding-top: 5px - color: #e5e7eb; - text-align: center; - } - .active { + .title { + font-size: 12px + padding-top: 5px + color: #e5e7eb; + text-align: center; + } + + .active { color #47fff1 } } diff --git a/web/src/views/ImageMj.vue b/web/src/views/ImageMj.vue index 375ecff0..b289c52d 100644 --- a/web/src/views/ImageMj.vue +++ b/web/src/views/ImageMj.vue @@ -1,546 +1,495 @@ - - - - MidJourney 创作中心 + + + + MidJourney 创作中心 - - - - 图片比例: - - - - - - + + + + 图片比例: + + + + + + - - - - - - - {{ item.text }} - - - - + + + + + + + {{ item.text }} + + + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - - 模型选择: - - - - - - - - - - - - {{ item.text }} - - - - + + 模型选择: + + + + + + + + + + + + {{ item.text }} + + + + - - - - - - - - - - - - - - + + + + + + + + + + + + + + - - - - - - - - - - - - - - + + + + + + + + + + + + + + - - - - - - - - - - - - - - - + + + + + + + + + + + + + + - - - - - - - - - - - - - - - + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + AI绘画 + + + + 图生图:以某张图片为底稿参考来创作绘画,生成类似风格或类型图像,支持 PNG 和 JPG 格式图片; + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - + + + + + + + + - + + + + + + + + + + + + + + + - + + + - - - - - - - - --> + + 融图功能正在紧锣密鼓开发中,敬请期待... + + - - - - {{ imgCalls }} - - - - - - - - - - AI绘画 - - - 图生图:以某张图片为底稿参考来创作绘画,生成类似风格或类型图像,支持 PNG 和 JPG 格式图片; - - - - - - - - - - - - - - - - - + + + + 提示词: + + + + + + + + + + + 翻译 + + + - - - - - - - - + + + - - - - - - - - - - - - - - - + + + + 不希望出现的内容:(可选) + + + + + + + + + + + 翻译 + + + - - 图生文:上传一张图片生成对应的提示词; - - - - + + + - - 融图:融合图片风格; - - - - - - + + 立即生成 + + 可用额度:{{ imgCalls }} + + + - - - - 提示词: - - - - - - - - 翻译 - - - + 任务列表 + + + + + + + + + 正在加载图片 + + - - - + + + + + + + + - - - - 不希望出现的内容:(可选) - - - - - - - - 翻译 - - - + + + + + + + + + 任务正在排队中 + + + + + + + + - - - + 创作记录 + + + + + + + + 正在加载图片 + + - - - - - 立即生成 - - + + + + + + + + - 任务列表 - - - - - - - - - 正在加载图片 - - + + + + U1 + U2 + U3 + U4 + - - - - - - - - + + + + + + - - - - - - - - - 任务正在排队中 - - - - - - - - + + + {{ scope.item.prompt }} + + + + + + + + + - 创作记录 - - - - - - - - 正在加载图片 - - + + + V1 + V2 + V3 + V4 + + + + + + - - - - - - - - + + + - - - - U1 - U2 - U3 - U4 - + + - - - - - - - - - - {{ scope.item.prompt }} - - - - - - - - - - - - - V1 - V2 - V3 - V4 - - - - - - - - - - - - - - - + diff --git a/web/src/views/admin/ApiKey.vue b/web/src/views/admin/ApiKey.vue index ee783f6f..46fb8143 100644 --- a/web/src/views/admin/ApiKey.vue +++ b/web/src/views/admin/ApiKey.vue @@ -57,7 +57,10 @@ - {{ item.name }} + {{ + item.name + }} + @@ -66,7 +69,10 @@ - {{ item.name }} + {{ + item.name + }} + diff --git a/web/src/views/admin/ChatModel.vue b/web/src/views/admin/ChatModel.vue index c6c90eac..ac0bf2e3 100644 --- a/web/src/views/admin/ChatModel.vue +++ b/web/src/views/admin/ChatModel.vue @@ -53,7 +53,10 @@ - {{ item.name }} + {{ + item.name + }} +