This commit is contained in:
liyuwanglan 2023-12-05 11:08:03 +08:00
parent 5a799139cd
commit aa65f49190
20 changed files with 1004 additions and 537 deletions

BIN
web/public/images/16_9.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
web/public/images/1_1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
web/public/images/1_2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
web/public/images/2_1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
web/public/images/3_4.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
web/public/images/4_3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
web/public/images/9_16.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
web/public/images/mj1.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

BIN
web/public/images/mj2.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

BIN
web/public/images/mj3.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

BIN
web/public/images/nj1.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

BIN
web/public/images/nj2.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

BIN
web/public/images/nj3.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

BIN
web/public/images/nj4.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

View File

@ -39,4 +39,157 @@ html, body {
}
}
/* 省略显示 */
.ellipsis {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.sl {
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
}
.sl3 {
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 3;
overflow: hidden;
}
.sl4 {
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 3;
overflow: hidden;
}
/* 居中布局 */
.auto_center{
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%,-50%);
}
.h_center{
width: 100%;
position: absolute;
top: 50%;
transform: translateY(-50%);
-webkit-transform: translateY(-50%);
}
.w_center{
position: absolute;
left: 50%;
transform: translateX(-50%);
-webkit-transform: translateX(-50%);
}
/* flex布局 */
.flex-row {
display: flex;
flex-direction: row;
}
.flex-col {
display: flex;
flex-direction: column;
}
.justify-start {
justify-content: flex-start;
}
.justify-end {
justify-content: flex-end;
}
.justify-center {
justify-content: center;
}
.justify-between {
justify-content: space-between;
}
.justify-around {
justify-content: space-around;
}
.justify-evenly {
justify-content: space-evenly;
}
.items-start {
align-items: flex-start;
}
.items-end {
align-items: flex-end;
}
.items-center {
align-items: center;
}
.items-baseline {
align-items: baseline;
}
.items-stretch {
align-items: stretch;
}
.self-start {
align-self: flex-start;
}
.self-end {
align-self: flex-end;
}
.self-center {
align-self: center;
}
.self-baseline {
align-self: baseline;
}
.self-stretch {
align-self: stretch;
}
.flex-1 {
flex: 1 1 0%;
}
.flex-auto {
flex: 1 1 auto;
}
.grow {
flex-grow: 1;
}
.grow-0 {
flex-grow: 0;
}
.shrink {
flex-shrink: 1;
}
.shrink-0 {
flex-shrink: 0;
}
.shrink-1 {
flex-shrink: 1;
}
.relative {
position: relative;
}
</style>

View File

@ -40,7 +40,6 @@
.el-icon {
position relative
top 3px
}
.grid-content {
@ -49,29 +48,72 @@
padding 8px 14px
display flex
cursor pointer
margin-bottom: 10px;
&:hover {
background-color #585858
}
.icon{
width 20px
height 20px
margin-bottom 5px
}
.shape {
width 16px
height 16px
margin-right 5px
margin-bottom 5px
border 1px solid #C4C4C4
border-radius 3px
}
.shape.vertical {
width 12px
height 20px
.shape.size9-16 {
width 9px
height 16px
}
.shape.horizontal {
height 12px
width 20px
.shape.size16-9 {
height 9px
width 16px
position relative
top 3px
margin 4px 0 7px
}
.shape.size3-4 {
width 12px
height 16px
}
.shape.size4-3 {
height 12px
width 16px
position relative
margin 4px 0 4px
}
.shape.size2-3 {
width 11px
height 16px
}
.shape.size3-2 {
height 11px
width 16px
position relative
margin 4px 0 5px
}
.shape.size1-2 {
width 8px
height 16px
}
.shape.size2-1 {
height 8px
width 16px
position relative
margin 4px 0 8px
}
}
@ -90,6 +132,7 @@
border 1px solid #454545
border-radius 5px
padding 10px
margin-bottom 10px
display flex
flex-flow column
align-items center
@ -118,14 +161,23 @@
.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
margin-top 2px
}
}
.img-uploader {
.el-upload {
border: 1px dashed var(--el-border-color);
@ -153,6 +205,8 @@
}
.param-line.pt {
display: flex
align-items: center
padding-top 5px
padding-bottom 5px
}
@ -192,6 +246,5 @@
margin-left 10px
cursor pointer
position relative
top 2px
}
}

