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
d14ba2ed
authored
Jul 12, 2024
by
cherishsince
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
【增加】ChatGlm 对接 Image
parent
dd76cc58
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
2 deletions
+19
-2
src/views/ai/image/index/components/other/index.vue
+7
-2
src/views/ai/utils/constants.ts
+12
-0
No files found.
src/views/ai/image/index/components/other/index.vue
View file @
d14ba2ed
...
@@ -61,7 +61,7 @@
...
@@ -61,7 +61,7 @@
</el-select>
</el-select>
</el-space>
</el-space>
</div>
</div>
<div
class=
"group-item"
>
<div
class=
"group-item"
v-if=
"otherPlatform !== AiPlatformEnum.CHATGLM"
>
<div>
<div>
<el-text
tag=
"b"
>
图片尺寸
</el-text>
<el-text
tag=
"b"
>
图片尺寸
</el-text>
</div>
</div>
...
@@ -79,7 +79,7 @@
...
@@ -79,7 +79,7 @@
<
script
setup
lang=
"ts"
>
<
script
setup
lang=
"ts"
>
import
{
ImageApi
,
ImageDrawReqVO
,
ImageVO
}
from
'@/api/ai/image'
import
{
ImageApi
,
ImageDrawReqVO
,
ImageVO
}
from
'@/api/ai/image'
import
{
import
{
AiPlatformEnum
,
AiPlatformEnum
,
ChatGlmModels
,
ImageHotWords
,
ImageHotWords
,
ImageModelVO
,
ImageModelVO
,
OtherPlatformEnum
,
OtherPlatformEnum
,
...
@@ -159,6 +159,11 @@ const handlerPlatformChange = async (platform) => {
...
@@ -159,6 +159,11 @@ const handlerPlatformChange = async (platform) => {
models
.
value
=
TongYiWanXiangModels
models
.
value
=
TongYiWanXiangModels
}
else
if
(
AiPlatformEnum
.
YI_YAN
===
platform
)
{
}
else
if
(
AiPlatformEnum
.
YI_YAN
===
platform
)
{
models
.
value
=
QianFanModels
models
.
value
=
QianFanModels
}
else
if
(
AiPlatformEnum
.
CHATGLM
===
platform
)
{
models
.
value
=
ChatGlmModels
// ChatGlm 模型没有 width、height 随便默认一个值过后台必填检测
height
.
value
=
512
width
.
value
=
512
}
else
{
}
else
{
models
.
value
=
[]
models
.
value
=
[]
}
}
...
...
src/views/ai/utils/constants.ts
View file @
d14ba2ed
...
@@ -21,6 +21,7 @@ export const AiPlatformEnum = {
...
@@ -21,6 +21,7 @@ export const AiPlatformEnum = {
STABLE_DIFFUSION
:
'StableDiffusion'
,
// Stability AI
STABLE_DIFFUSION
:
'StableDiffusion'
,
// Stability AI
MIDJOURNEY
:
'Midjourney'
,
// Midjourney
MIDJOURNEY
:
'Midjourney'
,
// Midjourney
SUNO
:
'Suno'
,
// Suno AI
SUNO
:
'Suno'
,
// Suno AI
CHATGLM
:
'ChatGlm'
,
// ChatGlm
}
}
export
const
OtherPlatformEnum
:
ImageModelVO
[]
=
[
export
const
OtherPlatformEnum
:
ImageModelVO
[]
=
[
...
@@ -31,6 +32,10 @@ export const OtherPlatformEnum:ImageModelVO [] = [
...
@@ -31,6 +32,10 @@ export const OtherPlatformEnum:ImageModelVO [] = [
{
{
key
:
AiPlatformEnum
.
YI_YAN
,
key
:
AiPlatformEnum
.
YI_YAN
,
name
:
'百度千帆'
name
:
'百度千帆'
},
{
key
:
AiPlatformEnum
.
CHATGLM
,
name
:
'智铺 ChatGlm'
}
}
]
]
...
@@ -266,6 +271,13 @@ export const QianFanModels: ImageModelVO[] = [
...
@@ -266,6 +271,13 @@ export const QianFanModels: ImageModelVO[] = [
}
}
]
]
export
const
ChatGlmModels
:
ImageModelVO
[]
=
[
{
key
:
'cogview-3'
,
name
:
'cogview-3'
}
]
export
const
StableDiffusionClipGuidancePresets
:
ImageModelVO
[]
=
[
export
const
StableDiffusionClipGuidancePresets
:
ImageModelVO
[]
=
[
{
{
...
...
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