mirror of
https://github.com/yangjian102621/geekai.git
synced 2025-09-17 16:56:38 +08:00
feat: stable diffusion page function is ready
This commit is contained in:
parent
f971ec5d34
commit
c89f23b018
@ -114,7 +114,7 @@ func (s *Service) Txt2Img(task types.SdTask) error {
|
|||||||
TaskId: params.TaskId,
|
TaskId: params.TaskId,
|
||||||
Data: data,
|
Data: data,
|
||||||
EventData: nil,
|
EventData: nil,
|
||||||
FnIndex: 405,
|
FnIndex: 232,
|
||||||
SessionHash: "ycaxgzm9ah",
|
SessionHash: "ycaxgzm9ah",
|
||||||
}, s.httpClient)
|
}, s.httpClient)
|
||||||
}()
|
}()
|
||||||
@ -233,6 +233,8 @@ func (s *Service) runTask(taskInfo TaskInfo, client *req.Client) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (s *Service) callback(data CBReq) {
|
func (s *Service) callback(data CBReq) {
|
||||||
|
// 释放任务锁
|
||||||
|
s.redis.Del(context.Background(), RunningJobKey)
|
||||||
client := s.Clients.Get(data.SessionId)
|
client := s.Clients.Get(data.SessionId)
|
||||||
if data.Success { // 任务成功
|
if data.Success { // 任务成功
|
||||||
var job model.SdJob
|
var job model.SdJob
|
||||||
@ -262,6 +264,7 @@ func (s *Service) callback(data CBReq) {
|
|||||||
job.ImgURL = imageURL
|
job.ImgURL = imageURL
|
||||||
}
|
}
|
||||||
|
|
||||||
|
job.Params = utils.JsonEncode(params)
|
||||||
res = s.db.Updates(&job)
|
res = s.db.Updates(&job)
|
||||||
if res.Error != nil {
|
if res.Error != nil {
|
||||||
logger.Error("error with update job: ", res.Error)
|
logger.Error("error with update job: ", res.Error)
|
||||||
@ -276,7 +279,6 @@ func (s *Service) callback(data CBReq) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if data.Progress < 100 {
|
if data.Progress < 100 {
|
||||||
logger.Infof(data.ImageData)
|
|
||||||
jobVo.ImgURL = data.ImageData
|
jobVo.ImgURL = data.ImageData
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -45,200 +45,95 @@ var ParamKeys = map[string]int{
|
|||||||
}
|
}
|
||||||
|
|
||||||
const Text2ImgParamTemplate = `[
|
const Text2ImgParamTemplate = `[
|
||||||
"task(p1lk3n41saygmr8)",
|
"task(6sm0b3j17tag2gd)",
|
||||||
"a tiger sit on the window",
|
"A beautiful Chinese girl wearing a cheongsam walks on the bluestone street",
|
||||||
"",
|
"",
|
||||||
[],
|
[],
|
||||||
20,
|
50,
|
||||||
"Euler a",
|
"Euler a",
|
||||||
false,
|
false,
|
||||||
false,
|
false,
|
||||||
1,
|
1,
|
||||||
1,
|
1,
|
||||||
7,
|
15,
|
||||||
-1,
|
null,
|
||||||
-1,
|
-1,
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
false,
|
false,
|
||||||
128,
|
768,
|
||||||
128,
|
512,
|
||||||
false,
|
false,
|
||||||
0.7,
|
0.7,
|
||||||
2,
|
2,
|
||||||
"Latent",
|
"ESRGAN_4x",
|
||||||
0,
|
10,
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
[],
|
"Use same sampler",
|
||||||
"None",
|
"",
|
||||||
false,
|
"",
|
||||||
"MultiDiffusion",
|
[],
|
||||||
false,
|
"None",
|
||||||
10,
|
null,
|
||||||
1,
|
false,
|
||||||
1,
|
false,
|
||||||
64,
|
"positive",
|
||||||
false,
|
"comma",
|
||||||
true,
|
0,
|
||||||
1024,
|
false,
|
||||||
1024,
|
false,
|
||||||
96,
|
"",
|
||||||
96,
|
"Seed",
|
||||||
48,
|
"",
|
||||||
1,
|
[],
|
||||||
"None",
|
"Nothing",
|
||||||
2,
|
"",
|
||||||
false,
|
[],
|
||||||
false,
|
"Nothing",
|
||||||
false,
|
"",
|
||||||
false,
|
[],
|
||||||
false,
|
true,
|
||||||
0.4,
|
false,
|
||||||
0.4,
|
false,
|
||||||
0.2,
|
false,
|
||||||
0.2,
|
0,
|
||||||
"",
|
"Not set",
|
||||||
"",
|
true,
|
||||||
"Background",
|
true,
|
||||||
0.2,
|
"",
|
||||||
-1,
|
"",
|
||||||
false,
|
"",
|
||||||
0.4,
|
"",
|
||||||
0.4,
|
"",
|
||||||
0.2,
|
1.3,
|
||||||
0.2,
|
"Not set",
|
||||||
"",
|
"Not set",
|
||||||
"",
|
1.3,
|
||||||
"Background",
|
"Not set",
|
||||||
0.2,
|
1.3,
|
||||||
-1,
|
"Not set",
|
||||||
false,
|
1.3,
|
||||||
0.4,
|
1.3,
|
||||||
0.4,
|
"Not set",
|
||||||
0.2,
|
1.3,
|
||||||
0.2,
|
"Not set",
|
||||||
"",
|
1.3,
|
||||||
"",
|
"Not set",
|
||||||
"Background",
|
1.3,
|
||||||
0.2,
|
"Not set",
|
||||||
-1,
|
1.3,
|
||||||
false,
|
"Not set",
|
||||||
0.4,
|
1.3,
|
||||||
0.4,
|
"Not set",
|
||||||
0.2,
|
false,
|
||||||
0.2,
|
"None",
|
||||||
"",
|
null,
|
||||||
"",
|
false,
|
||||||
"Background",
|
50,
|
||||||
0.2,
|
[],
|
||||||
-1,
|
"",
|
||||||
false,
|
"",
|
||||||
0.4,
|
""
|
||||||
0.4,
|
|
||||||
0.2,
|
|
||||||
0.2,
|
|
||||||
"",
|
|
||||||
"",
|
|
||||||
"Background",
|
|
||||||
0.2,
|
|
||||||
-1,
|
|
||||||
false,
|
|
||||||
0.4,
|
|
||||||
0.4,
|
|
||||||
0.2,
|
|
||||||
0.2,
|
|
||||||
"",
|
|
||||||
"",
|
|
||||||
"Background",
|
|
||||||
0.2,
|
|
||||||
-1,
|
|
||||||
false,
|
|
||||||
0.4,
|
|
||||||
0.4,
|
|
||||||
0.2,
|
|
||||||
0.2,
|
|
||||||
"",
|
|
||||||
"",
|
|
||||||
"Background",
|
|
||||||
0.2,
|
|
||||||
-1,
|
|
||||||
false,
|
|
||||||
0.4,
|
|
||||||
0.4,
|
|
||||||
0.2,
|
|
||||||
0.2,
|
|
||||||
"",
|
|
||||||
"",
|
|
||||||
"Background",
|
|
||||||
0.2,
|
|
||||||
-1,
|
|
||||||
false,
|
|
||||||
false,
|
|
||||||
true,
|
|
||||||
true,
|
|
||||||
false,
|
|
||||||
1536,
|
|
||||||
96,
|
|
||||||
false,
|
|
||||||
false,
|
|
||||||
"LoRA",
|
|
||||||
"None",
|
|
||||||
1,
|
|
||||||
1,
|
|
||||||
"LoRA",
|
|
||||||
"None",
|
|
||||||
1,
|
|
||||||
1,
|
|
||||||
"LoRA",
|
|
||||||
"None",
|
|
||||||
1,
|
|
||||||
1,
|
|
||||||
"LoRA",
|
|
||||||
"None",
|
|
||||||
1,
|
|
||||||
1,
|
|
||||||
"LoRA",
|
|
||||||
"None",
|
|
||||||
1,
|
|
||||||
1,
|
|
||||||
null,
|
|
||||||
"Refresh models",
|
|
||||||
null,
|
|
||||||
null,
|
|
||||||
null,
|
|
||||||
null,
|
|
||||||
false,
|
|
||||||
false,
|
|
||||||
"positive",
|
|
||||||
"comma",
|
|
||||||
0,
|
|
||||||
false,
|
|
||||||
false,
|
|
||||||
"",
|
|
||||||
"Seed",
|
|
||||||
"",
|
|
||||||
"Nothing",
|
|
||||||
"",
|
|
||||||
"Nothing",
|
|
||||||
"",
|
|
||||||
true,
|
|
||||||
false,
|
|
||||||
false,
|
|
||||||
false,
|
|
||||||
0,
|
|
||||||
null,
|
|
||||||
false,
|
|
||||||
null,
|
|
||||||
false,
|
|
||||||
null,
|
|
||||||
false,
|
|
||||||
null,
|
|
||||||
false,
|
|
||||||
50,
|
|
||||||
[],
|
|
||||||
"",
|
|
||||||
"",
|
|
||||||
""
|
|
||||||
]`
|
]`
|
||||||
|
@ -87,31 +87,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 修改滚动条的颜色 */
|
|
||||||
|
|
||||||
::-webkit-scrollbar {
|
|
||||||
width: 10px; /* 滚动条宽度 */
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 修改滚动条轨道的背景颜色 */
|
|
||||||
|
|
||||||
::-webkit-scrollbar-track {
|
|
||||||
background-color: #282C34;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 修改滚动条的滑块颜色 */
|
|
||||||
|
|
||||||
::-webkit-scrollbar-thumb {
|
|
||||||
background-color: #444444;
|
|
||||||
border-radius 10px
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 修改滚动条的滑块的悬停颜色 */
|
|
||||||
|
|
||||||
::-webkit-scrollbar-thumb:hover {
|
|
||||||
background-color: #666666;
|
|
||||||
}
|
|
||||||
|
|
||||||
.task-list-box {
|
.task-list-box {
|
||||||
width 100%
|
width 100%
|
||||||
padding 10px
|
padding 10px
|
||||||
@ -243,13 +218,106 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.el-overlay-dialog {
|
||||||
|
.el-dialog {
|
||||||
|
background-color #1a1b1e
|
||||||
|
|
||||||
|
.el-dialog__header {
|
||||||
|
.el-dialog__title {
|
||||||
|
color #F5F5F5
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-dialog__body {
|
||||||
|
padding 0 0 0 15px !important
|
||||||
|
display flex
|
||||||
|
height 100%
|
||||||
|
|
||||||
|
.img-container {
|
||||||
|
display flex
|
||||||
|
justify-content center
|
||||||
|
width 100%
|
||||||
|
}
|
||||||
|
|
||||||
|
.task-info {
|
||||||
|
max-width 320px
|
||||||
|
min-width 320px
|
||||||
|
background-color #25262b
|
||||||
|
padding 10px 15px
|
||||||
|
|
||||||
|
.info-line {
|
||||||
|
width 100%
|
||||||
|
|
||||||
|
.prompt {
|
||||||
|
background-color #35363b
|
||||||
|
padding 10px
|
||||||
|
color #999999
|
||||||
|
overflow auto
|
||||||
|
max-height 100px
|
||||||
|
min-height 50px
|
||||||
|
}
|
||||||
|
|
||||||
|
.wrapper {
|
||||||
|
margin-top 10px
|
||||||
|
display flex
|
||||||
|
|
||||||
|
label {
|
||||||
|
display flex
|
||||||
|
width 100px
|
||||||
|
color #a5a5a5
|
||||||
|
}
|
||||||
|
|
||||||
|
.item-value {
|
||||||
|
display flex
|
||||||
|
width 100%
|
||||||
|
background-color #35363b
|
||||||
|
padding 2px 5px
|
||||||
|
border-radius 5px
|
||||||
|
color #F5F5F5
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.mj-list-item-prompt {
|
||||||
|
.el-icon {
|
||||||
|
margin-left 10px
|
||||||
|
cursor pointer
|
||||||
|
position relative
|
||||||
|
top 2px
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.mj-list-item-prompt {
|
.custom-scroll {
|
||||||
.el-icon {
|
/* 修改滚动条的颜色 */
|
||||||
margin-left 10px
|
|
||||||
cursor pointer
|
::-webkit-scrollbar {
|
||||||
position relative
|
width: 10px; /* 滚动条宽度 */
|
||||||
top 2px
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
/* 修改滚动条轨道的背景颜色 */
|
||||||
|
|
||||||
|
::-webkit-scrollbar-track {
|
||||||
|
background-color: #282C34;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 修改滚动条的滑块颜色 */
|
||||||
|
|
||||||
|
::-webkit-scrollbar-thumb {
|
||||||
|
background-color: #444444;
|
||||||
|
border-radius 10px
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 修改滚动条的滑块的悬停颜色 */
|
||||||
|
|
||||||
|
::-webkit-scrollbar-thumb:hover {
|
||||||
|
background-color: #666666;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -1,42 +1,17 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="page-sd">
|
<div class="page-sd">
|
||||||
<div class="inner">
|
<div class="inner custom-scroll">
|
||||||
<div class="sd-box">
|
<div class="sd-box">
|
||||||
<h2>MidJourney 创作中心</h2>
|
<h2>MidJourney 创作中心</h2>
|
||||||
|
|
||||||
<div class="sd-params" :style="{ height: mjBoxHeight + 'px' }">
|
<div class="sd-params" :style="{ height: mjBoxHeight + 'px' }">
|
||||||
<el-form :model="params" label-width="80px" label-position="left">
|
<el-form :model="params" label-width="80px" label-position="left">
|
||||||
<div class="param-line pt">
|
|
||||||
<span>图片比例:</span>
|
|
||||||
<el-tooltip
|
|
||||||
effect="light"
|
|
||||||
content="生成图片的尺寸比例"
|
|
||||||
placement="right"
|
|
||||||
>
|
|
||||||
<el-icon>
|
|
||||||
<InfoFilled/>
|
|
||||||
</el-icon>
|
|
||||||
</el-tooltip>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="param-line pt">
|
|
||||||
<el-row :gutter="10">
|
|
||||||
<el-col :span="8" v-for="item in rates" :key="item.value">
|
|
||||||
<div :class="item.value === params.rate?'grid-content active':'grid-content'"
|
|
||||||
@click="changeRate(item)">
|
|
||||||
<div :class="'shape '+item.css"></div>
|
|
||||||
<div class="text">{{ item.text }}</div>
|
|
||||||
</div>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="param-line" style="padding-top: 10px">
|
<div class="param-line" style="padding-top: 10px">
|
||||||
<el-form-item label="采样方法">
|
<el-form-item label="采样方法">
|
||||||
<template #default>
|
<template #default>
|
||||||
<div class="form-item-inner">
|
<div class="form-item-inner">
|
||||||
<el-select v-model="params.sampler" size="small">
|
<el-select v-model="params.sampler" size="small">
|
||||||
<el-option v-for="item in samplers" :label="item" :value="item"/>
|
<el-option v-for="item in samplers" :label="item" :value="item" :key="item"/>
|
||||||
</el-select>
|
</el-select>
|
||||||
<el-tooltip
|
<el-tooltip
|
||||||
effect="light"
|
effect="light"
|
||||||
@ -111,7 +86,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="param-line">
|
<div class="param-line">
|
||||||
<el-form-item label="引导系数">
|
<el-form-item label="随机因子">
|
||||||
<template #default>
|
<template #default>
|
||||||
<div class="form-item-inner">
|
<div class="form-item-inner">
|
||||||
<el-input v-model.number="params.seed" size="small"/>
|
<el-input v-model.number="params.seed" size="small"/>
|
||||||
@ -154,7 +129,7 @@
|
|||||||
<el-form-item label="高清修复">
|
<el-form-item label="高清修复">
|
||||||
<template #default>
|
<template #default>
|
||||||
<div class="form-item-inner">
|
<div class="form-item-inner">
|
||||||
<el-switch v-model="params.hd_fix" style="--el-switch-on-color: #47fff1;"/>
|
<el-switch v-model="params.hd_fix" style="--el-switch-on-color: #47fff1;" @change="switchHdFix"/>
|
||||||
<el-tooltip
|
<el-tooltip
|
||||||
effect="light"
|
effect="light"
|
||||||
content="先以较小的分辨率生成图像,接着方法图像<br />然后在不更改构图的情况下再修改细节"
|
content="先以较小的分辨率生成图像,接着方法图像<br />然后在不更改构图的情况下再修改细节"
|
||||||
@ -170,85 +145,89 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="param-line">
|
<div v-show="showHdFix">
|
||||||
<el-form-item label="重绘幅度">
|
<div class="param-line">
|
||||||
<template #default>
|
<el-form-item label="重绘幅度">
|
||||||
<div class="form-item-inner">
|
<template #default>
|
||||||
<el-slider v-model.number="params.hd_redraw_rate" :max="1" :step="0.1"
|
<div class="form-item-inner">
|
||||||
style="width: 180px;--el-slider-main-bg-color:#47fff1"/>
|
<el-slider v-model.number="params.hd_redraw_rate" :max="1" :step="0.1"
|
||||||
<el-tooltip
|
style="width: 180px;--el-slider-main-bg-color:#47fff1"/>
|
||||||
effect="light"
|
<el-tooltip
|
||||||
content="决定算法对图像内容的影响程度<br />较大的值将得到越有创意的图像"
|
effect="light"
|
||||||
raw-content
|
content="决定算法对图像内容的影响程度<br />较大的值将得到越有创意的图像"
|
||||||
placement="right"
|
raw-content
|
||||||
>
|
placement="right"
|
||||||
<el-icon style="margin-top: 6px">
|
>
|
||||||
<InfoFilled/>
|
<el-icon style="margin-top: 6px">
|
||||||
</el-icon>
|
<InfoFilled/>
|
||||||
</el-tooltip>
|
</el-icon>
|
||||||
</div>
|
</el-tooltip>
|
||||||
</template>
|
</div>
|
||||||
</el-form-item>
|
</template>
|
||||||
</div>
|
</el-form-item>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="param-line">
|
<div class="param-line">
|
||||||
<el-form-item label="放大算法">
|
<el-form-item label="放大算法">
|
||||||
<template #default>
|
<template #default>
|
||||||
<div class="form-item-inner">
|
<div class="form-item-inner">
|
||||||
<el-input v-model.number="params.hd_scale_alg" size="small"/>
|
<el-select v-model="params.hd_scale_alg" size="small">
|
||||||
<el-tooltip
|
<el-option v-for="item in scaleAlg" :label="item" :value="item" :key="item"/>
|
||||||
effect="light"
|
</el-select>
|
||||||
content="随机数种子,相同的种子会得到相同的结果<br/> 设置为 -1 则每次随机生成种子"
|
<el-tooltip
|
||||||
raw-content
|
effect="light"
|
||||||
placement="right"
|
content="高清修复放大算法,主流算法有Latent和ESRGAN_4x"
|
||||||
>
|
raw-content
|
||||||
<el-icon>
|
placement="right"
|
||||||
<InfoFilled/>
|
>
|
||||||
</el-icon>
|
<el-icon>
|
||||||
</el-tooltip>
|
<InfoFilled/>
|
||||||
</div>
|
</el-icon>
|
||||||
</template>
|
</el-tooltip>
|
||||||
</el-form-item>
|
</div>
|
||||||
</div>
|
</template>
|
||||||
|
</el-form-item>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="param-line">
|
<div class="param-line">
|
||||||
<el-form-item label="放大倍数">
|
<el-form-item label="放大倍数">
|
||||||
<template #default>
|
<template #default>
|
||||||
<div class="form-item-inner">
|
<div class="form-item-inner">
|
||||||
<el-input v-model.number="params.hd_scale" size="small"/>
|
<el-input v-model.number="params.hd_scale" size="small"/>
|
||||||
<el-tooltip
|
<el-tooltip
|
||||||
effect="light"
|
effect="light"
|
||||||
content="随机数种子,相同的种子会得到相同的结果<br/> 设置为 -1 则每次随机生成种子"
|
content="随机数种子,相同的种子会得到相同的结果<br/> 设置为 -1 则每次随机生成种子"
|
||||||
raw-content
|
raw-content
|
||||||
placement="right"
|
placement="right"
|
||||||
>
|
>
|
||||||
<el-icon>
|
<el-icon>
|
||||||
<InfoFilled/>
|
<InfoFilled/>
|
||||||
</el-icon>
|
</el-icon>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="param-line">
|
<div class="param-line">
|
||||||
<el-form-item label="迭代步数">
|
<el-form-item label="迭代步数">
|
||||||
<template #default>
|
<template #default>
|
||||||
<div class="form-item-inner">
|
<div class="form-item-inner">
|
||||||
<el-input v-model.number="params.hd_scale" size="small"/>
|
<el-input v-model.number="params.hd_steps" size="small"/>
|
||||||
<el-tooltip
|
<el-tooltip
|
||||||
effect="light"
|
effect="light"
|
||||||
content="放大迭代步数,相同的种子会得到相同的结果<br/> 设置为 -1 则每次随机生成种子"
|
content="重绘迭代步数,如果设置为0,则设置跟原图相同的迭代步数"
|
||||||
raw-content
|
raw-content
|
||||||
placement="right"
|
placement="right"
|
||||||
>
|
>
|
||||||
<el-icon>
|
<el-icon>
|
||||||
<InfoFilled/>
|
<InfoFilled/>
|
||||||
</el-icon>
|
</el-icon>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="param-line">
|
<div class="param-line">
|
||||||
@ -360,7 +339,7 @@
|
|||||||
<div class="finish-job-list">
|
<div class="finish-job-list">
|
||||||
<ItemList :items="finishedJobs" v-if="finishedJobs.length > 0">
|
<ItemList :items="finishedJobs" v-if="finishedJobs.length > 0">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<div class="job-item">
|
<div class="job-item" @click="showTask(scope.item)">
|
||||||
<el-image
|
<el-image
|
||||||
:src="scope.item['img_url']+'?imageView2/1/w/240/h/240/q/75'"
|
:src="scope.item['img_url']+'?imageView2/1/w/240/h/240/q/75'"
|
||||||
fit="cover"
|
fit="cover"
|
||||||
@ -388,13 +367,104 @@
|
|||||||
</div><!-- end task list box -->
|
</div><!-- end task list box -->
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- 任务详情弹框 -->
|
||||||
|
<el-dialog v-model="showTaskDialog" title="绘画任务详情" :fullscreen="true">
|
||||||
|
<div class="img-container">
|
||||||
|
<el-image :src="item['img_url']"
|
||||||
|
:style="{maxHeight: fullImgHeight+'px'}" fix="cover"/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="task-info">
|
||||||
|
<div class="info-line">
|
||||||
|
<el-divider>
|
||||||
|
正向提示词
|
||||||
|
</el-divider>
|
||||||
|
<div class="prompt">{{ item.prompt }}</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="info-line">
|
||||||
|
<el-divider>
|
||||||
|
反向提示词
|
||||||
|
</el-divider>
|
||||||
|
<div class="prompt">{{ item.params.negative_prompt }}</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="info-line">
|
||||||
|
<div class="wrapper">
|
||||||
|
<label>采样方法:</label>
|
||||||
|
<div class="item-value">{{ item.params.sampler }}</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="info-line">
|
||||||
|
<div class="wrapper">
|
||||||
|
<label>图片尺寸:</label>
|
||||||
|
<div class="item-value">{{ item.params.width }} x {{ item.params.height }}</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="info-line">
|
||||||
|
<div class="wrapper">
|
||||||
|
<label>迭代步数:</label>
|
||||||
|
<div class="item-value">{{ item.params.steps }}</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="info-line">
|
||||||
|
<div class="wrapper">
|
||||||
|
<label>引导系数:</label>
|
||||||
|
<div class="item-value">{{ item.params.cfg_scale }}</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="info-line">
|
||||||
|
<div class="wrapper">
|
||||||
|
<label>随机因子:</label>
|
||||||
|
<div class="item-value">{{ item.params.seed }}</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div v-if="item.params.hd_fix">
|
||||||
|
<el-divider>
|
||||||
|
高清修复
|
||||||
|
</el-divider>
|
||||||
|
<div class="info-line">
|
||||||
|
<div class="wrapper">
|
||||||
|
<label>重绘幅度:</label>
|
||||||
|
<div class="item-value">{{ item.params.hd_redraw_rate }}</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="info-line">
|
||||||
|
<div class="wrapper">
|
||||||
|
<label>放大算法:</label>
|
||||||
|
<div class="item-value">{{ item.params.hd_scale_alg }}</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="info-line">
|
||||||
|
<div class="wrapper">
|
||||||
|
<label>放大倍数:</label>
|
||||||
|
<div class="item-value">{{ item.params.hd_scale }}</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="info-line">
|
||||||
|
<div class="wrapper">
|
||||||
|
<label>迭代步数:</label>
|
||||||
|
<div class="item-value">{{ item.params.hd_steps }}</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import {onMounted, ref} from "vue"
|
import {onMounted, ref} from "vue"
|
||||||
import {ChromeFilled, DeleteFilled, DocumentCopy, InfoFilled, Picture, Plus} from "@element-plus/icons-vue";
|
import {DocumentCopy, InfoFilled, Picture} from "@element-plus/icons-vue";
|
||||||
import Compressor from "compressorjs";
|
|
||||||
import {httpGet, httpPost} from "@/utils/http";
|
import {httpGet, httpPost} from "@/utils/http";
|
||||||
import {ElMessage} from "element-plus";
|
import {ElMessage} from "element-plus";
|
||||||
import ItemList from "@/components/ItemList.vue";
|
import ItemList from "@/components/ItemList.vue";
|
||||||
@ -405,22 +475,21 @@ import {getSessionId, getUserToken} from "@/store/session";
|
|||||||
|
|
||||||
const listBoxHeight = ref(window.innerHeight - 40)
|
const listBoxHeight = ref(window.innerHeight - 40)
|
||||||
const mjBoxHeight = ref(window.innerHeight - 150)
|
const mjBoxHeight = ref(window.innerHeight - 150)
|
||||||
|
const fullImgHeight = ref(window.innerHeight - 60)
|
||||||
|
const showHdFix = ref(false)
|
||||||
|
const showTaskDialog = ref(false)
|
||||||
|
const item = ref({})
|
||||||
|
|
||||||
window.onresize = () => {
|
window.onresize = () => {
|
||||||
listBoxHeight.value = window.innerHeight - 40
|
listBoxHeight.value = window.innerHeight - 40
|
||||||
mjBoxHeight.value = window.innerHeight - 150
|
mjBoxHeight.value = window.innerHeight - 150
|
||||||
}
|
}
|
||||||
const rates = [
|
|
||||||
{css: "horizontal", value: "768x512", text: "横图"},
|
|
||||||
{css: "square", value: "512x512", text: "方图"},
|
|
||||||
{css: "vertical", value: "512x768", text: "竖图"},
|
|
||||||
]
|
|
||||||
const samplers = ["Euler a", "Euler", "DPM2 a Karras", "DPM++ 2S a Karras", "DPM++ 2M Karras", "DPM++ SDE Karras", "DPM2", "DPM2 a", "DPM++ 2S a", "DPM++ 2M", "DPM++ SDE", "DPM fast", "DPM adaptive",
|
const samplers = ["Euler a", "Euler", "DPM2 a Karras", "DPM++ 2S a Karras", "DPM++ 2M Karras", "DPM++ SDE Karras", "DPM2", "DPM2 a", "DPM++ 2S a", "DPM++ 2M", "DPM++ SDE", "DPM fast", "DPM adaptive",
|
||||||
"LMS Karras", "DPM2 Karras", "DDIM", "PLMS", "UniPC", "LMS", "Heun",]
|
"LMS Karras", "DPM2 Karras", "DDIM", "PLMS", "UniPC", "LMS", "Heun",]
|
||||||
|
const scaleAlg = ["Latent", "ESRGAN_4x", "R-ESRGAN 4x+", "SwinIR_4x", "LDSR"]
|
||||||
const params = ref({
|
const params = ref({
|
||||||
rate: rates[1].value,
|
width: 1024,
|
||||||
width: 256,
|
height: 1024,
|
||||||
height: 256,
|
|
||||||
sampler: samplers[0],
|
sampler: samplers[0],
|
||||||
seed: -1,
|
seed: -1,
|
||||||
steps: 20,
|
steps: 20,
|
||||||
@ -429,9 +498,9 @@ const params = ref({
|
|||||||
hd_fix: false,
|
hd_fix: false,
|
||||||
hd_redraw_rate: 0.3,
|
hd_redraw_rate: 0.3,
|
||||||
hd_scale: 2,
|
hd_scale: 2,
|
||||||
hd_scale_alg: "ESRGAN_4x",
|
hd_scale_alg: scaleAlg[0],
|
||||||
hd_steps: 10,
|
hd_steps: 0,
|
||||||
prompt: "a tiger sit on the window",
|
prompt: "A beautiful Chinese girl riding on a tiger",
|
||||||
negative_prompt: "nsfw, paintings, cartoon, anime, sketches, low quality,easynegative,ng_deepnegative _v1 75t,(worst quality:2),(low quality:2),(normalquality:2),lowres,bad anatomy,bad hands,normal quality,((monochrome)),((grayscale)),((watermark))",
|
negative_prompt: "nsfw, paintings, cartoon, anime, sketches, low quality,easynegative,ng_deepnegative _v1 75t,(worst quality:2),(low quality:2),(normalquality:2),lowres,bad anatomy,bad hands,normal quality,((monochrome)),((grayscale)),((watermark))",
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -539,9 +608,9 @@ onMounted(() => {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
// 切换图片比例
|
// 启用高清修复
|
||||||
const changeRate = (item) => {
|
const switchHdFix = () => {
|
||||||
params.value.rate = item.value
|
showHdFix.value = params.value.hd_fix === true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -561,6 +630,11 @@ const generate = () => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const showTask = (row) => {
|
||||||
|
item.value = row
|
||||||
|
showTaskDialog.value = true
|
||||||
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="stylus">
|
<style lang="stylus">
|
||||||
|
Loading…
Reference in New Issue
Block a user