View File

@ -4,6 +4,99 @@
color #ffffff
overflow-x hidden
.task-list-inner {
.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;
}
.title-tabs .el-tabs__active-bar {
background-color: #47FFF1;
}
.title-tabs .el-tabs__content {
padding: 10px 0;
}
.el-textarea {
--el-input-focus-border-color: #47FFF1;
}
.el-textarea__inner {
background: transparent;
color: #fff;
}
.el-input__wrapper {
background: transparent;
padding 5px
}
.text{
margin-bottom: 10px;
color: #6b778c;
font-size: 15px
}
.param-line.pt {
padding-top 5px
padding-bottom 5px
}
.form-item-inner {
display flex
align-items: center
.el-icon {
margin-left 10px
}
}
.el-form-item__label {
color #ffffff
}
.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;
&:hover {
border-color: var(--el-color-primary);
}
.el-icon.uploader-icon {
font-size: 28px
color: #8c939d
width 100%
height: 120px
text-align: center
}
}
}
.submit-btn{
margin: 20px 0
.el-icon.submit-icon {
font-size: 28px
width 100%
height: 100px
text-align: center
margin-right: 10px
}
}
}
.running-job-list {
.job-item {

View File

@ -2,22 +2,20 @@
<div class="home">
<div class="navigator">
<div class="logo">
<el-link href="/">
<el-image :src="logo" />
</el-link>
<div class="divider"></div>
</div>
<ul class="nav-items">
<li v-for="item in navs" :key="item.path">
<el-tooltip
effect="light"
:content="item.title"
placement="right"
>
<el-tooltip effect="light" :content="item.title" placement="right">
<a @click="changeNav(item)" :class="item.path === curPath ? 'active' : ''">
<el-image :src="item.icon_path" :width="20" v-if="item.icon_path" />
<i :class="'iconfont icon-' + item.icon" v-else></i>
</a>
</el-tooltip>
<div :class="item.path === curPath ? 'title active' : 'title'">{{ item.title }}</div>
</li>
</ul>
</div>
@ -34,10 +32,12 @@
<script setup>
import { useRouter } from "vue-router";
import { checkSession } from "@/action/session";
import { isMobile } from "@/utils/libs";
import { ref } from "vue";
const router = useRouter();
const logo = '/images/logo.png';
const logo = '/images/icon-logo.png';
const navs = ref([
{path: "/chat", icon_path: "/images/chat.png", title: "对话聊天"},
{path: "/mj", icon_path: "/images/mj.png", title: "MJ 绘画"},
@ -67,7 +67,7 @@ const changeNav = (item) => {
.navigator {
display flex
flex-flow column
width 48px
width 70px
padding 10px 6px
border-right: 1px solid #3c3c3c
@ -75,7 +75,7 @@ const changeNav = (item) => {
display flex
flex-flow column
align-items center
height 60px
.divider {
border-bottom 1px solid #4A4A4A
@ -85,7 +85,9 @@ const changeNav = (item) => {
}
.nav-items {
margin-top 10px
margin-top: 20px;
padding-left: 10px;
padding-right: 10px;
li {
margin-bottom 15px
@ -94,8 +96,8 @@ const changeNav = (item) => {
color #DADBDC
background-color #40444A
border-radius 10px
width 44px
height 44px
width 48px
height 48px
display flex
justify-content center
align-items center
@ -112,6 +114,16 @@ const changeNav = (item) => {
a:hover, a.active {
color #47fff1
}
.title{
font-size: 12px
padding-top: 5px
color: #e5e7eb;
text-align: center;
}
.active {
color #47fff1
}
}
}

View File

@ -8,11 +8,7 @@
<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-tooltip effect="light" content="生成图片的尺寸比例" placement="right">
<el-icon>
<InfoFilled />
</el-icon>
@ -22,23 +18,42 @@
<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'"
<div class="flex-col items-center"
:class="item.value === params.rate ? 'grid-content active' : 'grid-content'"
@click="changeRate(item)">
<div :class="'shape ' + item.css"></div>
<!-- <el-image class="icon" :src="item.img" fit="cover"></el-image> -->
<div class="text">{{ item.text }}</div>
</div>
</el-col>
</el-row>
</div>
<div class="param-line" style="padding-top: 10px">
<el-form-item label="图片画质">
<template #default>
<div class="form-item-inner flex-row items-center">
<el-select v-model="params.quality" placeholder="请选择">
<el-option v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
<el-tooltip effect="light" content="生成的图片质量,质量越好出图越慢" placement="right">
<el-icon>
<InfoFilled />
</el-icon>
</el-tooltip>
</div>
</template>
</el-form-item>
</div>
<div class="param-line pt">
<span>模型选择</span>
<el-tooltip
effect="light"
content="MJ: 偏真实通用模型 <br/>NIJI: 偏动漫风格、适用于二次元模型"
raw-content
placement="right"
>
<el-tooltip effect="light" content="MJ: 偏真实通用模型 <br/>NIJI: 偏动漫风格、适用于二次元模型" raw-content
placement="right">
<el-icon>
<InfoFilled />
</el-icon>
@ -56,17 +71,51 @@
</el-row>
</div>
<div class="param-line">
<el-form-item label="重复平铺">
<template #default>
<div class="form-item-inner">
<el-switch v-model="params.tile" inactive-color="#464649" active-color="#47fff1"/>
<el-tooltip effect="light"
content="重复:--tile参数释义生成可用作重复平铺的图像以创建无缝图案。" raw-content
placement="right">
<el-icon>
<InfoFilled />
</el-icon>
</el-tooltip>
</div>
</template>
</el-form-item>
</div>
<div class="param-line">
<el-form-item label="原始模式">
<template #default>
<div class="form-item-inner">
<el-switch v-model="params.raw" inactive-color="#464649" active-color="#47fff1"/>
<el-tooltip effect="light"
content="启用新的RAW模式呈现的人物写实感更加逼真人物细节、光源、流畅度也更加接近原始作品。<br/> 同时也意味着您需要添加更长的提示。" raw-content
placement="right">
<el-icon>
<InfoFilled />
</el-icon>
</el-tooltip>
</div>
</template>
</el-form-item>
</div>
<div class="param-line" style="padding-top: 10px">
<el-form-item label="创意度">
<template #default>
<div class="form-item-inner">
<el-input v-model.number="params.chaos" size="small"/>
<el-tooltip
effect="light"
<!-- <el-input v-model.number="params.chaos" size="small" /> -->
<el-slider v-model.number="params.chaos" :max="100" :step="1"
style="width: 180px;--el-slider-main-bg-color:#47fff1" />
<el-tooltip effect="light"
content="参数用法:--chaos 或--c取值范围: 0-100 <br/> 取值越高结果越发散,反之则稳定收敛<br /> 默认值0最为精准稳定"
raw-content
placement="right"
>
raw-content placement="right">
<el-icon>
<InfoFilled />
</el-icon>
@ -80,13 +129,12 @@
<el-form-item label="风格化">
<template #default>
<div class="form-item-inner">
<el-input v-model.number="params.stylize" size="small"/>
<el-tooltip
effect="light"
<!-- <el-input v-model.number="params.stylize" size="small" /> -->
<el-slider v-model.number="params.stylize" :min="0" :max="1000" :step="1"
style="width: 180px;--el-slider-main-bg-color:#47fff1" />
<el-tooltip effect="light"
content="风格化:--stylize 或 --s范围 1-1000默认值100 <br/>高取值会产生非常艺术化但与提示关联性较低的图像"
raw-content
placement="right"
>
raw-content placement="right">
<el-icon>
<InfoFilled />
</el-icon>
@ -96,37 +144,15 @@
</el-form-item>
</div>
<div class="param-line">
<el-form-item label="随机种子">
<!-- <div class="param-line" style="padding-top: 10px">
<el-form-item label="图像权重">
<template #default>
<div class="form-item-inner">
<el-input v-model.number="params.seed" size="small"/>
<el-tooltip
effect="light"
content="随机种子:--seed默认值0表示随机产生 <br/>使用相同的种子参数和描述将产生相似的图像"
raw-content
placement="right"
>
<el-icon>
<InfoFilled/>
</el-icon>
</el-tooltip>
</div>
</template>
</el-form-item>
</div>
<div class="param-line">
<el-form-item label="原始模式">
<template #default>
<div class="form-item-inner">
<el-switch v-model="params.raw" style="--el-switch-on-color: #47fff1;"/>
<el-tooltip
effect="light"
content="启用新的RAW模式以“不带偏见”的方式生成图像。<br/> 同时也意味着您需要添加更长的提示。"
raw-content
placement="right"
>
<el-slider v-model.number="params.weight" :max="1" :step="0.01"
style="width: 180px;--el-slider-main-bg-color:#47fff1" />
<el-tooltip effect="light"
content="使用图像权重参数--iw来调整图像 URL 与文本的重要性 <br/>权重较高时意味着图像提示将对完成的作业产生更大的影响"
raw-content placement="right">
<el-icon style="margin-top: 6px">
<InfoFilled />
</el-icon>
@ -134,9 +160,30 @@
</div>
</template>
</el-form-item>
</div>
</div> -->
<div class="param-line">
<el-form-item label="随机种子">
<template #default>
<div class="form-item-inner">
<el-input v-model.number="params.seed" size="small" />
<!-- <el-slider v-model.number="params.seed" :min="0" :max="4294967295" :step="1"
style="width: 180px;--el-slider-main-bg-color:#47fff1" /> -->
<el-tooltip effect="light"
content="随机种子:--seed默认值0表示随机产生 <br/>使用相同的种子参数和描述将产生相似的图像" raw-content
placement="right">
<el-icon>
<InfoFilled />
</el-icon>
</el-tooltip>
</div>
</template>
</el-form-item>
</div>
<!-- <div class="param-line">
<el-form-item label="图生图">
<template #default>
<div class="form-item-inner">
@ -145,12 +192,8 @@
<el-icon @click="params.img = ''" title="清空图片">
<DeleteFilled />
</el-icon>
<el-tooltip
effect="light"
content="垫图:以某张图片为底稿参考来创作绘画 <br/> 支持 PNG 和 JPG 格式图片"
raw-content
placement="right"
>
<el-tooltip effect="light" content="垫图:以某张图片为底稿参考来创作绘画 <br/> 支持 PNG 和 JPG 格式图片"
raw-content placement="right">
<el-icon>
<InfoFilled />
</el-icon>
@ -161,50 +204,14 @@
</div>
<div class="param-line">
<el-upload
class="img-uploader"
:auto-upload="true"
:show-file-list="false"
:http-request="afterRead"
style="--el-color-primary:#47fff1"
>
<el-upload class="img-uploader" :auto-upload="true" :show-file-list="false"
:http-request="afterRead" style="--el-color-primary:#47fff1">
<el-image v-if="params.img !== ''" :src="params.img" fit="cover" />
<el-icon v-else class="uploader-icon">
<Plus />
</el-icon>
</el-upload>
</div>
<div class="param-line" style="padding-top: 10px">
<el-form-item label="图像权重">
<template #default>
<div class="form-item-inner">
<el-slider v-model.number="params.weight" :max="1" :step="0.01"
style="width: 180px;--el-slider-main-bg-color:#47fff1"/>
<el-tooltip
effect="light"
content="使用图像权重参数--iw来调整图像 URL 与文本的重要性 <br/>权重较高时意味着图像提示将对完成的作业产生更大的影响"
raw-content
placement="right"
>
<el-icon style="margin-top: 6px">
<InfoFilled/>
</el-icon>
</el-tooltip>
</div>
</template>
</el-form-item>
</div>
<div class="param-line">
<el-input
v-model="params.prompt"
:autosize="{ minRows: 4, maxRows: 6 }"
type="textarea"
ref="promptRef"
placeholder="这里输入你的英文咒语例如A chinese girl walking in the middle of a cobblestone street"
/>
</div>
</div> -->
<div class="param-line pt">
<el-form-item label="剩余次数">
@ -215,23 +222,142 @@
</div>
</el-form>
</div>
<div class="submit-btn">
<!-- <div class="submit-btn">
<el-button color="#47fff1" :dark="false" round @click="generate">立即生成</el-button>
</div>
</div> -->
</div>
<div class="task-list-box">
<div class="task-list-inner" :style="{ height: listBoxHeight + 'px' }">
<h2>AI绘画</h2>
<el-tabs v-model="activeName" class="title-tabs" @tab-click="handleClick">
<el-tab-pane label="图生图(可选)" name="图生图">
<div class="text">图生图以某张图片为底稿参考来创作绘画生成类似风格或类型图像支持 PNG JPG 格式图片</div>
<div class="param-line pt">
<el-form-item label="">
<template #default>
<div class="form-item-inner flex-row items-center">
<el-input v-model="params.img" size="small" placeholder="请输入图片地址或者上传图片"
style="width: 300px;" />
<el-icon @click="params.img = ''" title="清空图片">
<DeleteFilled />
</el-icon>
<el-tooltip effect="light" content="垫图:以某张图片为底稿参考来创作绘画 <br/> 支持 PNG 和 JPG 格式图片"
raw-content placement="right">
<el-icon>
<InfoFilled />
</el-icon>
</el-tooltip>
</div>
</template>
</el-form-item>
</div>
<div class="param-line">
<el-upload class="img-uploader" :auto-upload="true" :show-file-list="false"
:http-request="afterRead" style="--el-color-primary:#47fff1">
<el-image v-if="params.img !== ''" :src="params.img" fit="cover" />
<el-icon v-else class="uploader-icon">
<Plus />
</el-icon>
</el-upload>
</div>
<div class="param-line" style="padding-top: 10px">
<el-form-item label="图像权重:">
<template #default>
<div class="form-item-inner">
<el-slider v-model.number="params.weight" :max="1" :step="0.01"
style="width: 180px;--el-slider-main-bg-color:#47fff1" />
<el-tooltip effect="light"
content="使用图像权重参数--iw来调整图像 URL 与文本的重要性 <br/>权重较高时意味着图像提示将对完成的作业产生更大的影响"
raw-content placement="right">
<el-icon style="margin-top: 9px">
<InfoFilled />
</el-icon>
</el-tooltip>
</div>
</template>
</el-form-item>
</div>
</el-tab-pane>
<el-tab-pane label="图生文(可选)" name="图生文">
<div class="text">图生文上传一张图片生成对应的提示词</div>
<div class="param-line pt">
<el-empty image-size="100px" description="功能建设中" />
</div>
</el-tab-pane>
<el-tab-pane label="融图(可选)" name="融图">
<div class="text">融图融合图片风格</div>
<div class="param-line pt">
<el-empty image-size="100px" description="功能建设中" />
</div>
</el-tab-pane>
</el-tabs>
<div class="param-line pt">
<div class="flex-row justify-between items-center">
<div class="flex-row justify-start items-center">
<span>提示词</span>
<el-tooltip effect="light" content="输入你想要的内容,用逗号分割" placement="right">
<el-icon>
<InfoFilled />
</el-icon>
</el-tooltip>
</div>
<el-button type="success">
<el-icon style="margin-right: 6px;font-size: 18px;"><Refresh /></el-icon>
</el-button>
</div>
</div>
<div class="param-line pt">
<el-input v-model="params.prompt" :autosize="{ minRows: 4, maxRows: 6 }" type="textarea"
ref="promptRef"
placeholder="这里输入你的英文咒语例如A chinese girl walking in the middle of a cobblestone street" />
</div>
<div class="param-line pt">
<div class="flex-row justify-between items-center">
<div class="flex-row justify-start items-center">
<span>不希望出现的内容可选</span>
<el-tooltip effect="light" content="不想出现在图片上的元素(例如:树,建筑)" placement="right">
<el-icon>
<InfoFilled />
</el-icon>
</el-tooltip>
</div>
<el-button type="success">
<el-icon style="margin-right: 6px;font-size: 18px;"><Refresh /></el-icon>
</el-button>
</div>
</div>
<div class="param-line pt">
<el-input v-model="params.no" :autosize="{ minRows: 4, maxRows: 6 }" type="textarea"
ref="promptRef"
placeholder="这里输入你不希望出现在图片上的内容,元素" />
</div>
<div class="submit-btn">
<el-button color="#47fff1" :dark="false" size="medium" @click="generate">
<el-icon class="submit-icon">
<Notification />
</el-icon>
</el-button>
</div>
<h2>任务列表</h2>
<div class="running-job-list">
<ItemList :items="runningJobs" v-if="runningJobs.length > 0">
<template #default="scope">
<div class="job-item">
<div v-if="scope.item.progress > 0" class="job-item-inner">
<el-image :src="scope.item['img_url']"
:zoom-rate="1.2"
:preview-src-list="[scope.item['img_url']]"
fit="cover"
:initial-index="0" loading="lazy">
<el-image :src="scope.item['img_url']" :zoom-rate="1.2"
:preview-src-list="[scope.item['img_url']]" fit="cover" :initial-index="0"
loading="lazy">
<template #placeholder>
<div class="image-slot">
正在加载图片
@ -248,7 +374,8 @@
</el-image>
<div class="progress">
<el-progress type="circle" :percentage="scope.item.progress" :width="100" color="#47fff1"/>
<el-progress type="circle" :percentage="scope.item.progress" :width="100"
color="#47fff1" />
</div>
</div>
<el-image fit="cover" v-else>
@ -272,11 +399,9 @@
<div class="job-item">
<el-image
:src="scope.item.type === 'upscale' ? scope.item['img_url'] + '?imageView2/1/w/240/h/300/q/75' : scope.item['img_url'] + '?imageView2/1/w/240/h/240/q/75'"
:class="scope.item.type === 'upscale'?'upscale':''"
:zoom-rate="1.2"
:preview-src-list="[scope.item['img_url']]"
fit="cover"
:initial-index="scope.index" loading="lazy" v-if="scope.item.progress > 0">
:class="scope.item.type === 'upscale' ? 'upscale' : ''" :zoom-rate="1.2"
:preview-src-list="[scope.item['img_url']]" fit="cover" :initial-index="scope.index"
loading="lazy" v-if="scope.item.progress > 0">
<template #placeholder>
<div class="image-slot">
正在加载图片
@ -301,12 +426,7 @@
<li><a @click="upscale(4, scope.item)">U4</a></li>
<li class="show-prompt">
<el-popover
placement="left"
title="提示词"
:width="240"
trigger="hover"
>
<el-popover placement="left" title="提示词" :width="240" trigger="hover">
<template #reference>
<el-icon>
<ChromeFilled />
@ -316,7 +436,8 @@
<template #default>
<div class="mj-list-item-prompt">
<span>{{ scope.item.prompt }}</span>
<el-icon class="copy-prompt" :data-clipboard-text="scope.item.prompt">
<el-icon class="copy-prompt"
:data-clipboard-text="scope.item.prompt">
<DocumentCopy />
</el-icon>
</div>
@ -351,7 +472,7 @@
<script setup>
import { onMounted, ref } from "vue"
import {ChromeFilled, DeleteFilled, DocumentCopy, InfoFilled, Picture, Plus} from "@element-plus/icons-vue";
import { ChromeFilled, DeleteFilled, DocumentCopy, InfoFilled, Notification, Picture, Plus, Refresh } from "@element-plus/icons-vue";
import Compressor from "compressorjs";
import { httpGet, httpPost } from "@/utils/http";
import { ElMessage, ElNotification } from "element-plus";
@ -370,26 +491,60 @@ window.onresize = () => {
mjBoxHeight.value = window.innerHeight - 150
}
const rates = [
{css: "horizontal", value: "16:9", text: "横图"},
{css: "square", value: "1:1", text: "方图"},
{css: "vertical", value: "9:16", text: "竖图"},
{ css: "square", value: "1:1", text: "1:1",img: "/images/1_1.png" },
{ css: "size1-2", value: "1:2", text: "1:2",img: "/images/1_2.png" },
{ css: "size2-1", value: "2:1", text: "2:1",img: "/images/2_1.png" },
{ css: "size2-3", value: "2:3", text: "2:3",img: "/images/3_4.png" },
{ css: "size3-2", value: "3:2", text: "3:2",img: "/images/4_3.png" },
{ css: "size3-4", value: "3:4", text: "3:4",img: "/images/3_4.png" },
{ css: "size4-3", value: "4:3", text: "4:3",img: "/images/4_3.png" },
{ css: "size16-9", value: "16:9", text: "16:9",img: "/images/16_9.png" },
{ css: "size9-16", value: "9:16", text: "9:16",img: "/images/9_16.png" },
]
const models = [
{text: "标准模型", value: " --v 5.2", img: "/images/mj-normal.png"},
{text: "动漫模型", value: " --niji 5", img: "/images/mj-niji.png"},
{ text: "最新模式MJ-5.2", value: " --v 5.2", img: "/images/mj-normal.png" },
{ text: "优质模式MJ-5.1", value: " --v 5.1", img: "/images/mj1.jpg" },
{ text: "虚幻模式MJ-5", value: " --v 5", img: "/images/mj2.jpg" },
{ text: "真实模式MJ-4", value: " --v 4", img: "/images/mj3.jpg" },
{ text: "动漫风niji5 原始", value: " --niji 5", img: "/images/mj-niji.png" },
{ text: "动漫风niji5 可爱", value: " --niji 5 --style cute", img: "/images/nj1.jpg" },
{ text: "动漫风niji5 风景", value: " --niji 5 --style scenic", img: "/images/nj2.jpg" },
{ text: "动漫风niji5 表现力", value: " --niji 5 --style expressive", img: "/images/nj3.jpg" },
{ text: "动漫风niji4", value: " --niji 4", img: "/images/nj4.jpg" },
]
const options = [
{
value: 0.25,
label: '普通'
},
{
value: 0.5,
label: '清晰'
},
{
value: 1,
label: '高清'
},
]
const params = ref({
rate: rates[1].value,
rate: rates[0].value,
model: models[0].value,
chaos: 0,
stylize: 0,
stylize: 100,
seed: 0,
raw: false,
img: "",
weight: 0.25,
prompt: ""
prompt: "",
no:"",
tile:false,
quality: 1
})
const activeName = ref('图生图')
const runningJobs = ref([])
const finishedJobs = ref([])
const router = useRouter()

View File

@ -3,6 +3,7 @@ let webpack = require('webpack')
module.exports = defineConfig({
transpileDependencies: true,
lintOnSave: false, //关闭eslint校验
productionSourceMap: false, //在生产模式中禁用 Source Map既可以减少包大小也可以加密源码
configureWebpack: {
// disable performance hints
performance: {