Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
82fbb5e0
authored
May 30, 2024
by
cherishsince
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
【优化】midjourney 提交,支持 nijj 切换
parent
15a3e80d
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
15 deletions
+5
-15
src/api/ai/image/index.ts
+1
-0
src/views/ai/image/midjourney/index.vue
+4
-15
No files found.
src/api/ai/image/index.ts
View file @
82fbb5e0
...
@@ -40,6 +40,7 @@ export interface ImageDallReqVO {
...
@@ -40,6 +40,7 @@ export interface ImageDallReqVO {
export
interface
ImageMidjourneyImagineReqVO
{
export
interface
ImageMidjourneyImagineReqVO
{
prompt
:
string
// 提示词
prompt
:
string
// 提示词
model
:
string
// 模型 mj nijj
base64Array
:
string
[]
// size不能为空
base64Array
:
string
[]
// size不能为空
}
}
...
...
src/views/ai/image/midjourney/index.vue
View file @
82fbb5e0
...
@@ -77,17 +77,17 @@ interface ImageSizeVO {
...
@@ -77,17 +77,17 @@ interface ImageSizeVO {
// 定义属性
// 定义属性
const
prompt
=
ref
<
string
>
(
''
)
// 提示词
const
prompt
=
ref
<
string
>
(
''
)
// 提示词
const
selectHotWord
=
ref
<
string
>
(
''
)
// 选中的热词
const
selectHotWord
=
ref
<
string
>
(
'
midjourney
'
)
// 选中的热词
const
hotWords
=
ref
<
string
[]
>
([
'中国旗袍'
,
'古装美女'
,
'卡通头像'
,
'机甲战士'
,
'童话小屋'
,
'中国长城'
])
// 热词
const
hotWords
=
ref
<
string
[]
>
([
'中国旗袍'
,
'古装美女'
,
'卡通头像'
,
'机甲战士'
,
'童话小屋'
,
'中国长城'
])
// 热词
const
selectModel
=
ref
<
any
>
()
// 选中的热词
const
selectModel
=
ref
<
any
>
()
// 选中的热词
const
models
=
ref
<
ImageModelVO
[]
>
([
const
models
=
ref
<
ImageModelVO
[]
>
([
{
{
key
:
'
qinxi
'
,
key
:
'
midjourney
'
,
name
:
'MJ'
,
name
:
'MJ'
,
image
:
'https://bigpt8.com/pc/_nuxt/mj.34a61377.png'
,
image
:
'https://bigpt8.com/pc/_nuxt/mj.34a61377.png'
,
},
},
{
{
key
:
'
ziran
'
,
key
:
'
niji
'
,
name
:
'NIJI'
,
name
:
'NIJI'
,
image
:
'https://bigpt8.com/pc/_nuxt/nj.ca79b143.png'
,
image
:
'https://bigpt8.com/pc/_nuxt/nj.ca79b143.png'
,
},
},
...
@@ -123,18 +123,6 @@ const handlerModelClick = async (model: ImageModelVO) => {
...
@@ -123,18 +123,6 @@ const handlerModelClick = async (model: ImageModelVO) => {
}
}
/**
/**
* size - click
*/
const
handlerSizeClick
=
async
(
imageSize
:
ImageSizeVO
)
=>
{
if
(
selectImageSize
.
value
===
imageSize
)
{
selectImageSize
.
value
=
{}
as
ImageSizeVO
return
}
selectImageSize
.
value
=
imageSize
console
.
log
(
imageSize
)
}
/**
* 图片生产
* 图片生产
*/
*/
const
handlerGenerateImage
=
async
()
=>
{
const
handlerGenerateImage
=
async
()
=>
{
...
@@ -145,6 +133,7 @@ const handlerGenerateImage = async () => {
...
@@ -145,6 +133,7 @@ const handlerGenerateImage = async () => {
// 发送请求
// 发送请求
const
req
=
{
const
req
=
{
prompt
:
prompt
.
value
,
prompt
:
prompt
.
value
,
model
:
selectModel
.
value
.
key
,
base64Array
:
[],
base64Array
:
[],
}
as
ImageMidjourneyImagineReqVO
}
as
ImageMidjourneyImagineReqVO
await
ImageApi
.
midjourneyImagine
(
req
)
await
ImageApi
.
midjourneyImagine
(
req
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment